カスタム プロパティの REST API エンドポイント
REST API を使用して、組織のカスタム プロパティを作成および管理します。
カスタム プロパティについて
REST API を使用して、組織のカスタムプロパティを作成および管理することができます。 カスタム プロパティを使用すると、組織内のリポジトリにメタデータを追加できます。 詳しくは、「Organization 内リポジトリのカスタム プロパティの管理」をご覧ください。
Get all custom properties for an organization
Gets all custom properties defined for an organization. Organization members can read these properties.
"Get all custom properties for an organization" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Custom properties" organization permissions (read)
"Get all custom properties for an organization" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
org string 必須The organization name. The name is not case sensitive. |
"Get all custom properties for an organization" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
"Get all custom properties for an organization" のコード サンプル
要求の例
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/orgs/ORG/properties/schemaResponse
Status: 200[
{
"property_name": "environment",
"url": "https://api.github.com/orgs/github/properties/schema/environment",
"source_type": "organization",
"value_type": "single_select",
"required": true,
"default_value": "production",
"description": "Prod or dev environment",
"allowed_values": [
"production",
"development"
],
"values_editable_by": "org_actors",
"require_explicit_values": true
},
{
"property_name": "service",
"url": "https://api.github.com/orgs/github/properties/schema/service",
"source_type": "organization",
"value_type": "string"
},
{
"property_name": "team",
"url": "https://api.github.com/orgs/github/properties/schema/team",
"source_type": "organization",
"value_type": "string",
"description": "Team owning the repository"
}
]Create or update custom properties for an organization
Creates new or updates existing custom properties defined for an organization in a batch.
If the property already exists, the existing property will be replaced with the new values.
Missing optional values will fall back to default values, previous values will be overwritten.
E.g. if a property exists with values_editable_by: org_and_repo_actors and it's updated without specifying values_editable_by, it will be updated to default value org_actors.
To use this endpoint, the authenticated user must be one of:
- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permission of
custom_properties_org_definitions_managerin the organization.
"Create or update custom properties for an organization" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Custom properties" organization permissions (admin)
"Create or update custom properties for an organization" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
org string 必須The organization name. The name is not case sensitive. |
| 名前, タイプ, 説明 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
properties array of objects 必須The array of custom properties to create or update. | |||||||||||
Properties of |
| 名前, タイプ, 説明 |
|---|
property_name string 必須The name of the property |
url string The URL that can be used to fetch, update, or delete info about this property via the API. |
source_type string The source type of the property 次のいずれかにできます: |
value_type string 必須The type of the value for the property 次のいずれかにできます: |
required boolean Whether the property is required. |
default_value null or string or array Default value of the property |
description string or null Short description of the property |
allowed_values array of strings or null An ordered list of the allowed values of the property. The property can have up to 200 allowed values. |
values_editable_by string or null Who can edit the values of the property 次のいずれかにできます: |
require_explicit_values boolean Whether setting properties values is mandatory |
"Create or update custom properties for an organization" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
403 | Forbidden |