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 acesso refinados para "Get all custom property values for an organization"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinado deve ter os seguintes conjuntos de permissões:
- "Custom properties for organizations" organization permissions (read)
Parâmetros para "Get all custom property values for an organization"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| orgstring ObrigatórioThe organization name. The name is not case sensitive. | 
Códigos de status de resposta HTTP para "Get all custom property values for an organization"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
| 403 | Forbidden | 
| 404 | Resource not found | 
Exemplos de código para "Get all custom property values for an organization"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
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 acesso refinados para "Create or update custom property values for an organization"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinado deve ter os seguintes conjuntos de permissões:
- "Custom properties for organizations" organization permissions (write)
Parâmetros para "Create or update custom property values for an organization"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| orgstring ObrigatórioThe organization name. The name is not case sensitive. | 
| Nome, Tipo, Descrição | |||
|---|---|---|---|
| propertiesarray of objects ObrigatórioA list of custom property names and associated values to apply to the organization. | |||
| Properties of  | 
| Nome, Tipo, Descrição | 
|---|
| property_namestring ObrigatórioThe name of the property | 
| valuenull or string or array ObrigatórioThe value assigned to the property | 
Códigos de status de resposta HTTP para "Create or update custom property values for an organization"
| Código de status | Descrição | 
|---|---|
| 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. | 
Exemplos de código para "Create or update custom property values for an organization"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
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