URLs

Configure where and how your GitBook content can be accessed.

Manage official endpoints, direct deep links, or short links for your content. This allows you to keep track of multiple custom URLs or vanity links under one system.

Resolve a URL to a content (space, collection, page)

get
Authorizations
Query parameters
urlstringrequired

URL to resolve

Responses
curl -L \
  --url 'https://api.gitbook.com/v1/urls/content?url=text' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "collection": {
    "object": "collection",
    "id": "text",
    "title": "text",
    "description": "text",
    "organization": "text",
    "parent": "text",
    "defaultLevel": "admin",
    "urls": {
      "location": "https://example.com",
      "app": "https://example.com"
    },
    "permissions": {
      "admin": true,
      "create": true
    }
  }
}

Resolve a URL to an embed

get
Authorizations
Query parameters
urlstringrequired

URL to resolve

Responses
curl -L \
  --url 'https://api.gitbook.com/v1/urls/embed?url=text' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "title": "text",
  "site": "text",
  "icon": "text",
  "type": "link"
}

Resolve a URL of a published content.

get
Authorizations
Query parameters
urlstring · uri · max: 2048required

URL to resolve

visitorAuthTokenstringoptional

JWT token generated for a visitor auth session

redirectOnErrorbooleanoptional

When true redirects the user to the authentication/fallback URL if the visitor auth token is invalid

Default: false
Responses
curl -L \
  --url 'https://api.gitbook.com/v1/urls/published?url=https%3A%2F%2Fexample.com' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "target": "application",
  "redirect": "https://example.com"
}

Was this helpful?