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

URLs

Configure where and how your GitBook content can be accessed.

Was this helpful?

LogoLogo

Resources

  • Showcase
  • Enterprise
  • Status

Company

  • Careers
  • Blog
  • Community

Policies

  • Subprocessors
  • Terms of Service
CtrlK

Was this helpful?

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.

  • GETResolve a URL to a content (space, collection, page)
  • GETResolve a URL to an embed
  • GETResolve a URL of a published content.
  • POSTResolve a URL of a published content.

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

get
Authorizations
Query parameters
urlstringRequired

URL to resolve

Responses
200

OK

application/json
Responseone of
or
get
200

OK

Resolve a URL to an embed

get
Authorizations
Query parameters
urlstringRequired

URL to resolve

Responses
200

OK

application/json
Responseall of
and
one ofOptional
or
or
get
200

OK

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 authenticated access session

redirectOnErrorbooleanOptional

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

Default: false
Responses
200

OK

application/json
Responseone of
or
404

No content found for the URL.

application/json
get

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 access token is invalid

Default: false
Responses
200

OK

application/json
Responseone of
or
404

No content found for the URL.

application/json
post

OK

{
  "target": "application",
  "redirect": "https://example.com"
}
GET /v1/urls/content HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "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
    }
  }
}
GET /v1/urls/embed HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "title": "text",
  "site": "text",
  "icon": "text",
  "type": "link"
}
GET /v1/urls/published HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "target": "application",
  "redirect": "https://example.com"
}
POST /v1/urls/published HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 179

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