Use the REST API to interact with organization roles.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /orgs/{org}/organization-roles
Lists the organization roles available in this organization. For more information on organization roles, see "Using organization roles."
To use this endpoint, the authenticated user must be one of:
An administrator for the organization.
An organization member (or a member of a team) assigned a custom organization role that includes the View organization roles (read_organization_custom_org_role) permission. For more information, see "Permissions for organization access."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)200 - Response - list of organization roles
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/organization-roles
Response schema (Status: 200):
total_count: integerroles: array of Organization Role:
id: required, integer, format: int64name: required, stringdescription: string or nullbase_role: string or null, enum: read, triage, write, maintain, admin, nullsource: string or null, enum: Organization, Enterprise, Predefined, nullpermissions: required, array of stringorganization: required, any of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timeDELETE /orgs/{org}/organization-roles/teams/{team_slug}
Removes all assigned organization roles from a team. 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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/organization-roles/teams/TEAM_SLUG
Response schema (Status: 204):
PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
role_id (integer) (required)
The unique identifier of the role.
204 - No Content
404 - Response if the organization, team or role does not exist.
422 - Response if the organization roles feature is not enabled for the organization, or validation failed.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/organization-roles/teams/TEAM_SLUG/ROLE_ID
Response schema (Status: 204):
DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}
Removes an organization role from a team. 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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
role_id (integer) (required)
The unique identifier of the role.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/organization-roles/teams/TEAM_SLUG/ROLE_ID
Response schema (Status: 204):
DELETE /orgs/{org}/organization-roles/users/{username}
Revokes all assigned organization roles from a user. 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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
username (string) (required)
The handle for the GitHub user account.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/organization-roles/users/USERNAME
Response schema (Status: 204):
PUT /orgs/{org}/organization-roles/users/{username}/{role_id}
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
username (string) (required)
The handle for the GitHub user account.
role_id (integer) (required)
The unique identifier of the role.
204 - No Content
404 - Response if the organization, user or role does not exist.
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.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/organization-roles/users/USERNAME/ROLE_ID
Response schema (Status: 204):
DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}
Remove an organization role from a user. 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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
username (string) (required)
The handle for the GitHub user account.
role_id (integer) (required)
The unique identifier of the role.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/organization-roles/users/USERNAME/ROLE_ID
Response schema (Status: 204):
GET /orgs/{org}/organization-roles/{role_id}
Gets an organization role that is available to this organization. For more information on organization roles, see "Using organization roles."
To use this endpoint, the authenticated user must be one of:
An administrator for the organization.
An organization member (or a member of a team) assigned a custom organization role that includes the View organization roles (read_organization_custom_org_role) permission. For more information, see "Permissions for organization access."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
role_id (integer) (required)
The unique identifier of the role.
200 - OK
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/organization-roles/ROLE_ID
Response schema (Status: 200):
id: required, integer, format: int64name: required, stringdescription: string or nullbase_role: string or null, enum: read, triage, write, maintain, admin, nullsource: string or null, enum: Organization, Enterprise, Predefined, nullpermissions: required, array of stringorganization: required, any of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timeGET /orgs/{org}/organization-roles/{role_id}/teams
Lists the teams that are assigned to an organization role. For more information on organization roles, see "Using organization roles."
To use this endpoint, you must be an administrator for the organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
role_id (integer) (required)
The unique identifier of the role.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - Response - List of assigned teams
404 - Response if the organization or role does not exist.
422 - Response if the organization roles feature is not enabled or validation failed.
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/organization-roles/ROLE_ID/teams
Response schema (Status: 200):
Array of A Role Assignment for a Team:
assignment: string, enum: direct, indirect, mixedid: required, integernode_id: required, stringname: required, stringslug: required, stringdescription: required, string or nullprivacy: stringnotification_setting: stringpermission: required, stringpermissions: object:
pull: required, booleantriage: required, booleanpush: required, booleanmaintain: required, booleanadmin: required, booleanurl: required, string, format: urihtml_url: required, string, format: urimembers_url: required, stringrepositories_url: required, string, format: uriparent: required, any of:
id: required, integernode_id: required, stringurl: required, string, format: urimembers_url: required, stringname: required, stringdescription: required, string or nullpermission: required, stringprivacy: stringnotification_setting: stringhtml_url: required, string, format: urirepositories_url: required, string, format: urislug: required, stringldap_dn: stringtype: required, string, enum: enterprise, organizationorganization_id: integerenterprise_id: integertype: required, string, enum: enterprise, organizationorganization_id: integerenterprise_id: integerGET /orgs/{org}/organization-roles/{role_id}/users
Lists organization members that are assigned to an organization role. For more information on organization roles, see "Using organization roles."
To use this endpoint, you must be an administrator for the organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
role_id (integer) (required)
The unique identifier of the role.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - Response - List of assigned users
404 - Response if the organization or role does not exist.
422 - Response if the organization roles feature is not enabled or validation failed.
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/organization-roles/ROLE_ID/users
Response schema (Status: 200):
Array of A Role Assignment for a User:
assignment: string, enum: direct, indirect, mixedinherited_from: array of Team Simple:
id: required, integernode_id: required, stringurl: required, string, format: urimembers_url: required, stringname: required, stringdescription: required, string or nullpermission: required, stringprivacy: stringnotification_setting: stringhtml_url: required, string, format: urirepositories_url: required, string, format: urislug: required, stringldap_dn: stringtype: required, string, enum: enterprise, organizationorganization_id: integerenterprise_id: integername: string or nullemail: string or nulllogin: required, stringid: required, integernode_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: string