{"meta":{"title":"REST-API-Endpunkte für benutzerdefinierte Eigenschaften","intro":"Verwenden Sie die REST-API, um benutzerdefinierte Eigenschaften für eine Organisation zu erstellen und zu verwalten.","product":"REST-API","breadcrumbs":[{"href":"/de/rest","title":"REST-API"},{"href":"/de/rest/orgs","title":"Organisationen"},{"href":"/de/rest/orgs/custom-properties","title":"Benutzerdefinierte Eigenschaften"}],"documentType":"article"},"body":"# REST-API-Endpunkte für benutzerdefinierte Eigenschaften\n\nVerwenden Sie die REST-API, um benutzerdefinierte Eigenschaften für eine Organisation zu erstellen und zu verwalten.\n\n## Informationen zu benutzerdefinierten Eigenschaften\n\nSie können die REST-API verwenden, um benutzerdefinierte Eigenschaften für eine Organisation zu erstellen und zu verwalten. Mit benutzerdefinierten Eigenschaften können Sie den Repositorys in Ihrem Unternehmen Metadaten hinzufügen. Weitere Informationen finden Sie unter [Verwalten von benutzerdefinierten Eigenschaften für Repositorys in Ihrer Organisation](/de/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization).\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 all custom properties for an organization\n\n```\nGET /orgs/{org}/properties/schema\n```\n\nGets all custom properties defined for an organization.\nOrganization members can read these properties.\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* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\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/orgs/ORG/properties/schema\n```\n\n**Response schema (Status: 200):**\n\nArray of `Organization Custom Property`:\n\n* `property_name`: required, string\n* `url`: string, format: uri\n* `source_type`: string, enum: `organization`, `enterprise`\n* `value_type`: required, 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* `values_editable_by`: string or null, enum: `org_actors`, `org_and_repo_actors`, `null`\n* `require_explicit_values`: boolean\n\n## Create or update custom properties for an organization\n\n```\nPATCH /orgs/{org}/properties/schema\n```\n\nCreates new or updates existing custom properties defined for an organization 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.\nE.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.\nTo use this endpoint, the authenticated user must be one of:\n\nAn administrator for the organization.\nA user, or a user on a team, with the fine-grained permission of custom\\_properties\\_org\\_definitions\\_manager in the organization.\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* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n#### Body parameters\n\n* **`properties`** (array of objects) (required)\n  The array of 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.\n    The 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: `org_actors`, `org_and_repo_actors`, `null`\n  * **`require_explicit_values`** (boolean)\n    Whether setting properties values is mandatory\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 PATCH \\\n  https://api.github.com/orgs/ORG/properties/schema \\\n  -d '{\n  \"properties\": [\n    {\n      \"property_name\": \"environment\",\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\": \"org_actors\"\n    },\n    {\n      \"property_name\": \"service\",\n      \"value_type\": \"string\"\n    },\n    {\n      \"property_name\": \"team\",\n      \"value_type\": \"string\",\n      \"description\": \"Team owning the repository\"\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get all custom properties for an organization](#get-all-custom-properties-for-an-organization).\n\n## Get a custom property for an organization\n\n```\nGET /orgs/{org}/properties/schema/{custom_property_name}\n```\n\nGets a custom property that is defined for an organization.\nOrganization members can read these properties.\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* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\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/orgs/ORG/properties/schema/CUSTOM_PROPERTY_NAME\n```\n\n**Response schema (Status: 200):**\n\n* `property_name`: required, string\n* `url`: string, format: uri\n* `source_type`: string, enum: `organization`, `enterprise`\n* `value_type`: required, 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* `values_editable_by`: string or null, enum: `org_actors`, `org_and_repo_actors`, `null`\n* `require_explicit_values`: boolean\n\n## Create or update a custom property for an organization\n\n```\nPUT /orgs/{org}/properties/schema/{custom_property_name}\n```\n\nCreates a new or updates an existing custom property that is defined for an organization.\nTo use this endpoint, the authenticated user must be one of:\n\nAn administrator for the organization.\nA user, or a user on a team, with the fine-grained permission of custom\\_properties\\_org\\_definitions\\_manager in the organization.\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* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\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.\n  The 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: `org_actors`, `org_and_repo_actors`, `null`\n\n* **`require_explicit_values`** (boolean)\n  Whether setting properties values is mandatory\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 PUT \\\n  https://api.github.com/orgs/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 a custom property for an organization](#get-a-custom-property-for-an-organization).\n\n## Remove a custom property for an organization\n\n```\nDELETE /orgs/{org}/properties/schema/{custom_property_name}\n```\n\nRemoves a custom property that is defined for an organization.\nTo use this endpoint, the authenticated user must be one of:\n\nAn administrator for the organization.\nA user, or a user on a team, with the fine-grained permission of custom\\_properties\\_org\\_definitions\\_manager in the organization.\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* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\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### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/orgs/ORG/properties/schema/CUSTOM_PROPERTY_NAME\n```\n\n**Response schema (Status: 204):**\n\n## List custom property values for organization repositories\n\n```\nGET /orgs/{org}/properties/values\n```\n\nLists organization repositories with all of their custom property values.\nOrganization members can read these properties.\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* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\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* **`repository_query`** (string)\n  Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see Constructing a search query. See \"Searching for repositories\" for a detailed list of qualifiers.\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/orgs/ORG/properties/values\n```\n\n**Response schema (Status: 200):**\n\nArray of `Organization Repository Custom Property Values`:\n\n* `repository_id`: required, integer\n* `repository_name`: required, string\n* `repository_full_name`: 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 organization repositories\n\n```\nPATCH /orgs/{org}/properties/values\n```\n\nCreate new or update existing custom property values for repositories in a batch that belong to an organization.\nEach target repository will have its custom property values updated to match the values provided in the request.\nA maximum of 30 repositories can be updated in a single request.\nUsing a value of null for a custom property will remove or 'unset' the property value from the repository.\nTo use this endpoint, the authenticated user must be one of:\n\nAn administrator for the organization.\nA user, or a user on a team, with the fine-grained permission of custom\\_properties\\_org\\_values\\_editor in the organization.\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* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n#### Body parameters\n\n* **`repository_names`** (array of strings) (required)\n  The names of repositories 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 repositories.\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/orgs/ORG/properties/values \\\n  -d '{\n  \"repository_names\": [\n    \"Hello-World\",\n    \"octo-repo\"\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):**"}