{"meta":{"title":"企業内の組織のカスタム プロパティの REST API","intro":"REST API を使用して、企業に属する組織のカスタム プロパティを管理する","product":"REST API","breadcrumbs":[{"href":"/ja/enterprise-cloud@latest/rest","title":"REST API"},{"href":"/ja/enterprise-cloud@latest/rest/enterprise-admin","title":"企業管理"},{"href":"/ja/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs","title":"Organization のカスタム プロパティ"}],"documentType":"article"},"body":"# 企業内の組織のカスタム プロパティの REST API\n\nREST API を使用して、企業に属する組織のカスタム プロパティを管理する\n\n> [!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## Get organization custom properties schema for an enterprise\n\n```\nGET /enterprises/{enterprise}/org-properties/schema\n```\n\nGets all organization custom property definitions that are defined on an enterprise.\nAccess requirements:\n\nEnterprise admins\nOAuth tokens and personal access tokens (classic) with the read:enterprise scope\nActors with the enterprise-level \"read enterprise custom properties for organizations\" fine-grained permission or above\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/org-properties/schema\n```\n\n**Response schema (Status: 200):**\n\nArray of `Custom Property for Organization` objects: all of:\n  * **object**\n    * `property_name`: string\n    * `url`: string, format: uri\n    * `source_type`: string, enum: `organization`, `enterprise`\n    * `value_type`: string, enum: `string`, `single_select`, `multi_select`, `true_false`, `url`\n    * `required`: boolean\n    * `default_value`: one of:\n      * **string**\n      * **array**\n    * `description`: string or null\n    * `allowed_values`: array of string or null\n  * **object**\n    * `values_editable_by`: string or null, enum: `enterprise_actors`, `enterprise_and_org_actors`, `null`\n\n## Create or update organization custom property definitions on an enterprise\n\n```\nPATCH /enterprises/{enterprise}/org-properties/schema\n```\n\nCreates new or updates existing organization custom properties defined on an enterprise in a batch.\nIf the property already exists, the existing property will be replaced with the new values.\nMissing optional values will fall back to default values, previous values will be overwritten.\nAccess requirements:\n\nEnterprise admins\nOAuth tokens and personal access tokens (classic) with the admin:enterprise scope\nActors with the enterprise-level \"manage enterprise custom properties for organizations\" fine-grained permission\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n#### Body parameters\n\n- **`properties`** (array of objects) (required)\n  The array of organization custom properties to create or update.\n  - **`property_name`** (string) (required)\n    The name of the property\n  - **`url`** (string)\n    The URL that can be used to fetch, update, or delete info about this property via the API.\n  - **`source_type`** (string)\n    The source type of the property\n    Can be one of: `organization`, `enterprise`\n  - **`value_type`** (string) (required)\n    The type of the value for the property\n    Can be one of: `string`, `single_select`, `multi_select`, `true_false`, `url`\n  - **`required`** (boolean)\n    Whether the property is required.\n  - **`default_value`** (null or string or array)\n    Default value of the property\n  - **`description`** (string or null)\n    Short description of the property\n  - **`allowed_values`** (array of strings or null)\n    An ordered list of the allowed values of the property.\nThe property can have up to 200 allowed values.\n  - **`values_editable_by`** (string or null)\n    Who can edit the values of the property\n    Can be one of: `enterprise_actors`, `enterprise_and_org_actors`, `null`\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/enterprises/ENTERPRISE/org-properties/schema \\\n  -d '{\n  \"properties\": [\n    {\n      \"property_name\": \"environment\",\n      \"source_type\": \"enterprise\",\n      \"value_type\": \"single_select\",\n      \"required\": true,\n      \"default_value\": \"production\",\n      \"description\": \"Prod or dev environment\",\n      \"allowed_values\": [\n        \"production\",\n        \"development\"\n      ],\n      \"values_editable_by\": \"enterprise_actors\"\n    },\n    {\n      \"property_name\": \"service\",\n      \"source_type\": \"enterprise\",\n      \"value_type\": \"string\"\n    },\n    {\n      \"property_name\": \"team\",\n      \"source_type\": \"enterprise\",\n      \"value_type\": \"string\",\n      \"description\": \"Team owning the organization\"\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get organization custom properties schema for an enterprise](#get-organization-custom-properties-schema-for-an-enterprise).\n\n## Get an organization custom property definition from an enterprise\n\n```\nGET /enterprises/{enterprise}/org-properties/schema/{custom_property_name}\n```\n\nGets an organization custom property definition that is defined on an enterprise.\nAccess requirements:\n\nEnterprise admins\nOAuth tokens and personal access tokens (classic) with the read:enterprise scope\nActors with the enterprise-level \"read enterprise custom properties for organizations\" fine-grained permission or above\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n- **`custom_property_name`** (string) (required)\n  The custom property name\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/org-properties/schema/CUSTOM_PROPERTY_NAME\n```\n\n**Response schema (Status: 200):**\n\n* all of:\n  * **object**\n    * `property_name`: string\n    * `url`: string, format: uri\n    * `source_type`: string, enum: `organization`, `enterprise`\n    * `value_type`: string, enum: `string`, `single_select`, `multi_select`, `true_false`, `url`\n    * `required`: boolean\n    * `default_value`: one of:\n      * **string**\n      * **array**\n    * `description`: string or null\n    * `allowed_values`: array of string or null\n  * **object**\n    * `values_editable_by`: string or null, enum: `enterprise_actors`, `enterprise_and_org_actors`, `null`\n\n## Create or update an organization custom property definition on an enterprise\n\n```\nPUT /enterprises/{enterprise}/org-properties/schema/{custom_property_name}\n```\n\nCreates a new or updates an existing organization custom property definition that is defined on an enterprise.\nAccess requirements:\n\nEnterprise admins\nOAuth tokens and personal access tokens (classic) with the admin:enterprise scope\nActors with the enterprise-level \"manage enterprise custom properties for organizations\" fine-grained permission\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n- **`custom_property_name`** (string) (required)\n  The custom property name\n\n#### Body parameters\n\n- **`value_type`** (string) (required)\n  The type of the value for the property.\n  Can be one of: `string`, `single_select`, `multi_select`, `true_false`, `url`\n\n- **`required`** (boolean)\n  Whether the property is required.\n\n- **`default_value`** (null or string or array)\n  Default value of the property.\n\n- **`description`** (string or null)\n  Short description of the property.\n\n- **`allowed_values`** (array of strings or null)\n  An ordered list of the allowed values of the property.\nThe property can have up to 200 allowed values.\n\n- **`values_editable_by`** (string or null)\n  Who can edit the values of the property.\n  Can be one of: `enterprise_actors`, `enterprise_and_org_actors`, `null`\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/enterprises/ENTERPRISE/org-properties/schema/CUSTOM_PROPERTY_NAME \\\n  -d '{\n  \"value_type\": \"single_select\",\n  \"required\": true,\n  \"default_value\": \"production\",\n  \"description\": \"Prod or dev environment\",\n  \"allowed_values\": [\n    \"production\",\n    \"development\"\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get an organization custom property definition from an enterprise](#get-an-organization-custom-property-definition-from-an-enterprise).\n\n## Remove an organization custom property definition from an enterprise\n\n```\nDELETE /enterprises/{enterprise}/org-properties/schema/{custom_property_name}\n```\n\nRemoves an organization custom property definition that is defined on an enterprise.\nAccess requirements:\n\nEnterprise admins\nOAuth tokens and personal access tokens (classic) with the admin:enterprise scope\nActors with the enterprise-level \"manage enterprise custom properties for organizations\" fine-grained permission\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n- **`custom_property_name`** (string) (required)\n  The custom property name\n\n### HTTP response status codes\n\n- **204** - A header with no content is returned.\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/enterprises/ENTERPRISE/org-properties/schema/CUSTOM_PROPERTY_NAME\n```\n\n**Response schema (Status: 204):**\n\n## List custom property values for organizations in an enterprise\n\n```\nGET /enterprises/{enterprise}/org-properties/values\n```\n\nLists enterprise organizations with all of their custom property values.\nAccess requirements:\n\nEnterprise admins\nOAuth tokens and personal access tokens (classic) with the read:enterprise scope\nActors with the enterprise-level \"read enterprise custom properties for organizations\" fine-grained permission or above\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n- **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n- **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/org-properties/values\n```\n\n**Response schema (Status: 200):**\n\nArray of `Enterprise Organization Custom Property Values`:\n  * `organization_id`: required, integer\n  * `organization_login`: required, string\n  * `properties`: required, array of `Custom Property Value`:\n    * `property_name`: required, string\n    * `value`: required, one of:\n      * **string**\n      * **array**\n\n## Create or update custom property values for organizations in an enterprise\n\n```\nPATCH /enterprises/{enterprise}/org-properties/values\n```\n\nCreate or update custom property values for organizations in an enterprise.\nTo remove a custom property value from an organization, set the property value to null.\nAccess requirements:\n\nEnterprise admins\nOAuth tokens and personal access tokens (classic) with the admin:enterprise scope\nActors with the enterprise-level \"edit enterprise custom properties for organizations\" fine-grained permission or above\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n#### Body parameters\n\n- **`organization_logins`** (array of strings) (required)\n  The names of organizations that the custom property values will be applied to.\n\n- **`properties`** (array of objects) (required)\n  List of custom property names and associated values to apply to the organizations.\n  - **`property_name`** (string) (required)\n    The name of the property\n  - **`value`** (null or string or array) (required)\n    The value assigned to the property\n\n### HTTP response status codes\n\n- **204** - No Content when custom property values are successfully created or updated\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/enterprises/ENTERPRISE/org-properties/values \\\n  -d '{\n  \"organization_logins\": [\n    \"acme\",\n    \"github\"\n  ],\n  \"properties\": [\n    {\n      \"property_name\": \"environment\",\n      \"value\": \"production\"\n    },\n    {\n      \"property_name\": \"service\",\n      \"value\": \"web\"\n    },\n    {\n      \"property_name\": \"team\",\n      \"value\": \"octocat\"\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 204):**"}