Skip to content

GitHub: Create or update a custom property for an organization

GitHub orgs.orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition: arguments, response, policy and SDK examples.

← Orgs operations · Get started

Operation github.orgs_custom_properties_for_repos_create_or_update_organization_definition

Provider route: PUT /orgs/{org}/properties/schema/{custom_property_name}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["orgs"]["orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.orgs.orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_github import GitHubIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.orgs.orgs_custom_properties_for_repos_create_or_update_organization_definition(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.orgstringRequired within parent
path.custom_property_namestringRequired within parent
bodyModelRequired within parentExpand Create or update a custom property for an organization — request body — body

Referenced models: Create or update a custom property for an organization — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get a custom property for an organization — response body

Referenced models: Get a custom property for an organization — response body

Get a custom property for an organization — response body
FieldTypePresenceDescription and constraints
$objectRootCustom property defined on an organization
allowed_valuesJSONOptional
allowed_values (anyOf 1)arrayAlternativeAn ordered list of the allowed values of the property.
The property can have up to 200 allowed values.
allowed_values (anyOf 1)[]stringEach item
allowed_values (anyOf 2)nullAlternative
default_valueJSONOptional
default_value (anyOf 1)JSONAlternativeDefault value of the property
default_value (anyOf 1) (anyOf 1)stringAlternative
default_value (anyOf 1) (anyOf 2)arrayAlternative
default_value (anyOf 1) (anyOf 2)[]stringEach item
default_value (anyOf 2)nullAlternative
descriptionJSONOptional
description (anyOf 1)stringAlternativeShort description of the property
description (anyOf 2)nullAlternative
property_namestringRequired within parentThe name of the property
regexJSONOptional
regex (anyOf 1)stringAlternativeA regular expression (RE2 syntax) that values of the property must match.
Only present for properties with a `value_type` of `string` that define a regular expression.
regex (anyOf 2)nullAlternative
require_explicit_valuesbooleanOptionalWhether setting properties values is mandatory
requiredbooleanOptionalWhether the property is required.
source_typestringOptionalThe source type of the property
Known values: organization, enterprise
urlstringOptionalThe URL that can be used to fetch, update, or delete info about this property via the API.
Format: uri
value_typestringRequired within parentThe type of the value for the property
Known values: string, single_select, multi_select, true_false, url
values_editable_byJSONOptional
values_editable_by (anyOf 1)stringAlternativeWho can edit the values of the property
Known values: org_actors, org_and_repo_actors
values_editable_by (anyOf 2)nullAlternative
Create or update a custom property for an organization — request body — body
FieldTypePresenceDescription and constraints
$objectRootCustom property set payload
allowed_valuesJSONOptional
allowed_values (anyOf 1)arrayAlternativeAn ordered list of the allowed values of the property.
The property can have up to 200 allowed values.
allowed_values (anyOf 1)[]stringEach item
allowed_values (anyOf 2)nullAlternative
default_valueJSONOptional
default_value (anyOf 1)JSONAlternativeDefault value of the property
default_value (anyOf 1) (oneOf 1)JSONAlternative
default_value (anyOf 1) (oneOf 1) (anyOf 1)stringAlternative
default_value (anyOf 1) (oneOf 1) (anyOf 2)nullAlternative
default_value (anyOf 1) (oneOf 2)arrayAlternative
default_value (anyOf 1) (oneOf 2)[]stringEach item
default_value (anyOf 2)nullAlternative
descriptionJSONOptional
description (anyOf 1)stringAlternativeShort description of the property
description (anyOf 2)nullAlternative
regexJSONOptional
regex (anyOf 1)stringAlternativeA regular expression (RE2 syntax) that values of the property must match.
Only supported for properties with a `value_type` of `string`.
regex (anyOf 2)nullAlternative
require_explicit_valuesbooleanOptionalWhether setting properties values is mandatory
requiredbooleanOptionalWhether the property is required.
value_typestringRequired within parentThe type of the value for the property
One of: string, single_select, multi_select, true_false, url
values_editable_byJSONOptional
values_editable_by (anyOf 1)stringAlternativeWho can edit the values of the property
One of: org_actors, org_and_repo_actors
values_editable_by (anyOf 2)nullAlternative

SDK function policy ID: github.orgs_custom_properties_for_repos_create_or_update_organization_definition. Catalog operation: orgs/custom-properties-for-repos-create-or-update-organization-definition. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.