Assign an organization role to a user
PUT
/orgs/{org}/organization-roles/users/{username}/{role_id} https://api.github.com
Assigns an organization role to a member of 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.
Parameters
path Path Parameters
| Name | Type |
|---|---|
org
required
The organization name. The name is not case sensitive. | string |
username
required
The handle for the GitHub user account. | string |
role_id
required
The unique identifier of the role. | number |
Responses
204
Response
unknown
Client Errors
404
Response if the organization, user or role does not exist.
unknown
422
Response if the organization roles feature is not enabled enabled for the organization, the validation failed, or the user is not an organization member.
unknown