GitBook API API reference URLsConfigure 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
https://api.gitbook.com/v1 /urls/content
one of Optional
object Optional URL resolved to a collection
Show properties
object Optional URL resolved to the content of a space
Show properties
Copy GET /v1/urls/content HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Resolve a URL to an embed
get
https://api.gitbook.com/v1 /urls/embed
all of Optional
object Optional
Show properties
one of Optional
object Optional
Show Integration
Copy GET /v1/urls/embed HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Resolve a URL of a published content.
get
https://api.gitbook.com/v1 /urls/published
url string · uri · max: 2048 Required visitorAuthToken string Optional JWT token generated for a visitor auth session
redirectOnError boolean Optional When true redirects the user to the authentication/fallback URL if the visitor auth token is invalid
Default: false
one of Optional
object Optional
Show Redirect
object Optional
Show Site Content
Copy GET /v1/urls/published HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Resolve a URL of a published content.
post
https://api.gitbook.com/v1 /urls/published
url string · uri · max: 2048 Required redirectOnError boolean Optional When true redirects the user to the authentication/fallback URL if the visitor auth token is invalid
Default: false
visitor object Optional An object that describes the payload of site visitor info. It can include a jwt token with signed claims and/or a record of its unsigned claims.
Show properties
one of Optional
object Optional
Show Redirect
object Optional
Show Site Content
Copy 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]"
}
}
}
}