Bulk delete org group memberships
https://api.datadoghq.com/api/v2/org_group_memberships/bulk_deletehttps://api.us3.datadoghq.com/api/v2/org_group_memberships/bulk_deletehttps://api.us5.datadoghq.com/api/v2/org_group_memberships/bulk_deletehttps://api.datadoghq.eu/api/v2/org_group_memberships/bulk_deletehttps://api.ap1.datadoghq.com/api/v2/org_group_memberships/bulk_deletehttps://api.ap2.datadoghq.com/api/v2/org_group_memberships/bulk_deletehttps://api.uk1.datadoghq.com/api/v2/org_group_memberships/bulk_deletehttps://api.ddog-gov.com/api/v2/org_group_memberships/bulk_deletehttps://api.us2.ddog-gov.com/api/v2/org_group_memberships/bulk_deleteOverview
Delete a batch of memberships from an organization group. This operation is not supported for organization groups with group_type set to config_management. The memberships to delete are provided as membership resource identifiers, and the organization group they belong to must be specified using filter[org_group_id]. Each request must include between 1 and 100 unique membership IDs, and the requesting organization must own the organization group. The request does not fail if a membership ID refers to a membership that has already been deleted, does not exist, or does not belong to the organization group.
Arguments
Query Strings
filter[org_group_id] [required]The ID of the organization group that the memberships belong to.
Request
Body Data (required)
data [required]The memberships to delete, specified as membership resource identifiers. Each request must include between 1 and 100 unique membership IDs.
id [required]The ID of the org group membership.
type [required]Org group memberships resource type.
org_group_memberships{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
}
]
}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"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
# Required query arguments
export filter_org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789"
# 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 POST "https://api.${DD_SITE}/api/v2/org_group_memberships/bulk_delete?filter%5Borg_group_id%5D=${filter_org_group_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
},
{
"id": "e2d3c4b5-a6f7-8901-2345-67890abcdef1",
"type": "org_group_memberships"
},
{
"id": "d3c4b5a6-f7e8-9012-3456-7890abcdef12",
"type": "org_group_memberships"
}
]
}
EOF# Required query arguments
export filter_org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789"
# 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 POST "https://api.${DD_SITE}/api/v2/org_group_memberships/bulk_delete?filter%5Borg_group_id%5D=${filter_org_group_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
},
{
"id": "e2d3c4b5-a6f7-8901-2345-67890abcdef1",
"type": "org_group_memberships"
},
{
"id": "d3c4b5a6-f7e8-9012-3456-7890abcdef12",
"type": "org_group_memberships"
}
]
}
EOF# Required query arguments
export filter_org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789"
# 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 POST "https://api.${DD_SITE}/api/v2/org_group_memberships/bulk_delete?filter%5Borg_group_id%5D=${filter_org_group_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
},
{
"id": "e2d3c4b5-a6f7-8901-2345-67890abcdef1",
"type": "org_group_memberships"
},
{
"id": "d3c4b5a6-f7e8-9012-3456-7890abcdef12",
"type": "org_group_memberships"
}
]
}
EOF# Required query arguments
export filter_org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789"
# 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 POST "https://api.${DD_SITE}/api/v2/org_group_memberships/bulk_delete?filter%5Borg_group_id%5D=${filter_org_group_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
},
{
"id": "e2d3c4b5-a6f7-8901-2345-67890abcdef1",
"type": "org_group_memberships"
},
{
"id": "d3c4b5a6-f7e8-9012-3456-7890abcdef12",
"type": "org_group_memberships"
}
]
}
EOF# Required query arguments
export filter_org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789"
# 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 POST "https://api.${DD_SITE}/api/v2/org_group_memberships/bulk_delete?filter%5Borg_group_id%5D=${filter_org_group_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
},
{
"id": "e2d3c4b5-a6f7-8901-2345-67890abcdef1",
"type": "org_group_memberships"
},
{
"id": "d3c4b5a6-f7e8-9012-3456-7890abcdef12",
"type": "org_group_memberships"
}
]
}
EOF# Required query arguments
export filter_org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789"
# 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 POST "https://api.${DD_SITE}/api/v2/org_group_memberships/bulk_delete?filter%5Borg_group_id%5D=${filter_org_group_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
},
{
"id": "e2d3c4b5-a6f7-8901-2345-67890abcdef1",
"type": "org_group_memberships"
},
{
"id": "d3c4b5a6-f7e8-9012-3456-7890abcdef12",
"type": "org_group_memberships"
}
]
}
EOF# Required query arguments
export filter_org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789"
# 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 POST "https://api.${DD_SITE}/api/v2/org_group_memberships/bulk_delete?filter%5Borg_group_id%5D=${filter_org_group_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
},
{
"id": "e2d3c4b5-a6f7-8901-2345-67890abcdef1",
"type": "org_group_memberships"
},
{
"id": "d3c4b5a6-f7e8-9012-3456-7890abcdef12",
"type": "org_group_memberships"
}
]
}
EOF# Required query arguments
export filter_org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789"
# 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 POST "https://api.${DD_SITE}/api/v2/org_group_memberships/bulk_delete?filter%5Borg_group_id%5D=${filter_org_group_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
},
{
"id": "e2d3c4b5-a6f7-8901-2345-67890abcdef1",
"type": "org_group_memberships"
},
{
"id": "d3c4b5a6-f7e8-9012-3456-7890abcdef12",
"type": "org_group_memberships"
}
]
}
EOF# Required query arguments
export filter_org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789"
# 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 POST "https://api.${DD_SITE}/api/v2/org_group_memberships/bulk_delete?filter%5Borg_group_id%5D=${filter_org_group_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"type": "org_group_memberships"
},
{
"id": "e2d3c4b5-a6f7-8901-2345-67890abcdef1",
"type": "org_group_memberships"
},
{
"id": "d3c4b5a6-f7e8-9012-3456-7890abcdef12",
"type": "org_group_memberships"
}
]
}
EOF