Sample - GitHub REST API
PUT/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}

Assign an organization role to a team

Assigns an organization role to a team in an organization. For more information on organization roles, see "Using organization roles."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
orgstringrequired
The organization name. The name is not case sensitive.
team_slugstringrequired
The slug of the team name.
role_idintegerrequired
The unique identifier of the role.

3 status codes
204Response
404Response if the organization, team or role does not exist.
422Response if the organization roles feature is not enabled for the organization, or validation failed.

Error handling

A 404 is returned: Response if the organization, team or role does not exist. A 422 is returned: Response if the organization roles feature is not enabled for the organization, or validation failed.