Sample - GitHub REST API
GET/repos/{owner}/{repo}/pages/health

Get a DNS health check for GitHub Pages

Gets a health check of the DNS settings for the CNAME record configured for a repository's GitHub Pages.

The first request to this endpoint returns a 202 Accepted status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a 200 OK status with the health check results in the response.

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

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

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.

5 status codes
200Response
domainobjectoptional
alt_domainobjectoptional
202Empty response
400Custom domains are not available for GitHub Pages
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422There isn't a CNAME for this page

Error handling

A 400 is returned: Custom domains are not available for GitHub Pages. A 404 is returned: Resource not found. A 422 is returned: There isn't a CNAME for this page.