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
Responseone of
or
get
GET /v1/urls/content HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "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": {
      "view": true,
      "admin": true,
      "viewInviteLinks": true,
      "create": true
    }
  }
}

Resolve a URL to an embed

get
Authorizations
Query parameters
urlstringRequired

URL to resolve

Responses
Responseall of
and
one ofOptional
or
or
get
GET /v1/urls/embed HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "title": "text",
  "site": "text",
  "icon": "text",
  "type": "link"
}
Deprecated

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
Responseone of
or
get
GET /v1/urls/published HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "target": "application",
  "redirect": "https://example.com"
}

Resolve a URL of a published content.

post
Authorizations
Body
urlstring · uri · max: 2048Required

URL to resolve

redirectOnErrorbooleanOptional

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

Default: false
Responses
Responseone of
or
post
POST /v1/urls/published HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 178

{
  "url": "https://example.com",
  "redirectOnError": true,
  "visitor": {
    "jwtToken": "text",
    "unsignedClaims": {
      "ANY_ADDITIONAL_PROPERTY": {
        "ANY_ADDITIONAL_PROPERTY": "[Circular Reference]"
      }
    }
  }
}
{
  "target": "application",
  "redirect": "https://example.com"
}

Was this helpful?