API Reference [Sample]
Access the release version and build date of the GitBook codebase
Authorizations
Responses
200
OK
application/json
default
Unexpected Error
application/json
get
GET /v1/ HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"version": "text",
"build": "text"
}
Authorizations
Query parameters
querystring ยท max: 512Required
pagestringOptional
Identifier of the page results to fetch.
limitnumber ยท max: 1000Optional
The number of results per page
Responses
200
OK
application/json
Responseall of
default
Unexpected Error
application/json
get
GET /v1/search HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"id": "text",
"title": "text",
"pages": [
{
"id": "text",
"title": "text",
"path": "text",
"sections": [
{
"id": "text",
"title": "text",
"path": "text",
"body": "text",
"urls": {
"app": "https://example.com"
}
}
],
"urls": {
"app": "https://example.com"
}
}
]
}
]
}
Authorizations
Query parameters
querystringRequired
formatstring ยท enumOptionalPossible values:
Output format for the content.
detailsbooleanOptional
Return query details in the result
Responses
200
OK
application/json
default
Unexpected Error
application/json
get
GET /v1/search/ask HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"answer": {
"answer": {
"markdown": "text"
},
"followupQuestions": [
"text"
],
"sources": [
{
"type": "page",
"page": "text",
"revision": "text",
"space": "text",
"sections": [
"text"
]
}
]
}
}
Authorizations
Query parameters
formatstring ยท enumOptionalPossible values:
Output format for the content.
detailsbooleanOptional
Return query details in the result
Body
querystringRequired
previousQueriesstring[] ยท max: 10OptionalDeprecated
Responses
200
OK
application/json
default
Unexpected Error
application/json
post
POST /v1/search/ask HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"query": "text"
}
{
"answer": {
"answer": {
"markdown": "text"
},
"followupQuestions": [
"text"
],
"sources": [
{
"type": "page",
"page": "text",
"revision": "text",
"space": "text",
"sections": [
"text"
]
}
]
}
}
Authorizations
Path parameters
spaceIdstringRequired
The unique id of the space
Body
all ofOptional
and
one ofOptional
or
or
Responses
200
The space has been updated
application/json
default
Unexpected Error
application/json
patch
PATCH /v1/spaces/{spaceId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 72
{
"editMode": "live",
"title": "text",
"defaultLevel": "admin",
"emoji": "๐"
}
{
"object": "space",
"id": "text",
"title": "text",
"emoji": "๐",
"visibility": "public",
"createdAt": "2025-07-13T03:44:09.605Z",
"updatedAt": "2025-07-13T03:44:09.605Z",
"deletedAt": "2025-07-13T03:44:09.605Z",
"editMode": "live",
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"published": "https://example.com",
"public": "https://example.com",
"icon": "https://example.com"
},
"organization": "text",
"parent": "text",
"gitSync": {
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-07-13T03:44:09.605Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"access": true,
"admin": true,
"edit": true,
"comment": true,
"merge": true,
"review": true
}
}
Authorizations
Path parameters
spaceIdstringRequired
The unique id of the space
Responses
205
Space has been deleted
default
Unexpected Error
application/json
delete
DELETE /v1/spaces/{spaceId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
PreviousCreating and Hosting an API With FlaskNextBuilding a Full Stack Application with Flask and HTMx
Was this helpful?