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" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Custom properties for organizations" organization permissions (read)
"Get all custom property values for an organization" のパラメーター
| 名前, Type, 説明 |
|---|
accept string Setting to |
| 名前, Type, 説明 |
|---|
org string 必須The organization name. The name is not case sensitive. |
"Get all custom property values for an organization" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
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" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Custom properties for organizations" organization permissions (write)
"Create or update custom property values for an organization" のパラメーター
| 名前, Type, 説明 |
|---|
accept string Setting to |
| 名前, Type, 説明 |
|---|
org string 必須The organization name. The name is not case sensitive. |
| 名前, Type, 説明 | |||
|---|---|---|---|
properties array of objects 必須A list of custom property names and associated values to apply to the organization. | |||
Properties of |
| 名前, Type, 説明 |
|---|
property_name string 必須The name of the property |
value null or string or array 必須The value assigned to the property |
"Create or update custom property values for an organization" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
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