---
title: "Add a user to a team"
method: POST
path: "/api/v2/team/{team_id}/memberships"
tags: ["Teams"]
---

# Add a user to a team

`POST /api/v2/team/{team_id}/memberships`

Add a user to a team.

**Note**: Each team has a setting that determines who is allowed to modify membership of the team. The `user_access_manage` permission generally grants access to modify membership of any team. To get the full picture, see [Team Membership documentation](https://docs.datadoghq.com/account_management/teams/manage/#team-membership).

## Path parameters

- `team_id` string, required

## Request body

- UserTeamRequest — Team membership request
  - `data` UserTeamCreate, required — A user's relationship with a team
    - `attributes` UserTeamAttributes — Team membership attributes
      - `provisioned_by` string, nullable — The mechanism responsible for provisioning the team relationship. Possible values: null for added by a user, "service_account" if added by a service account, and "saml_mapping" if provisioned via SAML mapping.
      - `provisioned_by_id` string, nullable — UUID of the User or Service Account who provisioned this team membership, or null if provisioned via SAML mapping.
      - `role` 'admin', nullable — The user's role within the team
    - `relationships` UserTeamRelationships — Relationship between membership and a user
      - `team` RelationshipToUserTeamTeam — Relationship between team membership and team
        - `data` RelationshipToUserTeamTeamData, required — The team associated with the membership
          - `id` string, required — The ID of the team associated with the membership
          - `type` 'team', required — User team team type
      - `user` RelationshipToUserTeamUser — Relationship between team membership and user
        - `data` RelationshipToUserTeamUserData, required — A user's relationship with a team
          - `id` string, required — The ID of the user associated with the team
          - `type` 'users', required — User team user type
    - `type` 'team_memberships', required — Team membership type

## Response `200`

Represents a user's association to a team

- UserTeamResponse — Team membership response
  - `data` UserTeam — A user's relationship with a team
    - `attributes` UserTeamAttributes — Team membership attributes
      - `provisioned_by` string, nullable — The mechanism responsible for provisioning the team relationship. Possible values: null for added by a user, "service_account" if added by a service account, and "saml_mapping" if provisioned via SAML mapping.
      - `provisioned_by_id` string, nullable — UUID of the User or Service Account who provisioned this team membership, or null if provisioned via SAML mapping.
      - `role` 'admin', nullable — The user's role within the team
    - `id` string, required — The ID of a user's relationship with a team
    - `relationships` UserTeamRelationships — Relationship between membership and a user
      - `team` RelationshipToUserTeamTeam — Relationship between team membership and team
        - `data` RelationshipToUserTeamTeamData, required — The team associated with the membership
          - `id` string, required — The ID of the team associated with the membership
          - `type` 'team', required — User team team type
      - `user` RelationshipToUserTeamUser — Relationship between team membership and user
        - `data` RelationshipToUserTeamUserData, required — A user's relationship with a team
          - `id` string, required — The ID of the user associated with the team
          - `type` 'users', required — User team user type
    - `type` 'team_memberships', required — Team membership type
  - `included` UserTeamIncluded[] — Resources related to the team memberships
    - union — Included resources related to the team membership
      - User — User object returned by the API.
        - `attributes` UserAttributes — Attributes of user object returned by the API.
          - `created_at` string, date-time — The ISO 8601 timestamp of when the user account was created.
          - `disabled` boolean — Whether the user account is deactivated. Disabled users cannot log in.
          - `email` string — The email address of the user, used for login and notifications.
          - `handle` string — The unique handle (username) of the user, typically matching their email prefix.
          - `icon` string — URL of the user's profile icon, typically a Gravatar URL derived from the email address.
          - `last_login_time` string, date-time, nullable — The ISO 8601 timestamp of the user's most recent login, or null if the user has never logged in.
          - `mfa_enabled` boolean — Whether multi-factor authentication (MFA) is enabled for the user's account.
          - `modified_at` string, date-time — The ISO 8601 timestamp of when the user account was last modified.
          - `name` string, nullable — The full display name of the user as shown in the Datadog UI.
          - `service_account` boolean — Whether this is a service account rather than a human user. Service accounts are used for programmatic API access.
          - `status` string — The current status of the user account (for example, `Active`, `Pending`, or `Disabled`).
          - `title` string, nullable — The job title of the user (for example, "Senior Engineer" or "Product Manager").
          - `uuid` string — The globally unique identifier (UUID) of the user.
          - `verified` boolean — Whether the user's email address has been verified.
        - `id` string — ID of the user.
        - `relationships` UserResponseRelationships — Relationships of the user object returned by the API.
          - `org` RelationshipToOrganization — Relationship to an organization.
            - `data` RelationshipToOrganizationData, required — Relationship to organization object.
              - …
          - `other_orgs` RelationshipToOrganizations — Relationship to organizations.
            - `data` RelationshipToOrganizationData[], required — Relationships to organization objects.
              - …
          - `other_users` RelationshipToUsers — Relationship to users.
            - `data` RelationshipToUserData[], required — Relationships to user objects.
              - …
          - `roles` RelationshipToRoles — Relationship to roles.
            - `data` RelationshipToRoleData[] — An array containing type and the unique identifier of a role.
              - …
        - `type` 'users' — Users resource type.
      - Team — A team
        - `attributes` TeamAttributes, required — Team attributes
          - `avatar` string, nullable — Unicode representation of the avatar for the team, limited to a single grapheme
          - `banner` integer, nullable — Banner selection for the team
          - `created_at` string, date-time — Creation date of the team
          - `description` string, nullable — Free-form markdown description/content for the team's homepage
          - `handle` string, required — The team's identifier
          - `hidden_modules` string[], nullable — Collection of hidden modules for the team
          - `is_managed` boolean — Whether the team is managed from an external source
          - `link_count` integer — The number of links belonging to the team
          - `modified_at` string, date-time — Modification date of the team
          - `name` string, required — The name of the team
          - `summary` string, nullable — A brief summary of the team, derived from the `description`
          - `user_count` integer — The number of users belonging to the team
          - `visible_modules` string[], nullable — Collection of visible modules for the team
        - `id` string, required — The team's identifier
        - `relationships` TeamRelationships — Resources related to a team
          - `team_links` RelationshipToTeamLinks — Relationship between a team and a team link
            - `data` RelationshipToTeamLinkData[] — Related team links
              - …
            - `links` TeamRelationshipsLinks — Links attributes.
              - …
          - `user_team_permissions` RelationshipToUserTeamPermission — Relationship between a user team permission and a team
            - `data` RelationshipToUserTeamPermissionData, nullable — Related user team permission data
              - …
            - `links` TeamRelationshipsLinks — Links attributes.
              - …
        - `type` 'team', required — Team type

## Other responses

- `403` — Forbidden
- `404` — API error response.
- `409` — API error response.
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/versions/da68bf029e4c/schema)
