Space content
Import, export, and search content in a space.
Handle your space content programmatically by creating, updating, or listing pages and files. Ideal for bulk operations or synchronizing with external systems.
The unique id of the space
Identifier of the page results to fetch.
The number of results per page
GET /v1/spaces/{spaceId}/search HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"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"
}
}
]
}
The unique id of the space
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/content HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"object": "revision",
"id": "text",
"parents": [
"text"
],
"pages": [
"[Circular Reference]"
],
"files": [
{
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
],
"reusableContents": [
{
"id": "text",
"title": "text",
"document": "text",
"git": {
"oid": "text",
"path": "text"
}
}
],
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"createdAt": "2025-06-21T04:13:00.492Z",
"git": {
"oid": "text",
"message": "text",
"createdByGitBook": true,
"url": "text",
"ref": "text"
},
"urls": {
"app": "https://example.com",
"published": "https://example.com",
"public": "https://example.com"
},
"type": "edits"
}
The unique id of the space
URL of the content to import.
POST /v1/spaces/{spaceId}/content/import HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 48
{
"url": "https://example.com",
"source": "website"
}
Content imported in a new revision
{
"revision": "text",
"importedResources": 1,
"totalResources": 1
}
The unique id of the space
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/content/pages HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"pages": [
{
"id": "text",
"title": "text",
"emoji": "🎉",
"icon": "gear",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"documentId": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0
},
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"hidden": false,
"noIndex": false,
"noRobotsIndex": false,
"computed": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"computedSeed": "text"
}
]
}
The unique id of the space
Identifier of the page results to fetch.
The number of results per page
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/content/files HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
]
}
The unique id of the space
The unique id of the file
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/content/files/{fileId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
The unique id of the space
The unique id of the file
Identifier of the page results to fetch.
The number of results per page
GET /v1/spaces/{spaceId}/content/files/{fileId}/backlinks HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"kind": "file",
"organization": {
"object": "organization",
"id": "text",
"title": "text",
"createdAt": "2025-06-21T04:13:00.492Z",
"emailDomains": [
"text"
],
"hostname": "text",
"type": "business",
"useCase": "internalDocs",
"communityType": "nonProfit",
"defaultRole": "admin",
"defaultContent": {
"type": "site",
"site": "text"
},
"sso": true,
"ai": true,
"inviteLinks": true,
"plan": "free_2024",
"billing": {
"interval": "monthly",
"endDate": "2025-06-21T04:13:00.492Z",
"hasPaymentFailed": true,
"isScheduledToCancel": true
},
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"logo": "https://example.com"
},
"trial": {
"status": "notapplicable",
"endDate": "2025-06-21T04:13:00.492Z",
"decision": "downgrade"
},
"customHostname": "text",
"blocked": {
"reason": "security"
},
"internal_billingMigration": {
"deadline": "2025-06-21T04:13:00.492Z",
"discountPercent": 1,
"discountEndDate": "2025-06-21T04:13:00.492Z"
},
"permissions": {
"view": true,
"admin": true,
"ownTeam": true,
"createContent": true,
"createOpenAPISpec": true,
"ingestConversations": true,
"viewBilling": true,
"listMembers": true,
"listTeams": true,
"listIntegrations": true
}
},
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"deletedAt": "2025-06-21T04:13:00.492Z",
"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": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-06-21T04:13:00.492Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"view": true,
"access": true,
"admin": true,
"viewInviteLinks": true,
"edit": true,
"triggerGitSync": true,
"comment": true,
"merge": true,
"review": true
}
},
"versionContext": {
"type": "revision",
"revision": "[Circular Reference]"
},
"file": {
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
}
]
}
The unique id of the space
The unique id of the page
Output format for the content.
If true
is passed, the document will be evaluated
false
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/content/page/{pageId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"id": "text",
"title": "text",
"emoji": "🎉",
"icon": "gear",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"documentId": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0
},
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"hidden": false,
"noIndex": false,
"noRobotsIndex": false,
"computed": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"computedSeed": "text"
}
The unique id of the space
The unique id of the page
Identifier of the page results to fetch.
The number of results per page
Text to display to represent the reference. Possible values include:
ok
- No problems detected for this content reference.broken
- The target does not exist in the revision.in-app
- The target is a URL link pointing to an internal location in the app.
GET /v1/spaces/{spaceId}/content/page/{pageId}/links HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"next": {
"page": "text"
},
"count": 1,
"stats": {
"total": 1,
"broken": {
"total": 1,
"changeRequest": 1
}
},
"items": [
{
"status": "ok",
"relation": "reference",
"targetReference": {
"kind": "file",
"organization": {
"object": "organization",
"id": "text",
"title": "text",
"createdAt": "2025-06-21T04:13:00.492Z",
"emailDomains": [
"text"
],
"hostname": "text",
"type": "business",
"useCase": "internalDocs",
"communityType": "nonProfit",
"defaultRole": "admin",
"defaultContent": {
"type": "site",
"site": "text"
},
"sso": true,
"ai": true,
"inviteLinks": true,
"plan": "free_2024",
"billing": {
"interval": "monthly",
"endDate": "2025-06-21T04:13:00.492Z",
"hasPaymentFailed": true,
"isScheduledToCancel": true
},
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"logo": "https://example.com"
},
"trial": {
"status": "notapplicable",
"endDate": "2025-06-21T04:13:00.492Z",
"decision": "downgrade"
},
"customHostname": "text",
"blocked": {
"reason": "security"
},
"internal_billingMigration": {
"deadline": "2025-06-21T04:13:00.492Z",
"discountPercent": 1,
"discountEndDate": "2025-06-21T04:13:00.492Z"
},
"permissions": {
"view": true,
"admin": true,
"ownTeam": true,
"createContent": true,
"createOpenAPISpec": true,
"ingestConversations": true,
"viewBilling": true,
"listMembers": true,
"listTeams": true,
"listIntegrations": true
}
},
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"deletedAt": "2025-06-21T04:13:00.492Z",
"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": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-06-21T04:13:00.492Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"view": true,
"access": true,
"admin": true,
"viewInviteLinks": true,
"edit": true,
"triggerGitSync": true,
"comment": true,
"merge": true,
"review": true
}
},
"versionContext": "[Circular Reference]",
"file": {
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
},
"locationReferences": [
{
"kind": "file",
"organization": {
"object": "organization",
"id": "text",
"title": "text",
"createdAt": "2025-06-21T04:13:00.492Z",
"emailDomains": [
"text"
],
"hostname": "text",
"type": "business",
"useCase": "internalDocs",
"communityType": "nonProfit",
"defaultRole": "admin",
"defaultContent": {
"type": "site",
"site": "text"
},
"sso": true,
"ai": true,
"inviteLinks": true,
"plan": "free_2024",
"billing": {
"interval": "monthly",
"endDate": "2025-06-21T04:13:00.492Z",
"hasPaymentFailed": true,
"isScheduledToCancel": true
},
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"logo": "https://example.com"
},
"trial": {
"status": "notapplicable",
"endDate": "2025-06-21T04:13:00.492Z",
"decision": "downgrade"
},
"customHostname": "text",
"blocked": {
"reason": "security"
},
"internal_billingMigration": {
"deadline": "2025-06-21T04:13:00.492Z",
"discountPercent": 1,
"discountEndDate": "2025-06-21T04:13:00.492Z"
},
"permissions": {
"view": true,
"admin": true,
"ownTeam": true,
"createContent": true,
"createOpenAPISpec": true,
"ingestConversations": true,
"viewBilling": true,
"listMembers": true,
"listTeams": true,
"listIntegrations": true
}
},
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"deletedAt": "2025-06-21T04:13:00.492Z",
"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": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-06-21T04:13:00.492Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"view": true,
"access": true,
"admin": true,
"viewInviteLinks": true,
"edit": true,
"triggerGitSync": true,
"comment": true,
"merge": true,
"review": true
}
},
"versionContext": "[Circular Reference]",
"file": {
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
}
]
}
]
}
The unique id of the space
The unique id of the page
Identifier of the page results to fetch.
The number of results per page
GET /v1/spaces/{spaceId}/content/page/{pageId}/backlinks HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"kind": "file",
"organization": {
"object": "organization",
"id": "text",
"title": "text",
"createdAt": "2025-06-21T04:13:00.492Z",
"emailDomains": [
"text"
],
"hostname": "text",
"type": "business",
"useCase": "internalDocs",
"communityType": "nonProfit",
"defaultRole": "admin",
"defaultContent": {
"type": "site",
"site": "text"
},
"sso": true,
"ai": true,
"inviteLinks": true,
"plan": "free_2024",
"billing": {
"interval": "monthly",
"endDate": "2025-06-21T04:13:00.492Z",
"hasPaymentFailed": true,
"isScheduledToCancel": true
},
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"logo": "https://example.com"
},
"trial": {
"status": "notapplicable",
"endDate": "2025-06-21T04:13:00.492Z",
"decision": "downgrade"
},
"customHostname": "text",
"blocked": {
"reason": "security"
},
"internal_billingMigration": {
"deadline": "2025-06-21T04:13:00.492Z",
"discountPercent": 1,
"discountEndDate": "2025-06-21T04:13:00.492Z"
},
"permissions": {
"view": true,
"admin": true,
"ownTeam": true,
"createContent": true,
"createOpenAPISpec": true,
"ingestConversations": true,
"viewBilling": true,
"listMembers": true,
"listTeams": true,
"listIntegrations": true
}
},
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"deletedAt": "2025-06-21T04:13:00.492Z",
"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": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-06-21T04:13:00.492Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"view": true,
"access": true,
"admin": true,
"viewInviteLinks": true,
"edit": true,
"triggerGitSync": true,
"comment": true,
"merge": true,
"review": true
}
},
"versionContext": {
"type": "revision",
"revision": "[Circular Reference]"
},
"file": {
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
}
]
}
The unique id of the space
The unique id of the page
URL of the content to import.
POST /v1/spaces/{spaceId}/content/page/{pageId}/import HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 48
{
"url": "https://example.com",
"source": "website"
}
Content imported in a new revision
{
"revision": "text",
"importedResources": 1,
"totalResources": 1
}
The unique id of the space
The path of the page in the revision.
Output format for the content.
If true
is passed, the document will be evaluated
false
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/content/path/{pagePath} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"id": "text",
"title": "text",
"emoji": "🎉",
"icon": "gear",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"documentId": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0
},
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"hidden": false,
"noIndex": false,
"noRobotsIndex": false,
"computed": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"computedSeed": "text"
}
The unique id of the space
The unique id of the reusable content
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/content/reusable-contents/{reusableContentId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"id": "text",
"title": "text",
"document": "text",
"git": {
"oid": "text",
"path": "text"
}
}
The unique id of the space
Version of the schema used for the document.
Seed to use for the generation of IDs.
POST /v1/spaces/{spaceId}/content/computed/document HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 141
{
"source": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"seed": "text"
}
Document computed
{
"object": "document",
"data": {
"schemaVersion": 1,
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"nodes": [
{
"object": "block",
"type": "paragraph",
"key": "text",
"nodes": [
{
"object": "inline",
"type": "link",
"key": "text",
"nodes": [
{
"object": "text",
"key": "text",
"leaves": [
{
"object": "leaf",
"text": "text",
"marks": [
{
"object": "mark",
"type": "bold"
}
]
}
]
}
],
"data": {
"ref": {
"kind": "file",
"file": "text"
}
},
"isVoid": false
}
],
"isVoid": false,
"data": {
"align": "start"
}
}
]
}
The unique id of the space
Seed to use for the generation of IDs.
POST /v1/spaces/{spaceId}/content/computed/revision HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 140
{
"source": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"models": true
}
},
"seed": "text"
}
Computed pages and files
{
"pages": [
{
"id": "text",
"title": "text",
"emoji": "🎉",
"icon": "gear",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"documentId": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0
},
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"hidden": false,
"noIndex": false,
"noRobotsIndex": false,
"computed": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"computedSeed": "text"
}
],
"files": [
{
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
]
}
The unique id of the space
ID of the document in the space
Version of the schema used for the document.
GET /v1/spaces/{spaceId}/documents/{documentId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Document
{
"object": "document",
"data": {
"schemaVersion": 1,
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"nodes": [
{
"object": "block",
"type": "paragraph",
"key": "text",
"nodes": [
{
"object": "inline",
"type": "link",
"key": "text",
"nodes": [
{
"object": "text",
"key": "text",
"leaves": [
{
"object": "leaf",
"text": "text",
"marks": [
{
"object": "mark",
"type": "bold"
}
]
}
]
}
],
"data": {
"ref": {
"kind": "file",
"file": "text"
}
},
"isVoid": false
}
],
"isVoid": false,
"data": {
"align": "start"
}
}
]
}
The unique id of the space
The unique id of the revision
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/revisions/{revisionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"object": "revision",
"id": "text",
"parents": [
"text"
],
"pages": [
"[Circular Reference]"
],
"files": [
{
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
],
"reusableContents": [
{
"id": "text",
"title": "text",
"document": "text",
"git": {
"oid": "text",
"path": "text"
}
}
],
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"createdAt": "2025-06-21T04:13:00.492Z",
"git": {
"oid": "text",
"message": "text",
"createdByGitBook": true,
"url": "text",
"ref": "text"
},
"urls": {
"app": "https://example.com",
"published": "https://example.com",
"public": "https://example.com"
},
"type": "edits"
}
Return the semantic changes between a revision and its parent.
The unique id of the space
The unique id of the revision
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
Limit the number of changes returned
10
GET /v1/spaces/{spaceId}/revisions/{revisionId}/changes HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"mergedFrom": {
"object": "change-request",
"id": "text",
"number": 1,
"status": "draft",
"subject": "text",
"createdBy": {
"object": "user",
"id": "text",
"displayName": "text",
"email": "text",
"photoURL": "text",
"urls": {
"location": "https://example.com"
}
},
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"revision": "text",
"revisionInitial": "text",
"revisionMergedAncestor": "text",
"revisionMerged": "text",
"comments": 1,
"outdated": true,
"urls": {
"app": "https://example.com",
"location": "https://example.com"
}
},
"changes": [
{
"type": "page_created",
"page": {
"id": "text",
"type": "document",
"title": "text",
"path": "text"
}
}
],
"more": 1
}
The unique id of the space
The unique id of the revision
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/revisions/{revisionId}/pages HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"pages": [
{
"id": "text",
"title": "text",
"emoji": "🎉",
"icon": "gear",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"documentId": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0
},
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"hidden": false,
"noIndex": false,
"noRobotsIndex": false,
"computed": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"computedSeed": "text"
}
]
}
The unique id of the space
The unique id of the revision
Identifier of the page results to fetch.
The number of results per page
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/revisions/{revisionId}/files HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
]
}
The unique id of the space
The unique id of the revision
The unique id of the file
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/revisions/{revisionId}/files/{fileId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"id": "text",
"name": "text",
"contentType": "text",
"downloadURL": "text",
"size": 1,
"dimensions": {
"width": 1,
"height": 1
},
"git": {
"oid": "text",
"path": "text"
}
}
The unique id of the space
The unique id of the revision
The unique id of the page
Output format for the content.
If true
is passed, the document will be evaluated
false
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/revisions/{revisionId}/page/{pageId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"id": "text",
"title": "text",
"emoji": "🎉",
"icon": "gear",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"documentId": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0
},
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"hidden": false,
"noIndex": false,
"noRobotsIndex": false,
"computed": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"computedSeed": "text"
}
The unique id of the space
The unique id of the revision
The unique id of the page
If true
is passed, the document will be evaluated
false
GET /v1/spaces/{spaceId}/revisions/{revisionId}/page/{pageId}/document HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"object": "document",
"data": {
"schemaVersion": 1,
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"nodes": [
{
"object": "block",
"type": "paragraph",
"key": "text",
"nodes": [
{
"object": "inline",
"type": "link",
"key": "text",
"nodes": [
{
"object": "text",
"key": "text",
"leaves": [
{
"object": "leaf",
"text": "text",
"marks": [
{
"object": "mark",
"type": "bold"
}
]
}
]
}
],
"data": {
"ref": {
"kind": "file",
"file": "text"
}
},
"isVoid": false
}
],
"isVoid": false,
"data": {
"align": "start"
}
}
]
}
The unique id of the space
The unique id of the revision
The path of the page in the revision.
Output format for the content.
If true
is passed, the document will be evaluated
false
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/revisions/{revisionId}/path/{pagePath} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"id": "text",
"title": "text",
"emoji": "🎉",
"icon": "gear",
"createdAt": "2025-06-21T04:13:00.492Z",
"updatedAt": "2025-06-21T04:13:00.492Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"documentId": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0
},
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"hidden": false,
"noIndex": false,
"noRobotsIndex": false,
"computed": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"computedSeed": "text"
}
The unique id of the space
The unique id of the revision
The unique id of the reusable content
If false
is passed, "git" mutable metadata will not returned. Passing false
can optimize performances of the lookup.
true
If false
is passed, content will not be computed
true
GET /v1/spaces/{spaceId}/revisions/{revisionId}/reusable-contents/{reusableContentId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"id": "text",
"title": "text",
"document": "text",
"git": {
"oid": "text",
"path": "text"
}
}
The unique id of the space
Generate a PDF only for the provided page.
ID of a specific page to generate a PDF for.
GET /v1/spaces/{spaceId}/pdf HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
URL of the PDF
{
"url": "https://example.com"
}
Was this helpful?