REST API endpoints for an organization's custom property values
Use the REST API to manage custom properties for an organization
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:orgscope - Actors with the organization-level "read custom properties for an organization" fine-grained permission or above
Подробные маркеры доступа для "Get all custom property values for an organization
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Custom properties for organizations" organization permissions (read)
Параметры для "Get all custom property values for an organization"
| Имя., Тип, Description |
|---|
accept string Setting to |
| Имя., Тип, Description |
|---|
org string Обязательное полеThe organization name. The name is not case sensitive. |
Коды состояния http-ответа для "Get all custom property values for an organization"
| Код состояния | Описание |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Примеры кода для "Get all custom property values for an organization"
Пример запроса
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/ORG/org-properties/valuesResponse
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:orgscope - Actors with the organization-level "edit custom properties for an organization" fine-grained permission
Подробные маркеры доступа для "Create or update custom property values for an organization
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Custom properties for organizations" organization permissions (write)
Параметры для "Create or update custom property values for an organization"
| Имя., Тип, Description |
|---|
accept string Setting to |
| Имя., Тип, Description |
|---|
org string Обязательное полеThe organization name. The name is not case sensitive. |
| Имя., Тип, Description | |||
|---|---|---|---|
properties array of objects Обязательное полеA list of custom property names and associated values to apply to the organization. | |||
Properties of |
| Имя., Тип, Description |
|---|
property_name string Обязательное полеThe name of the property |
value null or string or array Обязательное полеThe value assigned to the property |
Коды состояния http-ответа для "Create or update custom property values for an organization"
| Код состояния | Описание |
|---|---|
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. |
Примеры кода для "Create or update custom property values for an organization"
Пример запроса
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/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