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.
Authorizations
Query parameters
urlstringRequired
URL to resolve
Responses
200
OK
application/json
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
}
}
}
Authorizations
Query parameters
urlstringRequired
URL to resolve
Responses
200
OK
application/json
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"
}
Authorizations
Query parameters
urlstring · uri · max: 2048Required
URL to resolve
visitorAuthTokenstringOptional
JWT token generated for a authenticated access session
redirectOnErrorbooleanOptionalDefault:
When true redirects the user to the authentication/fallback URL if the access token is invalid
false
Responses
200
OK
application/json
Responseone of
or
404
No content found for the URL.
application/json
get
GET /v1/urls/published HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"target": "application",
"redirect": "https://example.com"
}
Authorizations
Body
urlstring · uri · max: 2048Required
URL to resolve
redirectOnErrorbooleanOptionalDefault:
When true redirects the user to the authentication/fallback URL if the access token is invalid
false
Responses
200
OK
application/json
Responseone of
or
404
No content found for the URL.
application/json
post
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]"
}
}
}
}
{
"target": "application",
"redirect": "https://example.com"
}
Was this helpful?