Skip to main content
REST API теперь версия. Дополнительные сведения см. в разделе "О управлении версиями API".

Пользовательские роли репозитория

Используйте REST API для взаимодействия с пользовательскими ролями репозитория.

Deprecated - List custom repository roles in an organization

Совместим с GitHub Apps

Note: This operation is deprecated and will be removed in the future. Use the "List custom repository roles" endpoint instead.

List the custom repository roles available in this organization. In order to see custom repository roles in an organization, the authenticated user must be an organization owner.

To use this endpoint the authenticated user must be an administrator of the organization or of a repository of the organization and must use an access token with the admin:org or repo scope. GitHub Apps must have the organization_custom_roles:read or organization_administration:read organization permission to use this endpoint.

For more information on custom repository roles, see "About custom repository roles."

Параметры для "Deprecated - List custom repository roles in an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
organization_id string Обязательное поле

The unique identifier of the organization.

Коды состояния http-ответа для "Deprecated - List custom repository roles in an organization"

Код состоянияОписание
200

Response - list of custom role names

Примеры кода для "Deprecated - List custom repository roles in an organization"

get/organizations/{organization_id}/custom_roles
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/organizations/ORGANIZATION_ID/custom_roles

Response - list of custom role names

Status: 200
{ "id": 8030, "name": "Security Engineer", "description": "Able to contribute code and maintain the security pipeline", "base_role": "maintain", "permissions": [ "delete_alerts_code_scanning" ], "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization" }, "created_at": "2022-07-04T22:19:11Z", "updated_at": "2022-07-04T22:20:11Z" }

List custom repository roles in an organization

Совместим с GitHub Apps

List the custom repository roles available in this organization. In order to see custom repository roles in an organization, the authenticated user must be an organization owner.

To use this endpoint the authenticated user must be an administrator of the organization or of a repository of the organization and must use an access token with the admin:org or repo scope. GitHub Apps must have the organization_custom_roles:read or organization_administration:read organization permission to use this endpoint.

For more information on custom repository roles, see "About custom repository roles."

Параметры для "List custom repository roles in an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "List custom repository roles in an organization"

Код состоянияОписание
200

Response - list of custom role names

Примеры кода для "List custom repository roles in an organization"

get/orgs/{org}/custom-repository-roles
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/custom-repository-roles

Response - list of custom role names

Status: 200
{ "total_count": 2, "custom_roles": [ { "id": 8030, "name": "Security Engineer", "description": "Able to contribute code and maintain the security pipeline", "base_role": "maintain", "permissions": [ "delete_alerts_code_scanning" ], "organization": { "login": "github", "id": 9919, "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", "avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4", "gravatar_id": "", "url": "https://api.github.com/users/github", "html_url": "https://github.com/github", "followers_url": "https://api.github.com/users/github/followers", "following_url": "https://api.github.com/users/github/following{/other_user}", "gists_url": "https://api.github.com/users/github/gists{/gist_id}", "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/github/subscriptions", "organizations_url": "https://api.github.com/users/github/orgs", "repos_url": "https://api.github.com/users/github/repos", "events_url": "https://api.github.com/users/github/events{/privacy}", "received_events_url": "https://api.github.com/users/github/received_events", "type": "Organization", "site_admin": false }, "created_at": "2022-07-04T22:19:11Z", "updated_at": "2022-07-04T22:20:11Z" }, { "id": 8031, "name": "Community manager", "description": "Able to handle all the community interactions without being able to contribute code", "base_role": "read", "permissions": [ "mark_as_duplicate", "manage_settings_pages", "manage_settings_wiki", "set_social_preview", "edit_repo_metadata", "toggle_discussion_comment_minimize" ], "organization": { "login": "github", "id": 9919, "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", "avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4", "gravatar_id": "", "url": "https://api.github.com/users/github", "html_url": "https://github.com/github", "followers_url": "https://api.github.com/users/github/followers", "following_url": "https://api.github.com/users/github/following{/other_user}", "gists_url": "https://api.github.com/users/github/gists{/gist_id}", "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/github/subscriptions", "organizations_url": "https://api.github.com/users/github/orgs", "repos_url": "https://api.github.com/users/github/repos", "events_url": "https://api.github.com/users/github/events{/privacy}", "received_events_url": "https://api.github.com/users/github/received_events", "type": "Organization", "site_admin": false }, "created_at": "2022-07-05T12:01:11Z", "updated_at": "2022-07-05T12:20:11Z" } ] }

