role_team_assignments
Creates, updates, deletes, gets or lists a role_team_assignments resource.
Overview
| Name | role_team_assignments |
| Type | Resource |
| Id | github.orgs.role_team_assignments |
Fields
The following fields are returned by SELECT queries:
- list_org_role_teams
Response - List of assigned teams
| Name | Datatype | Description |
|---|---|---|
id | integer | |
name | string | |
enterprise_id | integer | Unique identifier of the enterprise to which this team belongs |
node_id | string | |
organization_id | integer | Unique identifier of the organization to which this team belongs |
assignment | string | Determines if the team has a direct, indirect, or mixed relationship to a role (direct, indirect, mixed) (example: direct) |
description | string | |
html_url | string (uri) | (example: https://github.com/orgs/rails/teams/core) |
members_url | string | |
notification_setting | string | |
parent | object | Groups of organization members that gives permissions on specified repositories. (title: Team Simple) |
permission | string | |
permissions | object | |
privacy | string | |
repositories_url | string (uri) | |
slug | string | |
type | string | The ownership type of the team (enterprise, organization) |
url | string (uri) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_org_role_teams | select | org, role_id | per_page, page | 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. |
assign_team_to_org_role | replace | org, 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. | |
revoke_org_role_team | delete | org, 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. | |
revoke_all_org_roles_team | delete | org, 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. |
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.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
role_id | integer | The unique identifier of the role. |
team_slug | string | The slug of the team name. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_org_role_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.
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
- assign_team_to_org_role
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
- revoke_org_role_team
- revoke_all_org_roles_team
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
;
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.
DELETE FROM github.orgs.role_team_assignments
WHERE org = '{{ org }}' --required
AND team_slug = '{{ team_slug }}' --required
;