Add team member (Legacy)

Deprecation notice

The "Add team member" endpoint (described below) is deprecated.

We recommend using the Add team membership endpoint instead. It allows you to invite new organization members to your teams.

To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.

PUT /teams/:team_id/members/:username

Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

Response

Status: 204 No Content

Response if you attempt to add an organization to a team

Status: 422 Unprocessable Entity
{
  "message": "Cannot add an organization as a member.",
  "errors": [
    {
      "code": "org",
      "field": "user",
      "resource": "TeamMember"
    }
  ]
}

Response if you attempt to add a user to a team when they are not a member of at least one other team in the same organization

Status: 422 Unprocessable Entity
{
  "message": "User isn't a member of this organization. Please invite them first.",
  "errors": [
    {
      "code": "unaffiliated",
      "field": "user",
      "resource": "TeamMember"
    }
  ]
}