---
title: "Update information about a GitHub Enterprise Cloud Pages site"
method: PUT
path: "/repos/{owner}/{repo}/pages"
tags: ["repos"]
---

# Update information about a GitHub Enterprise Cloud Pages site

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

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

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- union
  - object
    - `cname` string, nullable — 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/enterprise-cloud@latest/pages/configuring-a-custom-domain-for-your-github-pages-site)."
    - `https_enforced` boolean — Specify whether HTTPS should be enforced for the repository.
    - `build_type` 'legacy' | 'workflow', required — The process by which the GitHub Pages site will be built. `workflow` means that the site is built by a custom GitHub Actions workflow. `legacy` means that the site is built by GitHub when changes are pushed to a specific branch.
    - `source` union
      - 'gh-pages' | 'master' | 'master /docs' — 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"`.
      - object — Update the source for the repository. Must include the branch name and path.
        - `branch` string, required — The repository branch used to publish your site's source files.
        - `path` '/' | '/docs', required — The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`.
    - `public` boolean — 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.
  - object
    - `cname` string, nullable — 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/enterprise-cloud@latest/pages/configuring-a-custom-domain-for-your-github-pages-site)."
    - `https_enforced` boolean — Specify whether HTTPS should be enforced for the repository.
    - `build_type` 'legacy' | 'workflow' — The process by which the GitHub Pages site will be built. `workflow` means that the site is built by a custom GitHub Actions workflow. `legacy` means that the site is built by GitHub when changes are pushed to a specific branch.
    - `source` union, required
      - 'gh-pages' | 'master' | 'master /docs' — 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"`.
      - object — Update the source for the repository. Must include the branch name and path.
        - `branch` string, required — The repository branch used to publish your site's source files.
        - `path` '/' | '/docs', required — The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`.
    - `public` boolean — 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.
  - object
    - `cname` string, nullable, required — 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/enterprise-cloud@latest/pages/configuring-a-custom-domain-for-your-github-pages-site)."
    - `https_enforced` boolean — Specify whether HTTPS should be enforced for the repository.
    - `build_type` 'legacy' | 'workflow' — The process by which the GitHub Pages site will be built. `workflow` means that the site is built by a custom GitHub Actions workflow. `legacy` means that the site is built by GitHub when changes are pushed to a specific branch.
    - `source` union
      - 'gh-pages' | 'master' | 'master /docs' — 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"`.
      - object — Update the source for the repository. Must include the branch name and path.
        - `branch` string, required — The repository branch used to publish your site's source files.
        - `path` '/' | '/docs', required — The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`.
    - `public` boolean — 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.
  - object
    - `cname` string, nullable — 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/enterprise-cloud@latest/pages/configuring-a-custom-domain-for-your-github-pages-site)."
    - `https_enforced` boolean — Specify whether HTTPS should be enforced for the repository.
    - `build_type` 'legacy' | 'workflow' — The process by which the GitHub Pages site will be built. `workflow` means that the site is built by a custom GitHub Actions workflow. `legacy` means that the site is built by GitHub when changes are pushed to a specific branch.
    - `source` union
      - 'gh-pages' | 'master' | 'master /docs' — 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"`.
      - object — Update the source for the repository. Must include the branch name and path.
        - `branch` string, required — The repository branch used to publish your site's source files.
        - `path` '/' | '/docs', required — The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`.
    - `public` boolean, required — 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.
  - object
    - `cname` string, nullable — 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/enterprise-cloud@latest/pages/configuring-a-custom-domain-for-your-github-pages-site)."
    - `https_enforced` boolean, required — Specify whether HTTPS should be enforced for the repository.
    - `build_type` 'legacy' | 'workflow' — The process by which the GitHub Pages site will be built. `workflow` means that the site is built by a custom GitHub Actions workflow. `legacy` means that the site is built by GitHub when changes are pushed to a specific branch.
    - `source` union
      - 'gh-pages' | 'master' | 'master /docs' — 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"`.
      - object — Update the source for the repository. Must include the branch name and path.
        - `branch` string, required — The repository branch used to publish your site's source files.
        - `path` '/' | '/docs', required — The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`.
    - `public` boolean — 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.

## Response `204`

Response

## Other responses

- `400` — Bad Request
- `409` — Conflict
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
