Skip to main content

roles

Creates, updates, deletes, gets or lists a roles resource.

Overview

Nameroles
TypeResource
Idgithub.orgs.roles

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)The unique identifier of the role.
namestringThe name of the role.
base_rolestringThe system role from which this role inherits permissions. (read, triage, write, maintain, admin)
created_atstring (date-time)The date and time the role was created.
descriptionstringA short description about who this role is for or what permissions it grants.
organizationobjectA GitHub user. (title: Simple User)
permissionsarrayA list of permissions included in this role.
sourcestringSource answers the question, "where did this role come from?" (Organization, Enterprise, Predefined)
updated_atstring (date-time)The date and time the role was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_org_roleselectorg, role_idGets 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.
list_org_rolesselectorgLists 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
orgstringThe organization name. The name is not case sensitive.
role_idintegerThe unique identifier of the role.

SELECT examples

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.

SELECT
id,
name,
base_role,
created_at,
description,
organization,
permissions,
source,
updated_at
FROM github.orgs.roles
WHERE org = '{{ org }}' -- required
AND role_id = '{{ role_id }}' -- required
;