Create a custom repository role

Совместим с GitHub Apps

Creates a custom repository role that can be used by all repositories owned by the organization.

To use this endpoint, the authenticated user must be an administrator for the organization and must use a personal access token (classic) with admin:org scope or a fine-grained personal access token with the organization_custom_roles:write organization permission.

For more information on custom repository roles, see "About custom repository roles."

Параметры для "Create a custom repository role"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Параметры запроса
Имя., Тип, Description
name string Обязательное поле

The name of the custom role.

description string or null

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

base_role string Обязательное поле

The system role from which this role inherits permissions.

Возможные значения: read, triage, write, maintain

permissions array of strings Обязательное поле

A list of additional permissions included in this role.

Коды состояния http-ответа для "Create a custom repository role"

Код состоянияОписание
201

Created

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Примеры кода для "Create a custom repository role"

post/orgs/{org}/custom-repository-roles
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/custom-repository-roles \ -d '{"name":"Labeler","description":"A role for issue and pull request labelers","base_role":"read","permissions":["add_label"]}'

Response

Status: 201
{ "id": 8030, "name": "Security Engineer", "description": "Able to contribute code and maintain the security pipeline", "base_role": "maintain", "permissions": [ "delete_alerts_code_scanning" ], "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization" }, "created_at": "2022-07-04T22:19:11Z", "updated_at": "2022-07-04T22:20:11Z" }

Get a custom repository role

Совместим с GitHub Apps

Gets a custom repository role that is available to all repositories owned by the organization.

To use this endpoint the authenticated user must be an administrator of the organization or of a repository of the organization and must use an access token with the admin:org or repo scope. GitHub Apps must have the organization_custom_roles:read or organization_administration:read organization permission to use this endpoint.

For more information on custom repository roles, see "About custom repository roles."

Параметры для "Get a custom repository role"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

role_id integer Обязательное поле

The unique identifier of the role.

Коды состояния http-ответа для "Get a custom repository role"

Код состоянияОписание
200

OK

404

Resource not found

Примеры кода для "Get a custom repository role"

get/orgs/{org}/custom-repository-roles/{role_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/custom-repository-roles/ROLE_ID

Response

Status: 200
{ "id": 8030, "name": "Security Engineer", "description": "Able to contribute code and maintain the security pipeline", "base_role": "maintain", "permissions": [ "delete_alerts_code_scanning" ], "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization" }, "created_at": "2022-07-04T22:19:11Z", "updated_at": "2022-07-04T22:20:11Z" }

Update a custom repository role

Совместим с GitHub Apps

Updates a custom repository role that can be used by all repositories owned by the organization.

To use this endpoint the authenticated user must be an administrator for the organization and must use an access token with admin:org scope. GitHub Apps must have the organization_custom_roles:write organization permission to use this endpoint.

For more information about custom repository roles, see "About custom repository roles."

Параметры для "Update a custom repository role"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

role_id integer Обязательное поле

The unique identifier of the role.

Параметры запроса
Имя., Тип, Description
name string

The name of the custom role.

description string or null

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

base_role string

The system role from which this role inherits permissions.

Возможные значения: read, triage, write, maintain

permissions array of strings

A list of additional permissions included in this role.

Коды состояния http-ответа для "Update a custom repository role"

Код состоянияОписание
200

OK

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Примеры кода для "Update a custom repository role"

patch/orgs/{org}/custom-repository-roles/{role_id}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/custom-repository-roles/ROLE_ID \ -d '{"name":"Labeler","description":"A role for issue and PR labelers","base_role":"read","permissions":["add_label","remove_label"]}'

Response

Status: 200
{ "id": 8030, "name": "Security Engineer", "description": "Able to contribute code and maintain the security pipeline", "base_role": "maintain", "permissions": [ "delete_alerts_code_scanning" ], "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization" }, "created_at": "2022-07-04T22:19:11Z", "updated_at": "2022-07-04T22:20:11Z" }

Delete a custom repository role

