Add an Organization Member to a Team

POST /api/0/organizations/{organization_slug}/members/{member_id}/teams/{team_slug}/

This request can return various success codes depending on the context of the team:

  • 201: The member has been successfully added.
  • 202: The member needs permission to join the team and an access request has been generated.
  • 204: The member is already on the team.

If the team is provisioned through an identity provider, the member cannot join the team through Sentry.

Note the permission scopes vary depending on the organization setting "Open Membership" and the type of authorization token. The following table outlines the accepted scopes.

Open Membership
OnOff
Org Auth Token
  • • org:read
  • • org:write
  • • team:write
User Auth Token
  • • org:read
  • • org:read*
  • • org:write
  • • org:read +
  •    team:write**

*Organization members are restricted to this scope. When sending a request, it will always return a 202 and request an invite to the team.

**Team Admins must have both org:read and team:write scopes in their user authorization token to add members to their teams.

Path Parameters

organization_slug (string)
REQUIRED

The slug of the organization the resource belongs to.

member_id (string)
REQUIRED

The ID of the organization member to add to the team

team_slug (string)
REQUIRED

The slug of the team the resource belongs to.

Scopes

<auth_token> requires one of the following scopes:
  • org:read
  • org:write
  • team:write
curl https://sentry.io/api/0/organizations/{organization_slug}/members/{member_id}/teams/{team_slug}/ \
 -H 'Authorization: Bearer <auth_token>'
RESPONSESCHEMA
{
  "id": "4502349234123",
  "slug": "ancient-gabelers",
  "name": "Ancient Gabelers",
  "dateCreated": "2023-05-31T19:47:53.621181Z",
  "isMember": true,
  "teamRole": "contributor",
  "flags": {
    "idp:provisioned": false
  },
  "access": [
    "alerts:read",
    "event:write",
    "project:read",
    "team:read",
    "member:read",
    "project:releases",
    "event:read",
    "org:read"
  ],
  "hasAccess": true,
  "isPending": false,
  "memberCount": 3,
  "avatar": {
    "avatarType": "letter_avatar",
    "avatarUuid": null
  }
}