# Update an organization

From **GitHub v3 REST API**.

`PATCH /orgs/{org}`

**Parameter Deprecation Notice:** GitHub Enterprise Server will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).

Enables an authenticated organization owner with the `admin:org` scope to update the organization's profile and member privileges.

## Parameters

### `org`

- Location: path
- Required: true
- Type: `string`

## Request body

- Required: false
### `application/json`

- Type: `object`

```json
{
  "billing_email": "mona@github.com",
  "company": "GitHub",
  "default_repository_permission": "read",
  "description": "GitHub, the company.",
  "email": "mona@github.com",
  "location": "San Francisco",
  "members_allowed_repository_creation_type": "all",
  "members_can_create_repositories": true,
  "name": "github",
  "twitter_username": "github"
}
```

```json
{"properties":{"billing_email":{"description":"Billing email address. This address is not publicized.","type":"string"},"blog":{"example":"\"http://github.blog\"","type":"string"},"company":{"description":"The company name.","type":"string"},"default_repository_permission":{"default":"read","description":"Default permission level members have for organization repositories:  \n\\* `read` - can pull, but not push to or administer this repository.  \n\\* `write` - can pull and push, but not administer this repository.  \n\\* `admin` - can pull, push, and administer this repository.  \n\\* `none` - no permissions granted by default.","enum":["read","write","admin","none"],"type":"string"},"description":{"description":"The description of the company.","type":"string"},"email":{"description":"The publicly visible email address.","type":"string"},"has_organization_projects":{"description":"Toggles whether an organization can use organization projects.","type":"boolean"},"has_repository_projects":{"description":"Toggles whether repositories that belong to the organization can use repository projects.","type":"boolean"},"location":{"description":"The location.","type":"string"},"members_allowed_repository_creation_type":{"description":"Specifies which types of repositories non-admin organization members can create. Can be one of:  \n\\* `all` - all organization members can create public and private repositories.  \n\\* `private` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud.  \n\\* `none` - only admin members can create repositories.  \n**Note:** This parameter is deprecated 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.","enum":["all","private","none"],"type":"string"},"members_can_create_internal_repositories":{"description":"Toggles 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+. Can be one of:  \n\\* `true` - all organization members can create internal repositories.  \n\\* `false` - only organization owners can create internal repositories.  \nDefault: `true`. 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.","type":"boolean"},"members_can_create_pages":{"default":true,"description":"Toggles whether organization members can create GitHub Pages sites. Can be one of:  \n\\* `true` - all organization members can create GitHub Pages sites.  \n\\* `false` - no organization members can create GitHub Pages sites. Existing published sites will not be impacted.","type":"boolean"},"members_can_create_private_repositories":{"description":"Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of:  \n\\* `true` - all organization members can create private repositories.  \n\\* `false` - only organization owners can create private repositories.  \nDefault: `true`. 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.","type":"boolean"},"members_can_create_public_repositories":{"description":"Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of:  \n\\* `true` - all organization members can create public repositories.  \n\\* `false` - only organization owners can create public repositories.  \nDefault: `true`. 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.","type":"boolean"},"members_can_create_repositories":{"default":true,"description":"Toggles the ability of non-admin organization members to create repositories. Can be one of:  \n\\* `true` - all organization members can create repositories.  \n\\* `false` - only organization owners can create repositories.  \nDefault: `true`  \n**Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details.","type":"boolean"},"members_can_fork_private_repositories":{"default":false,"description":"Toggles whether organization members can fork private organization repositories. Can be one of:  \n\\* `true` - all organization members can fork private repositories within the organization.  \n\\* `false` - no organization members can fork private repositories within the organization.","type":"boolean"},"name":{"description":"The shorthand name of the company.","type":"string"},"twitter_username":{"description":"The Twitter username of the company.","type":"string"}},"type":"object"}
```

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Organization Full

```json
{
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "billing_email": "mona@github.com",
  "blog": "https://github.com/blog",
  "collaborators": 8,
  "company": "GitHub",
  "created_at": "2008-01-14T04:33:35Z",
  "default_repository_permission": "read",
  "description": "A great organization",
  "disk_usage": 10000,
  "email": "octocat@github.com",
  "events_url": "https://api.github.com/orgs/github/events",
  "followers": 20,
  "following": 0,
  "has_organization_projects": true,
  "has_repository_projects": true,
  "hooks_url": "https://api.github.com/orgs/github/hooks",
  "html_url": "https://github.com/octocat",
  "id": 1,
  "is_verified": true,
  "issues_url": "https://api.github.com/orgs/github/issues",
  "location": "San Francisco",
  "login": "github",
  "members_allowed_repository_creation_type": "all",
  "members_can_create_internal_repositories": false,
  "members_can_create_pages": true,
  "members_can_create_private_pages": true,
  "members_can_create_private_repositories": false,
  "members_can_create_public_pages": true,
  "members_can_create_public_repositories": false,
  "members_can_create_repositories": true,
  "members_can_fork_private_repositories": false,
  "members_url": "https://api.github.com/orgs/github/members{/member}",
  "name": "github",
  "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
  "owned_private_repos": 100,
  "plan": {
    "name": "Medium",
    "private_repos": 20,
    "space": 400
  },
  "private_gists": 81,
  "public_gists": 1,
  "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
  "public_repos": 2,
  "repos_url": "https://api.github.com/orgs/github/repos",
  "total_private_repos": 100,
  "twitter_username": "github",
  "two_factor_requirement_enabled": true,
  "type": "Organization",
  "updated_at": "2014-03-03T18:58:10Z",
  "url": "https://api.github.com/orgs/github"
}
```

