Skip to main content
Wir veröffentlichen regelmäßig Aktualisierungen unserer Dokumentation, und die Übersetzung dieser Seite ist möglicherweise noch nicht abgeschlossen. Aktuelle Informationen findest du in der englischsprachigen Dokumentation.
Nachdem deine Enterprise Server-Instanz durch Websiteadministrator*innen auf Enterprise Server 3.9 oder höher aktualisiert wurde, erhält die REST-API eine Versionskontrolle. Weitere Informationen zum Ermitteln der Version deiner Instanz findest du unter Informationen zu Versionen der GitHub-Dokumentation. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung.

Benutzerdefinierte Repositoryrollen

Verwende die REST-API zum Interagieren mit benutzerdefinierten Repositoryrollen.

List custom repository roles in an organization

Funktioniert mit 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 for the organization or of an repository of the organization and must use an access token with admin:org repo scope. GitHub Apps must have the organization_custom_roles:read organization permission to use this endpoint.

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

Parameter für „List custom repository roles in an organization“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
organization_id string Erforderlich

The unique identifier of the organization.

HTTP-Antwortstatuscodes für „List custom repository roles in an organization“

StatuscodeBESCHREIBUNG
200

Response - list of custom role names

Codebeispiele für „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>" \ http(s)://HOSTNAME/api/v3/organizations/ORGANIZATION_ID/custom_roles

Response - list of custom role names

Status: 200
{ "total_count": 2, "custom_roles": [ { "id": 8030, "name": "Developer" }, { "id": 8031, "name": "Designer" } ] }