Delete resources from a batch migration
https://api.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/resourceshttps://api.us3.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/resourceshttps://api.us5.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/resourceshttps://api.datadoghq.eu/api/v2/security_monitoring/batch-migrations/{batch_id}/resourceshttps://api.ap1.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/resourceshttps://api.ap2.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/resourceshttps://api.uk1.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/resourceshttps://api.ddog-gov.com/api/v2/security_monitoring/batch-migrations/{batch_id}/resourceshttps://api.us2.ddog-gov.com/api/v2/security_monitoring/batch-migrations/{batch_id}/resourcesOverview
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.
OAuth apps require the security_monitoring_rules_write authorization scope to access this endpoint.
Arguments
Path Parameters
batch_id [required]The UUID of the batch migration.
Request
Body Data (required)
data [required]Data of the resources to delete from a batch migration.
attributes [required]Attributes of the resources to delete from a batch migration.
resourceIds [required]Unique UUIDs of batch migration resources. From 1 to 1000 IDs.
type [required]The type of resource for a request on a set of batch migration resources.
batchMigrationResources{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}Response
No Content
Bad Request
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Unauthorized
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Forbidden
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Not Found
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Conflict
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/resources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}
EOF# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/resources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}
EOF# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/resources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}
EOF# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/resources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}
EOF# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/resources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}
EOF# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/resources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}
EOF# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/resources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}
EOF# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/resources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}
EOF# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X DELETE "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/resources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationResources"
}
}
EOF