Skip to main content

Create a GitHub Enterprise Server Pages site

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

POST/repos/{owner}/{repo}/pages
Source
github-v3-rest.json
Revision
f5f067c1e6f6
Active snapshot
85e53e3d0d65

Request

Path Parameters
owner string
required
repo string
required
Body Params
required
application/jsonobject
source object
required

The source branch and directory used to publish your Pages site.

branch string
required

The repository branch used to publish your site's source files.

path string
optional

The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. Default: `/`

Responses

application/json GitHub Pages object

Response

cname string
requirednullable

The Pages site's custom domain

Example: example.com

custom_404 boolean
required

Whether the Page has a custom 404 page.

Example: false

html_url string<uri>
optional

The web address the Page can be accessed from.

Example: https://example.com

https_certificate Pages Https Certificate object
optional
description string
required

Example: Certificate is approved

domains array[string]
required

Array of the domain set and its alternate name (if it is configured)

Example:
[
  "example.com",
  "www.example.com"
]
expires_at string<date>
optional
state string
required

Example: approved

https_enforced boolean
optional

Whether https is enabled on the domain

Example: true

pending_domain_unverified_at string<date-time>
optionalnullable

The timestamp when a pending domain becomes unverified.

protected_domain_state string
optionalnullable

The state if the domain is verified

Example: pending

public boolean
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.

Example: true

source Pages Source Hash object
optional
branch string
required
path string
required
status string
requirednullable

The status of the most recent build of the Page.

Example: built

url string<uri>
required

The API address for accessing this Page resource.

Example: https://api.github.com/repos/github/hello-world/pages

application/json Basic Error object

Conflict

documentation_url string
optional
message string
optional
status string
optional
url string
optional
application/json Validation Error object

Validation failed

documentation_url string
required
errors array[object]
optional
items object
code string
required
field string
optional
index integer
optional
message string
optional
resource string
optional
value
optional
message string
required