```json
{"description":"Organization Full","properties":{"avatar_url":{"example":"https://github.com/images/error/octocat_happy.gif","type":"string"},"billing_email":{"example":"org@example.com","format":"email","nullable":true,"type":"string"},"blog":{"example":"https://github.com/blog","format":"uri","type":"string"},"collaborators":{"example":8,"nullable":true,"type":"integer"},"company":{"example":"GitHub","type":"string"},"created_at":{"example":"2008-01-14T04:33:35Z","format":"date-time","type":"string"},"default_repository_permission":{"nullable":true,"type":"string"},"description":{"example":"A great organization","nullable":true,"type":"string"},"disk_usage":{"example":10000,"nullable":true,"type":"integer"},"email":{"example":"octocat@github.com","format":"email","type":"string"},"events_url":{"example":"https://api.github.com/orgs/github/events","format":"uri","type":"string"},"followers":{"example":20,"type":"integer"},"following":{"example":0,"type":"integer"},"has_organization_projects":{"example":true,"type":"boolean"},"has_repository_projects":{"example":true,"type":"boolean"},"hooks_url":{"example":"https://api.github.com/orgs/github/hooks","type":"string"},"html_url":{"example":"https://github.com/octocat","format":"uri","type":"string"},"id":{"example":1,"type":"integer"},"is_verified":{"example":true,"type":"boolean"},"issues_url":{"example":"https://api.github.com/orgs/github/issues","type":"string"},"location":{"example":"San Francisco","type":"string"},"login":{"example":"github","type":"string"},"members_allowed_repository_creation_type":{"example":"all","type":"string"},"members_can_create_internal_repositories":{"example":true,"type":"boolean"},"members_can_create_pages":{"example":true,"type":"boolean"},"members_can_create_private_pages":{"example":true,"type":"boolean"},"members_can_create_private_repositories":{"example":true,"type":"boolean"},"members_can_create_public_pages":{"example":true,"type":"boolean"},"members_can_create_public_repositories":{"example":true,"type":"boolean"},"members_can_create_repositories":{"example":true,"nullable":true,"type":"boolean"},"members_can_fork_private_repositories":{"example":false,"nullable":true,"type":"boolean"},"members_url":{"example":"https://api.github.com/orgs/github/members{/member}","type":"string"},"name":{"example":"github","type":"string"},"node_id":{"example":"MDEyOk9yZ2FuaXphdGlvbjE=","type":"string"},"owned_private_repos":{"example":100,"type":"integer"},"plan":{"properties":{"filled_seats":{"type":"integer"},"name":{"type":"string"},"private_repos":{"type":"integer"},"seats":{"type":"integer"},"space":{"type":"integer"}},"required":["name","space","private_repos"],"type":"object"},"private_gists":{"example":81,"nullable":true,"type":"integer"},"public_gists":{"example":1,"type":"integer"},"public_members_url":{"example":"https://api.github.com/orgs/github/public_members{/member}","type":"string"},"public_repos":{"example":2,"type":"integer"},"repos_url":{"example":"https://api.github.com/orgs/github/repos","format":"uri","type":"string"},"total_private_repos":{"example":100,"type":"integer"},"twitter_username":{"example":"github","nullable":true,"type":"string"},"two_factor_requirement_enabled":{"example":true,"nullable":true,"type":"boolean"},"type":{"example":"Organization","type":"string"},"updated_at":{"format":"date-time","type":"string"},"url":{"example":"https://api.github.com/orgs/github","format":"uri","type":"string"}},"required":["login","url","id","node_id","repos_url","events_url","hooks_url","issues_url","members_url","public_members_url","avatar_url","description","html_url","has_organization_projects","has_repository_projects","public_repos","public_gists","followers","following","type","created_at","updated_at"],"title":"Organization Full","type":"object"}
```

### `409`

Conflict

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

### `422`

Validation failed

### `application/json`

```json
{"oneOf":[{"$ref":"#/components/schemas/validation-error"},{"$ref":"#/components/schemas/validation-error-simple"}]}
```

## Request examples

### cURL

```shell
curl --request PATCH \
  --url {protocol}://{hostname}/api/v3/orgs/{org} \
  --header 'content-type: application/json' \
  --data '{
  "billing_email": "mona@github.com",
  "company": "GitHub",
  "default_repository_permission": "read",
  "description": "GitHub, the company.",
  "email": "mona@github.com",
  "location": "San Francisco",
  "members_allowed_repository_creation_type": "all",
  "members_can_create_repositories": true,
  "name": "github",
  "twitter_username": "github"
}'
```
