Sample - GitHub REST API
PATCH/orgs/{org}

Update an organization

Updates an organization's profile and member privileges. Supply only the organization settings you want to change, such as billing_email, default_repository_permission, or repository-creation controls. The authenticated user must be an organization owner, and the members_allowed_repository_creation_type setting is closing down in favor of more granular permissions.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 30 body fields
orgstringrequired
The organization name; matching is case-insensitive.

Optional organization profile and member-privilege settings to update.

billing_emailstringoptional
Billing email address. This address is not publicized.
companystringoptional
The company name.
emailstringoptional
The publicly visible email address.
twitter_usernamestringoptional
The Twitter username of the company.
locationstringoptional
The location.
namestringoptional
The shorthand name of the company.
descriptionstringoptional
The description of the company. The maximum size is 160 characters.
has_organization_projectsbooleanoptional
Whether an organization can use organization projects.
has_repository_projectsbooleanoptional
Whether repositories that belong to the organization can use repository projects.
default_repository_permissionstringoptional
Default permission level members have for organization repositories.
Allowed:readwriteadminnoneDefault:read
members_can_create_repositoriesbooleanoptional
Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details.
Default:true
members_can_create_internal_repositoriesbooleanoptional
Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation.
members_can_create_private_repositoriesbooleanoptional
Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation.
members_can_create_public_repositoriesbooleanoptional
Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation.
members_allowed_repository_creation_typestringoptional
Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details.
Allowed:allprivatenone
members_can_create_pagesbooleanoptional
Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted.
Default:true
members_can_create_public_pagesbooleanoptional
Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted.
Default:true
members_can_create_private_pagesbooleanoptional
Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted.
Default:true
members_can_fork_private_repositoriesbooleanoptional
Whether organization members can fork private organization repositories.
Default:false
web_commit_signoff_requiredbooleanoptional
Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface.
Default:false
blogstringoptional
advanced_security_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
dependabot_alerts_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
dependabot_security_updates_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
dependency_graph_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
secret_scanning_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
secret_scanning_push_protection_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
secret_scanning_push_protection_custom_link_enabledbooleanoptional
Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.
secret_scanning_push_protection_custom_linkstringoptional
If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret.
deploy_keys_enabled_for_repositoriesbooleanoptional
Controls whether or not deploy keys may be added and used for repositories in the organization.

3 status codes
200Returns the updated organization object, including its identity, profile, repository URLs, project settings, and member privileges.
loginstringrequired
idintegerrequired
node_idstringrequired
urlstringrequired
repos_urlstringrequired
events_urlstringrequired
hooks_urlstringrequired
issues_urlstringrequired
members_urlstringrequired
public_members_urlstringrequired
avatar_urlstringrequired
descriptionstringrequired
namestringoptional
companystringoptional
blogstringoptional
locationstringoptional
emailstringoptional
twitter_usernamestringoptional
is_verifiedbooleanoptional
has_organization_projectsbooleanrequired
has_repository_projectsbooleanrequired
public_reposintegerrequired
public_gistsintegerrequired
followersintegerrequired
followingintegerrequired
html_urlstringrequired
typestringrequired
total_private_reposintegeroptional
owned_private_reposintegeroptional
private_gistsintegeroptional
disk_usageintegeroptional
collaboratorsintegeroptional
The number of collaborators on private repositories. This field may be null if the number of private repositories is over 50,000.
billing_emailstringoptional
planobjectoptional
default_repository_permissionstringoptional
default_repository_branchstringoptional
The default branch for repositories created in this organization.
members_can_create_repositoriesbooleanoptional
two_factor_requirement_enabledbooleanoptional
members_allowed_repository_creation_typestringoptional
members_can_create_public_repositoriesbooleanoptional
members_can_create_private_repositoriesbooleanoptional
members_can_create_internal_repositoriesbooleanoptional
members_can_create_pagesbooleanoptional
members_can_create_public_pagesbooleanoptional
members_can_create_private_pagesbooleanoptional
members_can_delete_repositoriesbooleanoptional
members_can_change_repo_visibilitybooleanoptional
members_can_invite_outside_collaboratorsbooleanoptional
members_can_delete_issuesbooleanoptional
display_commenter_full_name_setting_enabledbooleanoptional
readers_can_create_discussionsbooleanoptional
members_can_create_teamsbooleanoptional
members_can_view_dependency_insightsbooleanoptional
members_can_fork_private_repositoriesbooleanoptional
web_commit_signoff_requiredbooleanoptional
advanced_security_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role.
dependabot_alerts_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role.
dependabot_security_updates_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role.
dependency_graph_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role.
secret_scanning_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role.
secret_scanning_push_protection_enabled_for_new_repositoriesbooleandeprecatedoptional
**Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. This field is only visible to organization owners or members of a team with the security manager role.
secret_scanning_push_protection_custom_link_enabledbooleanoptional
Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.
secret_scanning_push_protection_custom_linkstringoptional
An optional URL string to display to contributors who are blocked from pushing a secret.
created_atstringrequired
updated_atstringrequired
archived_atstringrequired
deploy_keys_enabled_for_repositoriesbooleanoptional
Controls whether or not deploy keys may be added and used for repositories in the organization.
409Returned when the organization update conflicts with the current organization state.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when one or more organization settings fail validation.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 409 is returned when the requested organization update conflicts with the current organization state, and a 422 is returned when validation fails. The authenticated user must be an organization owner, and default_repository_permission must be one of read, write, admin, or none. description must not exceed 160 characters; use members_can_create_public_repositories, members_can_create_private_repositories, and, where supported, members_can_create_internal_repositories instead of the closing-down members_allowed_repository_creation_type setting.