REST-API-Endpunkte für benutzerdefinierte Eigenschaften
Verwenden Sie die REST-API, um die benutzerdefinierten Eigenschaften aufzulisten, die einem Repository der Organisation zugewiesen sind.
Informationen zu benutzerdefinierten Eigenschaften
Sie können die REST-API verwenden, um die benutzerdefinierten Eigenschaften anzuzeigen, die einem Repository von der Organisation zugewiesen wurden, die das Repository besitzt. Weitere Informationen finden Sie unter Verwalten von benutzerdefinierten Eigenschaften für Repositorys in Ihrer Organisation. Weitere Informationen zu den Endpunkten der REST-API zum Verwalten benutzerdefinierter Eigenschaften findest du unter REST-API-Endpunkte für benutzerdefinierte Eigenschaften.
Get all custom property values for a repository
Gets all custom property values that are set for a repository. Users with read access to the repository can use this endpoint.
Fine-grained access tokens for "Get all custom property values for a repository"
This endpoint works with the following fine-grained token types:
- GitHub App user access tokens
- GitHub App installation access tokens
- Fine-grained personal access tokens
The fine-grained token must have the following permission set:
- "Metadata" repository permissions (read)
This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.
Parameter für "Get all custom property values for a repository"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG |
|---|
owner string ErforderlichThe account owner of the repository. The name is not case sensitive. |
repo string ErforderlichThe name of the repository without the |
HTTP response status codes for "Get all custom property values for a repository"
| Status code | BESCHREIBUNG |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Code samples for "Get all custom property values for a repository"
Request example
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/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 a repository
Create new or update existing custom property values for a repository.
Using a value of null for a custom property will remove or 'unset' the property value from the repository.
Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint.
Fine-grained access tokens for "Create or update custom property values for a repository"
This endpoint works with the following fine-grained token types:
- GitHub App user access tokens
- GitHub App installation access tokens
- Fine-grained personal access tokens
The fine-grained token must have the following permission set:
- "Custom properties" repository permissions (write)
Parameter für "Create or update custom property values for a repository"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG |
|---|
owner string ErforderlichThe account owner of the repository. The name is not case sensitive. |
repo string ErforderlichThe name of the repository without the |
| Name, Typ, BESCHREIBUNG | |||
|---|---|---|---|
properties array of objects ErforderlichA list of custom property names and associated values to apply to the repositories. | |||
Properties of |
| Name, Typ, BESCHREIBUNG |
|---|
property_name string ErforderlichThe name of the property |
value null or string or array ErforderlichThe value assigned to the property |
HTTP response status codes for "Create or update custom property values for a repository"
| Status code | BESCHREIBUNG |
|---|---|
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. |
Code samples for "Create or update custom property values for a repository"
Request example
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/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