Custom hostnames
Serve your GitBook content from fully branded, custom hostnames.
Extend your brand identity by mapping personalized domain names to your docs. This can help unify your documentation site with your existing company properties.
Attributes
objectstring · enumRequiredPossible values:
hostnamestring · max: 512RequiredPattern:
Custom hostname for the site, for e.g. docs.mycompany.com
^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$
targetone ofRequired
or
isActivebooleanRequired
statusone ofOptional
string · enumOptionalPossible values:
The CustomHostname object
{
"object": "custom-hostname",
"hostname": "text",
"target": {
"type": "organization",
"organization": "text"
},
"isActive": true,
"status": "text",
"urls": {
"location": "https://example.com"
}
}
Authorizations
Path parameters
hostnamestringRequired
The custom hostname, for example "docs.gitbook.com"
Responses
200
OK
application/json
get
GET /v1/custom-hostnames/{hostname} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200
OK
{
"object": "custom-hostname",
"hostname": "text",
"target": {
"type": "organization",
"organization": "text"
},
"isActive": true,
"status": "text",
"urls": {
"location": "https://example.com"
}
}
The custom hostname will continue to point to the content or organization unless it is used for another one.
Authorizations
Path parameters
hostnamestringRequired
The custom hostname, for example "docs.gitbook.com"
Responses
205
Custom hostname has been removed
delete
DELETE /v1/custom-hostnames/{hostname} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
205
Custom hostname has been removed
No content
Revalidate DNS records and status.
Authorizations
Path parameters
hostnamestringRequired
The custom hostname, for example "docs.gitbook.com"
Responses
204
DNS validation has been retriggered
400
The current custom hostname is inactive and cannot be revalidated
application/json
409
The current custom hostname status does not allow DNS revalidation
application/json
patch
PATCH /v1/custom-hostnames/{hostname} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Was this helpful?