Explore how adaptive content transforms your docs into a dynamic, tailored experience for every user.
Read the docs
LogoLogo
ProductPricingLog inSign up
  • Documentation
  • Developers
  • Guides
  • Changelog
  • Help Center
  • Getting Started
    • Developer Documentation
    • Quickstart
    • Development
    • Publishing
  • Integrations
    • Introduction
    • Using the CLI
    • Configuration
    • ContentKit
      • Component reference
    • Integration runtime
  • Client library
  • Guides
    • Creating a custom unfurl action
    • Creating interactive blocks
    • Referencing your integration in Markdown
    • Working with HTTP requests
    • Using the CLI in CI/CD
  • GitBook API
    • Introduction
    • Authentication
    • API reference
      • Organizations
        • Organization members
        • Organization invites
        • Organization AI ask
      • Docs sites
        • Site share links
        • Site structure
        • Site auth
        • Site preview
        • Site customization
        • Site spaces
        • Site sections
        • Site section groups
        • Site redirects
        • Site MCP servers
        • Site ads
        • Site users
        • Site insights
        • Site AI ask
      • Collections
        • Collection users
        • Collection teams
      • Spaces
        • Space content
        • Space comments
        • Space embeds
        • Space users
        • Space teams
        • Space integrations
        • Git
      • Change requests
        • Change request content
        • Change request contributors
        • Change request reviewers
        • Change request comments
      • Translations
        • Glossary
      • Integrations
      • URLs
      • OpenAPI
        • OpenAPI spec versions
      • Conversations
      • Custom fonts
      • Subdomains
      • Users
      • Teams
        • Team members
      • SSO
      • Storage
      • Custom hostnames
      • System info
    • Rate limiting
    • Pagination
    • Errors
  • Marketplace
    • Overview
    • Submit your app for review
  • Resources
    • Concepts
    • Changelog
    • ContentKit playground
    • GitHub examples
Powered by GitBook
On this page
  1. GitBook API
  2. API reference

Custom hostnames

Serve your GitBook content from fully branded, custom hostnames.

Was this helpful?

LogoLogo

Resources

  • Showcase
  • Enterprise
  • Status

Company

  • Careers
  • Blog
  • Community

Policies

  • Subprocessors
  • Terms of Service
CtrlK
  • The CustomHostname object
  • GETGet a custom hostname
  • DELETERemove a custom hostname
  • PATCHRevalidate a custom hostname DNS

Was this helpful?

Extend your brand identity by mapping personalized domain names to your docs. This can help unify your documentation site with your existing company properties.

The CustomHostname object

Attributes
objectstring · enumRequiredPossible values:
hostnamestring · max: 512Required

Custom hostname for the site, for e.g. docs.mycompany.com

Pattern: ^([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"
  }
}

Get a custom hostname

get
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"
  }
}

Remove a custom hostname

delete

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
204

Custom hostname did not exist

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: */*

No content

Revalidate a custom hostname DNS

patch

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