Совместим с GitHub Apps

Deletes a custom role from an organization. Once the custom role has been deleted, any user, team, or invitation with the deleted custom role will be reassigned the inherited role.

To use this endpoint the authenticated user must be an administrator for the organization and must use an access token with admin:org scope. GitHub Apps must have the organization_custom_roles:write organization permission to use this endpoint.

For more information about custom repository roles, see "About custom repository roles."

Параметры для "Delete a custom repository role"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

role_id integer Обязательное поле

The unique identifier of the role.

Коды состояния http-ответа для "Delete a custom repository role"

Код состоянияОписание
204

No Content

Примеры кода для "Delete a custom repository role"

delete/orgs/{org}/custom-repository-roles/{role_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/custom-repository-roles/ROLE_ID

Response

Status: 204

Deprecated - Create a custom role

Совместим с GitHub Apps

Note: This operation is deprecated and will be removed after September 6th 2023. Use the "Create a custom repository role" endpoint instead.

Creates a custom repository role that can be used by all repositories owned by the organization.

To use this endpoint, the authenticated user must be an administrator for the organization and must use a personal access token (classic) with admin:org scope or a fine-grained personal access token with the organization_custom_roles:write organization permission.

For more information on custom repository roles, see "About custom repository roles."

Параметры для "Deprecated - Create a custom role"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Параметры запроса
Имя., Тип, Description
name string Обязательное поле

The name of the custom role.

description string or null

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

base_role string Обязательное поле

The system role from which this role inherits permissions.

Возможные значения: read, triage, write, maintain

permissions array of strings Обязательное поле

A list of additional permissions included in this role.

Коды состояния http-ответа для "Deprecated - Create a custom role"

Код состоянияОписание
201

Created

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Примеры кода для "Deprecated - Create a custom role"

post/orgs/{org}/custom_roles
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/custom_roles \ -d '{"name":"Labeler","description":"A role for issue and pull request labelers","base_role":"read","permissions":["add_label"]}'

Response

Status: 201
{ "id": 8030, "name": "Security Engineer", "description": "Able to contribute code and maintain the security pipeline", "base_role": "maintain", "permissions": [ "delete_alerts_code_scanning" ], "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization" }, "created_at": "2022-07-04T22:19:11Z", "updated_at": "2022-07-04T22:20:11Z" }

Deprecated - Get a custom role

Совместим с GitHub Apps

Note: This operation is deprecated and will be removed after September 6th 2023. Use the "Get a custom repository role" endpoint instead.

Gets a custom repository role that is available to all repositories owned by the organization.

To use this endpoint the authenticated user must be an administrator of the organization or of a repository of the organization and must use an access token with the admin:org or repo scope. GitHub Apps must have the organization_custom_roles:read or organization_administration:read organization permission to use this endpoint.

For more information on custom repository roles, see "About custom repository roles."

Параметры для "Deprecated - Get a custom role"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

role_id integer Обязательное поле

The unique identifier of the role.

Коды состояния http-ответа для "Deprecated - Get a custom role"

Код состоянияОписание
200

OK

404

Resource not found

Примеры кода для "Deprecated - Get a custom role"

get/orgs/{org}/custom_roles/{role_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/custom_roles/ROLE_ID

Response

Status: 200
{ "id": 8030, "name": "Security Engineer", "description": "Able to contribute code and maintain the security pipeline", "base_role": "maintain", "permissions": [ "delete_alerts_code_scanning" ], "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization" }, "created_at": "2022-07-04T22:19:11Z", "updated_at": "2022-07-04T22:20:11Z" }

Deprecated - Update a custom role

Совместим с GitHub Apps

Note: This operation is deprecated and will be removed after September 6th 2023. Use the "Update a custom repository role" endpoint instead.

Updates a custom repository role that can be used by all repositories owned by the organization.

To use this endpoint the authenticated user must be an administrator for the organization and must use an access token with admin:org scope. GitHub Apps must have the organization_custom_roles:write organization permission to use this endpoint.

For more information about custom repository roles, see "About custom repository roles."

Параметры для "Deprecated - Update a custom role"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

role_id integer Обязательное поле

The unique identifier of the role.

Параметры запроса
Имя., Тип, Description
name string

