Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

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:org scope
  • 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"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

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

경로 매개 변수
속성, 형식, 설명
org string Required

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"에 대한 코드 샘플

요청 예제

get/organizations/{org}/org-properties/values
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/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

"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"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

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

경로 매개 변수
속성, 형식, 설명
org string Required

The organization name. The name is not case sensitive.

본문 매개 변수
속성, 형식, 설명
properties array of objects Required

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

속성, 형식, 설명
property_name string Required

The name of the property

value null or string or array Required

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"에 대한 코드 샘플

요청 예제

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: 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