GitHub v3 REST API

Create a GitHub Enterprise Server Pages site

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

post
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pages

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json

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

sourceobjectrequired

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

Show Child Parameters

Response

application/json

Response

GitHub Pages

The configuration for GitHub Pages for a repository.

urlstring(uri)required

The API address for accessing this Page resource.

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

statusstring | nullrequired

The status of the most recent build of the Page.

Allowed values:builtbuildingerrored

Example:built

cnamestring | nullrequired

The Pages site’s custom domain

Example:example.com

protected_domain_statestring | null

The state if the domain is verified

Allowed values:pendingverifiedunverified

Example:pending

pending_domain_unverified_atstring | null(date-time)

The timestamp when a pending domain becomes unverified.

custom_404booleanrequired

Whether the Page has a custom 404 page.

Default:false

Example:false

html_urlstring(uri)

The web address the Page can be accessed from.

Example:https://example.com

sourceobject
Show Child Parameters
publicbooleanrequired

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

https_certificateobject
Show Child Parameters
https_enforcedboolean

Whether https is enabled on the domain

Example:true

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

Body

{ "source": { "branch": "main", "path": "/docs" } }
 
application/json

Update information about a GitHub Enterprise Server Pages site

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

put
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pages

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json
Any Of

Response

Response

put/repos/{owner}/{repo}/pages

Body

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

Delete a GitHub Enterprise Server Pages site

delete
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pages

Path Parameters

ownerstringrequired
repostringrequired

Response

Response

delete/repos/{owner}/{repo}/pages
 

List GitHub Enterprise Server Pages builds

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pages/builds

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

Page Build

urlstring(uri)required
statusstringrequired
errorobjectrequired
Show Child Parameters
pusherobject | nullrequired

Simple User

Show Child Parameters
commitstringrequired
durationintegerrequired
created_atstring(date-time)required
updated_atstring(date-time)required
get/repos/{owner}/{repo}/pages/builds
 
200 application/json

Request a GitHub Enterprise Server Pages build

You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.

Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.

post
http://HOSTNAME/api/v3/repos/{owner}/{repo}/pages/builds

Path Parameters

ownerstringrequired
repostringrequired

Response

201 application/json

Response

Page Build Status

Page Build Status

urlstring(uri)required

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

statusstringrequired

Example:queued

post/repos/{owner}/{repo}/pages/builds
 
201 application/json