repo
scope or Pages write permission is required. GitHub Apps must have the administration:write
and pages:write
permissions.curl --location --request POST 'https://api.github.com/repos///pages' \
--header 'Content-Type: application/json' \
--data-raw '{
"source": {
"branch": "main",
"path": "/docs"
}
}'
{
"build_type": "legacy",
"cname": "example.com",
"custom_404": false,
"html_url": "https://example.com",
"https_certificate": {
"description": "Certificate is approved",
"domains": [
"example.com",
"www.example.com"
],
"expires_at": "2019-08-24",
"state": "approved"
},
"https_enforced": true,
"pending_domain_unverified_at": "2019-08-24T14:15:22Z",
"protected_domain_state": "pending",
"public": true,
"source": {
"branch": "string",
"path": "string"
},
"status": "built",
"url": "https://api.github.com/repos/github/hello-world/pages"
}
"legacy"
and "workflow"
.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.