---
title: "Delete resources from a batch migration"
method: DELETE
path: "/api/v2/security_monitoring/batch-migrations/{batch_id}/resources"
tags: ["Security Monitoring"]
---

# Delete resources from a batch migration

`DELETE /api/v2/security_monitoring/batch-migrations/{batch_id}/resources`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/resources`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `security_monitoring_rules_write`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/security_monitoring/batch-migrations/:batch_id/resources/delete.ts> (a function with typed inputs; its response is checked against the schema)

Delete resources from a batch migration. The request is all-or-nothing: it returns
`404 Not Found` if any resource does not exist, and `409 Conflict` if any resource is
`in_progress` or `publishing`. In both cases nothing is deleted. Duplicate resource IDs
are ignored. Detection rules already published from the deleted resources are not deleted.

## Path parameters

- `batch_id` string, uuid, required

## Request body

- SecurityMonitoringBatchMigrationResourcesDeleteRequest: Request to delete resources from a batch migration.
  - `data` SecurityMonitoringBatchMigrationResourcesDeleteData, required: Data of the resources to delete from a batch migration.
    - `attributes` SecurityMonitoringBatchMigrationResourcesDeleteAttributes, required: Attributes of the resources to delete from a batch migration.
      - `resourceIds` string[], required: Unique UUIDs of batch migration resources. From 1 to 1000 IDs.
    - `type` 'batchMigrationResources', required: The type of resource for a request on a set of batch migration resources.

## Response `204`

No Content

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
