v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2024-01-0382859610.0 MB
repos

Create a GitHub Enterprise Server Pages site

Configures a GitHub Enterprise Server Pages site. For more information, see "About GitHub Pages."

To use this endpoint, you must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission. A token with the repo scope or Pages write permission is required. GitHub Apps must have the administration:write and pages:write permissions.

post/repos/{owner}/{repo}/pages

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

Request body

OR

Response

Response

urlstring uri required

The API address for accessing this Page resource.

status'built' | 'building' | 'errored' nullable required

The status of the most recent build of the Page.

cnamestring nullable required

The Pages site's custom domain

protected_domain_state'pending' | 'verified' | 'unverified' nullable

The state if the domain is verified

pending_domain_unverified_atstring date-time nullable

The timestamp when a pending domain becomes unverified.

custom_404boolean required

Whether the Page has a custom 404 page.

html_urlstring uri

The web address the Page can be accessed from.

build_type'legacy' | 'workflow' nullable

The process in which the Page will be built.

publicboolean required

Whether the GitHub Pages site is publicly visible. If 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.

https_enforcedboolean

Whether https is enabled on the domain

Example response

{
  "url": "https://api.github.com/repos/github/hello-world/pages",
  "status": "built",
  "cname": "example.com",
  "protected_domain_state": "pending",
  "html_url": "https://example.com",
  "build_type": "legacy",
  "public": true,
  "https_certificate": {
    "state": "approved",
    "description": "Certificate is approved",
    "domains": [
      "example.com",
      "www.example.com"
    ]
  },
  "https_enforced": true
}