Skip to main content

Enterprise Server 3.21 ist derzeit als Release Candidate verfügbar.

Die REST-API ist jetzt versioniert. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung.

REST-API-Endpunkte für die benutzerdefinierten Eigenschaftswerte einer Organisation

Verwenden der REST-API zum Verwalten von benutzerdefinierten Eigenschaftswerten für eine Organisation

Get all custom property values for an organization

Gets all custom property values that are set for an organization.

The organization must belong to an enterprise.

Access requirements:

  • Organization admins
  • OAuth tokens and personal access tokens (classic) with the read:org scope
  • Actors with the organization-level "read custom properties for an organization" fine-grained permission or above

Fine-grained access tokens for "Get all custom property values for an organization"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Custom properties for organizations" organization permissions (read)

Parameter für "Get all custom property values for an organization"

Header
Name, Typ, BESCHREIBUNG
accept string

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

Pfadparameter
Name, Typ, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

HTTP response status codes for "Get all custom property values for an organization"

Status codeBESCHREIBUNG
200

OK

403

Forbidden

404

Resource not found

Code samples for "Get all custom property values for an organization"

Request example

get/organizations/{org}/org-properties/values
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/organizations/ORG/org-properties/values

Response

Status: 200
[ { "property_name": "environment", "value": "production" }, { "property_name": "service", "value": "web" }, { "property_name": "team", "value": "octocat" } ]

Create or update custom property values for an organization

Create new or update existing custom property values for an organization. To remove a custom property value from an organization, set the property value to null.

The organization must belong to an enterprise.

Access requirements:

  • Organization admins
  • OAuth tokens and personal access tokens (classic) with the admin:org scope
  • Actors with the organization-level "edit custom properties for an organization" fine-grained permission

Fine-grained access tokens for "Create or update custom property values for an organization"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Custom properties for organizations" organization permissions (write)

Parameter für "Create or update custom property values for an organization"

Header
Name, Typ, BESCHREIBUNG
accept string

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

Pfadparameter
Name, Typ, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

Körperparameter
Name, Typ, BESCHREIBUNG
properties array of objects Erforderlich

A list of custom property names and associated values to apply to the organization.

Name, Typ, BESCHREIBUNG
property_name string Erforderlich

The name of the property

value null or string or array Erforderlich

The value assigned to the property

HTTP response status codes for "Create or update custom property values for an organization"

Status codeBESCHREIBUNG
204

No Content when custom property values are successfully created or updated

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Code samples for "Create or update custom property values for an organization"

Request example

patch/organizations/{org}/org-properties/values
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/organizations/ORG/org-properties/values \ -d '{"properties":[{"property_name":"environment","value":"production"},{"property_name":"service","value":"web"},{"property_name":"team","value":"octocat"}]}'

No Content when custom property values are successfully created or updated

Status: 204