Get team hierarchy members
https://api.datadoghq.com/api/v2/team/{team_id}/membershttps://api.us3.datadoghq.com/api/v2/team/{team_id}/membershttps://api.us5.datadoghq.com/api/v2/team/{team_id}/membershttps://api.datadoghq.eu/api/v2/team/{team_id}/membershttps://api.ap1.datadoghq.com/api/v2/team/{team_id}/membershttps://api.ap2.datadoghq.com/api/v2/team/{team_id}/membershttps://api.uk1.datadoghq.com/api/v2/team/{team_id}/membershttps://api.ddog-gov.com/api/v2/team/{team_id}/membershttps://api.us2.ddog-gov.com/api/v2/team/{team_id}/members개요
List the direct and inherited members of a team, deduplicated by user.
Members of descendant teams are included unless filter[is_direct_only] is true.
Datadog support users are always excluded.
Use page[number] and page[size] to paginate through the results.
Invalid query parameters return a JSON:API error with status 400.
Invalid or unknown team UUIDs return status 404.
OAuth apps require the teams_read authorization scope to access this endpoint.
인수
경로 파라미터
team_id [required]UUID of the requested root team.
쿼리 문자열
filter[is_direct_only]Return only direct members. By default, members inherited from descendant teams are also returned.
falsefilter[include_service_accounts]Include service accounts. Datadog support users are always excluded.
truefilter[keyword]Filter by a case-insensitive substring of the user name, handle, or email.
includeComma-separated resources to include: user and team. The included team is the requested team. Whitespace is trimmed, and duplicate or empty entries are ignored.
sortComma-separated sort fields: name, handle, is_direct, and provisioned_by. Fields are applied in order, each optionally prefixed with - for descending order. By default, team admins come first, followed by other direct members, then inherited members, sorted by name within each group.
page[number]Zero-based page number. Negative values become 0. Defaults to 0.
0page[size]Requested number of members per page. Defaults to and maxes out at 100.
100응답
OK
Direct and inherited members of the requested team.
data [required]Membership relationships for users who belong to the requested team or inherit membership through its descendant teams. Each user appears once, even if they belong to multiple teams in the hierarchy. Each relationship identifies the user and requested team, and indicates whether the user is a direct member of the requested team.
attributes [required]Membership attributes relative to the requested team.
direct_role [required]Role on the requested team: admin or member. Null for inherited members.
is_direct [required]Whether the user belongs directly to the requested team.
provisioned_by [required]Membership provisioner. Null for inherited members.
provisioned_by_id [required]Identifier supplied by the membership provisioner. Null when unavailable or for inherited members.
id [required]Relationship identifier containing the team UUID and user UUID.
relationships [required]User and requested team linkage.
team [required]Linkage to the requested team.
data [required]Team resource identifier.
id [required]UUID of the team.
type [required]Requested team resource type.
teamsteamsuser [required]Linkage to the user.
data [required]User resource identifier.
id [required]UUID of the user.
type [required]Users resource type.
usersuserstype [required]Team hierarchy membership resource type.
user_team_relationshipuser_team_relationshipincludedRequested users and the team. May be absent when the result is empty, even if requested.
<type=users>A user included in the hierarchy members response.
attributes [required]Attributes of user object returned by the API.
created_atThe ISO 8601 timestamp of when the user account was created.
disabledWhether the user account is deactivated. Disabled users cannot log in.
emailThe email address of the user, used for login and notifications.
handleThe unique handle (username) of the user, typically matching their email prefix.
iconURL of the user's profile icon, typically a Gravatar URL derived from the email address.
last_login_timeThe ISO 8601 timestamp of the user's most recent login, or null if the user has never logged in.
mfa_enabledWhether multi-factor authentication (MFA) is enabled for the user's account.
modified_atThe ISO 8601 timestamp of when the user account was last modified.
nameThe full display name of the user as shown in the Datadog UI.
service_accountWhether this is a service account rather than a human user. Service accounts are used for programmatic API access.
statusThe current status of the user account (for example, Active, Pending, or Disabled).
titleThe job title of the user (for example, "Senior Engineer" or "Product Manager").
uuidThe globally unique identifier (UUID) of the user.
verifiedWhether the user's email address has been verified.
id [required]UUID of the user.
type [required]Users resource type.
usersusers<type=teams>The requested team, included at most once. Descendant teams are not included.
attributesAvailable attributes of the requested team.
handleHandle of the team.
nameName of the team.
id [required]UUID of the requested team.
type [required]Requested team resource type.
teamsteamslinks [required]Page navigation links. Unavailable links are omitted.
firstFirst page URL.
lastLast page URL.
nextNext page URL.
prevPrevious page URL.
selfCurrent page URL.
meta [required]Pagination metadata for the filtered members.
page [required]Pagination metadata for the selected pagination mode.
<type=offset_limit>Pagination metadata using offset and limit.
first_offset [required]First offset.
last_offset [required]Last offset. Null when unavailable.
limit [required]Maximum number of members per page.
next_offset [required]Next offset. Null when unavailable.
offset [required]Current offset.
prev_offset [required]Previous offset. Null when unavailable.
total [required]Total number of members matching the filters.
type [required]Pagination mode.
offset_limitoffset_limit<type=number_size>Pagination metadata using number and size.
first_number [required]First page number.
last_number [required]Last page number. Null when unavailable.
next_number [required]Next page number. Null when unavailable.
number [required]Current zero-based page number.
prev_number [required]Previous page number. Null when unavailable.
size [required]Maximum number of members per page.
total [required]Total number of members matching the filters.
type [required]Pagination mode.
number_sizenumber_size{
"data": [
{
"attributes": {
"direct_role": "member",
"is_direct": true,
"provisioned_by": "manual",
"provisioned_by_id": "00000000-0000-0000-0000-000000000003"
},
"id": "UserTeamRelationship:692e8073-12c4-4c71-8408-5090bd44c9c8:00000000-0000-0000-0000-000000000001",
"relationships": {
"team": {
"data": {
"id": "692e8073-12c4-4c71-8408-5090bd44c9c8",
"type": "teams"
}
},
"user": {
"data": {
"id": "00000000-0000-0000-0000-000000000001",
"type": "users"
}
}
},
"type": "user_team_relationship"
}
],
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"last_login_time": "2019-09-19T10:00:00.000Z",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"uuid": "string",
"verified": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "users"
}
],
"links": {
"first": "https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100",
"last": "https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100",
"next": "https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100",
"prev": "https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100",
"self": "https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100"
},
"meta": {
"page": {
"first_offset": 0,
"last_offset": 0,
"limit": 100,
"next_offset": null,
"offset": 0,
"prev_offset": null,
"total": 2,
"type": "offset_limit"
}
}
}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.
{
"errors": [
"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"
]
}코드 예시
# Path parameters
export team_id="692e8073-12c4-4c71-8408-5090bd44c9c8"
# 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 GET "https://api.${DD_SITE}/api/v2/team/${team_id}/members" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="692e8073-12c4-4c71-8408-5090bd44c9c8"
# 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 GET "https://api.${DD_SITE}/api/v2/team/${team_id}/members" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="692e8073-12c4-4c71-8408-5090bd44c9c8"
# 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 GET "https://api.${DD_SITE}/api/v2/team/${team_id}/members" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="692e8073-12c4-4c71-8408-5090bd44c9c8"
# 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 GET "https://api.${DD_SITE}/api/v2/team/${team_id}/members" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="692e8073-12c4-4c71-8408-5090bd44c9c8"
# 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 GET "https://api.${DD_SITE}/api/v2/team/${team_id}/members" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="692e8073-12c4-4c71-8408-5090bd44c9c8"
# 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 GET "https://api.${DD_SITE}/api/v2/team/${team_id}/members" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="692e8073-12c4-4c71-8408-5090bd44c9c8"
# 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 GET "https://api.${DD_SITE}/api/v2/team/${team_id}/members" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="692e8073-12c4-4c71-8408-5090bd44c9c8"
# 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 GET "https://api.${DD_SITE}/api/v2/team/${team_id}/members" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="692e8073-12c4-4c71-8408-5090bd44c9c8"
# 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 GET "https://api.${DD_SITE}/api/v2/team/${team_id}/members" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"