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
Tokens de acceso específicos para "Get all custom property values for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Custom properties for organizations" organization permissions (read)
Parámetros para "Get all custom property values for an organization"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
org string RequeridoThe organization name. The name is not case sensitive. |
Códigos de estado de respuesta HTTP para "Get all custom property values for an organization"
| status code | Descripción |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Ejemplos de código para "Get all custom property values for an organization"
Ejemplo de solicitud
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
Tokens de acceso específicos para "Create or update custom property values for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Custom properties for organizations" organization permissions (write)
Parámetros para "Create or update custom property values for an organization"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
org string RequeridoThe organization name. The name is not case sensitive. |
| Nombre, Tipo, Descripción | |||
|---|---|---|---|
properties array of objects RequeridoA list of custom property names and associated values to apply to the organization. | |||
Properties of |
| Nombre, Tipo, Descripción |
|---|
property_name string RequeridoThe name of the property |
value null or string or array RequeridoThe value assigned to the property |
Códigos de estado de respuesta HTTP para "Create or update custom property values for an organization"
| status code | Descripción |
|---|---|
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. |
Ejemplos de código para "Create or update custom property values for an organization"
Ejemplo de solicitud
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