Create org group memberships
https://api.datadoghq.com/api/v2/org_group_membershipshttps://api.us3.datadoghq.com/api/v2/org_group_membershipshttps://api.us5.datadoghq.com/api/v2/org_group_membershipshttps://api.datadoghq.eu/api/v2/org_group_membershipshttps://api.ap1.datadoghq.com/api/v2/org_group_membershipshttps://api.ap2.datadoghq.com/api/v2/org_group_membershipshttps://api.uk1.datadoghq.com/api/v2/org_group_membershipshttps://api.ddog-gov.com/api/v2/org_group_membershipshttps://api.us2.ddog-gov.com/api/v2/org_group_membershipsDescripción general
Add a batch of organizations to an existing organization group. This operation is not supported for organization groups with group_type set to config_management. This is an atomic operation: either all organizations are added or none are. Each request must include between 1 and 100 organizations. Each organization must be identified by a unique org_uuid and org_site pair, and must be in the same site as the requesting organization. The requesting organization must own the organization group.
Solicitud
Body Data (required)
data [required]Data for adding organizations to an org group.
attributes [required]Attributes for adding organizations to an org group.
orgs [required]List of organizations to add. Each request must include between 1 and 100 organizations. Each org_uuid and org_site pair must be unique.
org_site [required]The site of the organization.
org_uuid [required]The UUID of the organization.
relationships [required]Relationships for adding organizations to an org group.
org_group [required]Relationship to a single org group.
data [required]A reference to an org group.
id [required]The ID of the org group.
type [required]Org groups resource type.
org_groupstype [required]Org group memberships resource type.
org_group_memberships{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}Respuesta
Created
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"
]
}Ejemplo de código
# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}
EOF# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}
EOF# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}
EOF# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}
EOF# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}
EOF# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}
EOF# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}
EOF# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}
EOF# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"orgs": [
{
"org_site": "us1",
"org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
}
]
},
"relationships": {
"org_group": {
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"type": "org_groups"
}
}
},
"type": "org_group_memberships"
}
}
EOF