Create a GitHub Pages site
Configures a GitHub Pages site. For more information, see “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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The account owner of the repository. The name is not case sensitive.
The name of the repository without the .git extension. The name is not case sensitive.
Request Body required
Section titled “ Request Body required ”The source branch and directory used to publish your Pages site.
object
The process in which the Page will be built. Possible values are "legacy" and "workflow".
The source branch and directory used to publish your Pages site.
object
The repository branch used to publish your site’s source files.
The repository directory that includes the source files for the Pages site. Allowed paths are / or /docs. Default: /
The source branch and directory used to publish your Pages site.
object
The process in which the Page will be built. Possible values are "legacy" and "workflow".
The source branch and directory used to publish your Pages site.
object
The repository branch used to publish your site’s source files.
The repository directory that includes the source files for the Pages site. Allowed paths are / or /docs. Default: /
Examples
{ "source": { "branch": "main", "path": "/docs" }}Responses
Section titled “ Responses ”Response
The configuration for GitHub Pages for a repository.
object
The API address for accessing this Page resource.
The status of the most recent build of the Page.
The Pages site’s custom domain
The state if the domain is verified
The timestamp when a pending domain becomes unverified.
Whether the Page has a custom 404 page.
The web address the Page can be accessed from.
The process in which the Page will be built.
object
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.
object
Array of the domain set and its alternate name (if it is configured)
Whether https is enabled on the domain
Examples
{ "url": "https://api.github.com/repos/github/developer.github.com/pages", "status": "built", "cname": "developer.github.com", "custom_404": false, "html_url": "https://developer.github.com", "source": { "branch": "master", "path": "/" }, "public": true, "pending_domain_unverified_at": "2024-04-30T19:33:31Z", "protected_domain_state": "verified", "https_certificate": { "state": "approved", "description": "Certificate is approved", "domains": [ "developer.github.com" ], "expires_at": "2021-05-22" }, "https_enforced": true}Conflict
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Validation failed, or the endpoint has been spammed.
Validation Error
object
object
Example generated
{ "message": "example", "documentation_url": "example", "errors": [ { "resource": "example", "field": "example", "message": "example", "code": "example", "index": 1, "value": [ "example" ] } ]}