v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
orgs

Create a custom organization role

Creates a custom organization role that can be assigned to users and teams, granting them specific permissions over the organization and optionally across all repositories in the organization. For more information on custom organization roles, see "Managing people's access to your organization with roles."

To include repository permissions in an organization role, you must also include the base_role field, which is one of read, write, triage, maintain, or admin (or none if no base role is set). This base role provides a set of fine-grained permissions as well as implicit permissions - those that aren't exposed as fine-grained permissions and can only be granted through the base role (like "reading a repo"). If you include repository permissions, those permissions apply across all of the repositories in the organization. You do not have to include organization permissions in order to add repository permissions.

See "List repository permissions" for valid repository permissions.

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 Manage custom organization roles (write_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.

post/orgs/{org}/organization-roles

Path parameters

orgstring required

The organization name. The name is not case sensitive.

Request body

namestring required

The name of the custom role.

descriptionstring

A short description about the intended usage of this role or what permissions it grants.

permissionsstring[] required

A list of additional permissions included in this role.

base_role'read' | 'triage' | 'write' | 'maintain' | 'admin'

The system role from which this role can inherit permissions.

Response

Response

idinteger required

The unique identifier of the role.

namestring required

The name of the role.

descriptionstring nullable

A short description about who this role is for or what permissions it grants.

base_role'read' | 'triage' | 'write' | 'maintain' | 'admin' nullable

The system role from which this role inherits permissions.

source'Organization' | 'Enterprise' | 'Predefined' nullable

Source answers the question, "where did this role come from?"

permissionsstring[] required

A list of permissions included in this role.

created_atstring date-time required

The date and time the role was created.

updated_atstring date-time required

The date and time the role was last updated.

Example response

{
  "organization": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "starred_at": "\"2020-07-09T00:17:55Z\"",
    "user_view_type": "public"
  }
}