Skip to main content

role_team_assignments

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

Overview

Namerole_team_assignments
TypeResource
Idgithub.orgs.role_team_assignments

Fields

The following fields are returned by SELECT queries:

Response - List of assigned teams

NameDatatypeDescription
idinteger
namestring
enterprise_idintegerUnique identifier of the enterprise to which this team belongs
node_idstring
organization_idintegerUnique identifier of the organization to which this team belongs
assignmentstringDetermines if the team has a direct, indirect, or mixed relationship to a role (direct, indirect, mixed) (example: direct)
descriptionstring
html_urlstring (uri) (example: https://github.com/orgs/rails/teams/core)
members_urlstring
notification_settingstring
parentobjectGroups of organization members that gives permissions on specified repositories. (title: Team Simple)
permissionstring
permissionsobject
privacystring
repositories_urlstring (uri)
slugstring
typestringThe ownership type of the team (enterprise, organization)
urlstring (uri)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_org_role_teamsselectorg, role_idper_page, pageLists 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.
assign_team_to_org_rolereplaceorg, team_slug, role_idAssigns 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.
revoke_org_role_teamdeleteorg, team_slug, role_idRemoves 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.
revoke_all_org_roles_teamdeleteorg, team_slugRemoves 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.

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.
team_slugstringThe slug of the team name.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

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.

SELECT
id,
name,
enterprise_id,
node_id,
organization_id,
assignment,
description,
html_url,
members_url,
notification_setting,
parent,
permission,
permissions,
privacy,
repositories_url,
slug,
type,
url
FROM github.orgs.role_team_assignments
WHERE org = '{{ org }}' -- required
AND role_id = '{{ role_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;

REPLACE examples

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.

REPLACE github.orgs.role_team_assignments
SET
-- No updatable properties
WHERE
org = '{{ org }}' --required
AND team_slug = '{{ team_slug }}' --required
AND role_id = '{{ role_id }}' --required;

DELETE examples

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.

DELETE FROM github.orgs.role_team_assignments
WHERE org = '{{ org }}' --required
AND team_slug = '{{ team_slug }}' --required
AND role_id = '{{ role_id }}' --required
;