GitBook API API ReferenceCustom hostnames Configure and manage custom hostnames for your docs sites.
Get the details about a custom hostname.
get
https://api.gitbook.com/v1 /custom-hostnames/ {hostname}
hostname string required
The custom hostname, for example "docs.gitbook.com"
Copy curl -L \
--url 'https://api.gitbook.com/v1/custom-hostnames/{hostname}' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
Copy {
"object": "custom-hostname",
"hostname": "text",
"target": {
"type": "organization",
"organization": "text"
},
"isActive": true,
"status": "text",
"urls": {
"location": "https://example.com"
}
}
Remove a custom hostname from a content or organization. The custom hostname will continue to point to the content or organization unless it is used for another one.
delete
https://api.gitbook.com/v1 /custom-hostnames/ {hostname}
hostname string required
The custom hostname, for example "docs.gitbook.com"
Copy curl -L \
--request DELETE \
--url 'https://api.gitbook.com/v1/custom-hostnames/{hostname}' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
Revalidate a custom hostname's DNS records and status.
patch
https://api.gitbook.com/v1 /custom-hostnames/ {hostname}
hostname string required
The custom hostname, for example "docs.gitbook.com"
Copy curl -L \
--request PATCH \
--url 'https://api.gitbook.com/v1/custom-hostnames/{hostname}' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'