Skip to main content

custom_properties

Creates, updates, deletes, gets or lists a custom_properties resource.

Overview

Namecustom_properties
TypeResource
Idgithub.orgs.custom_properties

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
property_namestringThe name of the property
allowed_valuesarrayAn ordered list of the allowed values of the property. The property can have up to 200 allowed values.
default_valuestringDefault value of the property
descriptionstringShort description of the property
require_explicit_valuesbooleanWhether setting properties values is mandatory
requiredbooleanWhether the property is required.
source_typestringThe source type of the property (organization, enterprise) (example: organization)
urlstring (uri)The URL that can be used to fetch, update, or delete info about this property via the API.
value_typestringThe type of the value for the property (string, single_select, multi_select, true_false, url) (example: single_select)
values_editable_bystringWho can edit the values of the property (org_actors, org_and_repo_actors) (example: org_actors)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
custom_properties_for_repos_get_organization_definitionselectorg, custom_property_nameGets a custom property that is defined for an organization.
Organization members can read these properties.
custom_properties_for_repos_get_organization_definitionsselectorgGets all custom properties defined for an organization.
Organization members can read these properties.
custom_properties_for_repos_create_or_update_organization_definitionsupdateorg, propertiesCreates 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_manager in the organization.
custom_properties_for_repos_create_or_update_organization_definitionreplaceorg, custom_property_name, value_typeCreates a new or updates an existing custom property that is defined for an organization.

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_manager in the organization.
custom_properties_for_repos_delete_organization_definitiondeleteorg, custom_property_nameRemoves a custom property that is defined for an organization.

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_manager in the organization.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
custom_property_namestringThe custom property name
orgstringThe organization name. The name is not case sensitive.

SELECT examples

Gets a custom property that is defined for an organization.
Organization members can read these properties.

SELECT
property_name,
allowed_values,
default_value,
description,
require_explicit_values,
required,
source_type,
url,
value_type,
values_editable_by
FROM github.orgs.custom_properties
WHERE org = '{{ org }}' -- required
AND custom_property_name = '{{ custom_property_name }}' -- required
;

UPDATE examples

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_manager in the organization.

UPDATE github.orgs.custom_properties
SET
properties = '{{ properties }}'
WHERE
org = '{{ org }}' --required
AND properties = '{{ properties }}' --required
RETURNING
property_name,
allowed_values,
default_value,
description,
require_explicit_values,
required,
source_type,
url,
value_type,
values_editable_by;

REPLACE examples

Creates a new or updates an existing custom property that is defined for an organization.

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_manager in the organization.

REPLACE github.orgs.custom_properties
SET
value_type = '{{ value_type }}',
required = {{ required }},
default_value = '{{ default_value }}',
description = '{{ description }}',
allowed_values = '{{ allowed_values }}',
values_editable_by = '{{ values_editable_by }}',
require_explicit_values = {{ require_explicit_values }}
WHERE
org = '{{ org }}' --required
AND custom_property_name = '{{ custom_property_name }}' --required
AND value_type = '{{ value_type }}' --required
RETURNING
property_name,
allowed_values,
default_value,
description,
require_explicit_values,
required,
source_type,
url,
value_type,
values_editable_by;

DELETE examples

Removes a custom property that is defined for an organization.

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_manager in the organization.

DELETE FROM github.orgs.custom_properties
WHERE org = '{{ org }}' --required
AND custom_property_name = '{{ custom_property_name }}' --required
;