For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ko/api/latest/teams/add-a-user-to-a-team.md. A documentation index is available at /llms.txt.
Language
Datadog site

팀에 사용자 추가

POSThttps://api.datadoghq.com/api/v2/team/{team_id}/membershipshttps://api.us3.datadoghq.com/api/v2/team/{team_id}/membershipshttps://api.us5.datadoghq.com/api/v2/team/{team_id}/membershipshttps://api.datadoghq.eu/api/v2/team/{team_id}/membershipshttps://api.ap1.datadoghq.com/api/v2/team/{team_id}/membershipshttps://api.ap2.datadoghq.com/api/v2/team/{team_id}/membershipshttps://api.uk1.datadoghq.com/api/v2/team/{team_id}/membershipshttps://api.ddog-gov.com/api/v2/team/{team_id}/membershipshttps://api.us2.ddog-gov.com/api/v2/team/{team_id}/memberships

개요

팀에 사용자를 추가합니다.

참고: 각 팀에는 팀 멤버십 수정 권한을 결정하는 설정이 있습니다. user_access_manage 권한은 일반적으로 모든 팀의 멤버십을 수정할 수 있는 액세스 권한을 부여합니다. 전체 내용을 파악하려면 팀 멤버십 설명서를 참조하세요.

This endpoint requires the teams_read permission.

OAuth apps require the teams_read authorization scope to access this endpoint.

인수

경로 파라미터

이름
유형
설명
team_id [required]
string

None

요청

Body Data (required)

항목
유형
설명
data [required]
object

팀 멤버십 요청입니다.

응답

Represents a user's association to a team

Team membership response

항목
유형
설명
data
object

A user's relationship with a team

included
[<oneOf>]

Resources related to the team memberships

코드 예시

Add a user to a team returns "Represents a user's association to a team" response
# Path parameters
export team_id="CHANGE_ME"

# 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/team/${team_id}/memberships" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "role": "admin"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    },
    "type": "team_memberships"
  }
}
EOF
# Path parameters
export team_id="CHANGE_ME"

# 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/team/${team_id}/memberships" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "role": "admin"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    },
    "type": "team_memberships"
  }
}
EOF
# Path parameters
export team_id="CHANGE_ME"

# 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/team/${team_id}/memberships" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "role": "admin"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    },
    "type": "team_memberships"
  }
}
EOF
# Path parameters
export team_id="CHANGE_ME"

# 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/team/${team_id}/memberships" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "role": "admin"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    },
    "type": "team_memberships"
  }
}
EOF
# Path parameters
export team_id="CHANGE_ME"

# 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/team/${team_id}/memberships" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "role": "admin"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    },
    "type": "team_memberships"
  }
}
EOF
# Path parameters
export team_id="CHANGE_ME"

# 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/team/${team_id}/memberships" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "role": "admin"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    },
    "type": "team_memberships"
  }
}
EOF
# Path parameters
export team_id="CHANGE_ME"

# 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/team/${team_id}/memberships" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "role": "admin"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    },
    "type": "team_memberships"
  }
}
EOF
# Path parameters
export team_id="CHANGE_ME"

# 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/team/${team_id}/memberships" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "role": "admin"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    },
    "type": "team_memberships"
  }
}
EOF
# Path parameters
export team_id="CHANGE_ME"

# 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/team/${team_id}/memberships" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "role": "admin"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    },
    "type": "team_memberships"
  }
}
EOF