# Update information about a GitHub Enterprise Server Pages site

From **GitHub v3 REST API**.

`PUT /repos/{owner}/{repo}/pages`

Updates information for a GitHub Enterprise Server Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).

## Parameters

### `owner`

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

### `repo`

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

## Request body

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

- Type: `object`

```json
{
  "cname": "octocatblog.com",
  "source": {
    "branch": "main",
    "path": "/"
  }
}
```

```json
{"anyOf":[{"required":["source"]},{"required":["cname"]},{"required":["public"]},{"required":["https_enforced"]}],"properties":{"cname":{"description":"Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see \"[Using a custom domain with GitHub Pages](https://docs.github.com/articles/using-a-custom-domain-with-github-pages/).\"","nullable":true,"type":"string"},"https_enforced":{"description":"Specify whether HTTPS should be enforced for the repository.","type":"boolean"},"public":{"description":"Configures access controls for the GitHub Pages site. If public is set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. This includes anyone in your Enterprise if the repository is set to `internal` visibility. This feature is only available to repositories in an organization on an Enterprise plan.","type":"boolean"},"source":{"anyOf":[{"description":"Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory `/docs`. Possible values are `\"gh-pages\"`, `\"master\"`, and `\"master /docs\"`.","enum":["gh-pages","master","master /docs"],"type":"string"},{"description":"Update the source for the repository. Must include the branch name and path.","properties":{"branch":{"description":"The repository branch used to publish your site's source files.","type":"string"},"path":{"description":"The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`.","enum":["/","/docs"],"type":"string"}},"required":["branch","path"],"type":"object"}]}},"type":"object"}
```

## Responses

### `204`

Response

### `400`

Bad Request

### `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"}
```

### `application/scim+json`

- Type: `object`

Scim Error

```json
{"description":"Scim Error","properties":{"detail":{"nullable":true,"type":"string"},"documentation_url":{"nullable":true,"type":"string"},"message":{"nullable":true,"type":"string"},"schemas":{"items":{"type":"string"},"type":"array"},"scimType":{"nullable":true,"type":"string"},"status":{"type":"integer"}},"title":"Scim Error","type":"object"}
```

### `422`

Validation failed

### `application/json`

- Type: `object`

Validation Error

```json
{"description":"Validation Error","properties":{"documentation_url":{"type":"string"},"errors":{"items":{"properties":{"code":{"type":"string"},"field":{"type":"string"},"index":{"type":"integer"},"message":{"type":"string"},"resource":{"type":"string"},"value":{"oneOf":[{"nullable":true,"type":"string"},{"nullable":true,"type":"integer"},{"items":{"type":"string"},"nullable":true,"type":"array"}]}},"required":["code"],"type":"object"},"type":"array"},"message":{"type":"string"}},"required":["message","documentation_url"],"title":"Validation Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request PUT \
  --url {protocol}://{hostname}/api/v3/repos/{owner}/{repo}/pages \
  --header 'content-type: application/json' \
  --data '{
  "cname": "octocatblog.com",
  "source": {
    "branch": "main",
    "path": "/"
  }
}'
```