The name of the custom role.

description string or null

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

base_role string

The system role from which this role inherits permissions.

Возможные значения: read, triage, write, maintain

permissions array of strings

A list of additional permissions included in this role.

Коды состояния http-ответа для "Deprecated - Update a custom role"

Код состоянияОписание
200

OK

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Примеры кода для "Deprecated - Update a custom role"

patch/orgs/{org}/custom_roles/{role_id}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/custom_roles/ROLE_ID \ -d '{"name":"Labeler","description":"A role for issue and PR labelers","base_role":"read","permissions":["add_label","remove_label"]}'

Response

Status: 200
{ "id": 8030, "name": "Security Engineer", "description": "Able to contribute code and maintain the security pipeline", "base_role": "maintain", "permissions": [ "delete_alerts_code_scanning" ], "organization": { "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "repos_url": "https://api.github.com/orgs/github/repos", "events_url": "https://api.github.com/orgs/github/events", "hooks_url": "https://api.github.com/orgs/github/hooks", "issues_url": "https://api.github.com/orgs/github/issues", "members_url": "https://api.github.com/orgs/github/members{/member}", "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization" }, "created_at": "2022-07-04T22:19:11Z", "updated_at": "2022-07-04T22:20:11Z" }

Deprecated - Delete a custom role

Совместим с GitHub Apps

Note: This operation is deprecated and will be removed after September 6th 2023. Use the "Delete a custom repository role" endpoint instead.

Deletes a custom role from an organization. Once the custom role has been deleted, any user, team, or invitation with the deleted custom role will be reassigned the inherited role.

To use this endpoint the authenticated user must be an administrator for the organization and must use an access token with admin:org scope. GitHub Apps must have the organization_custom_roles:write organization permission to use this endpoint.

For more information about custom repository roles, see "About custom repository roles."

Параметры для "Deprecated - Delete a custom role"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

role_id integer Обязательное поле

The unique identifier of the role.

Коды состояния http-ответа для "Deprecated - Delete a custom role"

Код состоянияОписание
204

No Content

Примеры кода для "Deprecated - Delete a custom role"

delete/orgs/{org}/custom_roles/{role_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/custom_roles/ROLE_ID

Response

Status: 204

Deprecated - List fine-grained permissions for an organization

Совместим с GitHub Apps

Note: This operation is deprecated and will be removed after September 6th 2023. Use the "List fine-grained repository permissions" endpoint instead.

Lists the fine-grained permissions that can be used in custom repository roles for an organization. For more information, see "About custom repository roles."

To use this endpoint the authenticated user must be an administrator of the organization or of a repository of the organization and must use an access token with the admin:org or repo scope. GitHub Apps must have the organization_custom_roles:read or organization_administration:read organization permission to use this endpoint.

Параметры для "Deprecated - List fine-grained permissions for an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "Deprecated - List fine-grained permissions for an organization"

Код состоянияОписание
200

OK

Примеры кода для "Deprecated - List fine-grained permissions for an organization"

get/orgs/{org}/fine_grained_permissions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/fine_grained_permissions

Response

Status: 200
[ { "name": "add_assignee", "description": "Assign or remove a user" }, { "name": "remove_assignee", "description": "Remove an assigned user" }, { "name": "add_label", "description": "Add or remove a label" } ]

List repository fine-grained permissions for an organization

Совместим с GitHub Apps

Lists the fine-grained permissions that can be used in custom repository roles for an organization. For more information, see "About custom repository roles."

To use this endpoint the authenticated user must be an administrator of the organization or of a repository of the organization and must use an access token with the admin:org or repo scope. GitHub Apps must have the organization_custom_roles:read or organization_administration:read organization permission to use this endpoint.

Параметры для "List repository fine-grained permissions for an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "List repository fine-grained permissions for an organization"

Код состоянияОписание
200

OK

Примеры кода для "List repository fine-grained permissions for an organization"

get/orgs/{org}/repository-fine-grained-permissions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/repository-fine-grained-permissions

Response

Status: 200
[ { "name": "add_assignee", "description": "Assign or remove a user" }, { "name": "remove_assignee", "description": "Remove an assigned user" }, { "name": "add_label", "description": "Add or remove a label" } ]