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.
trueIf false is passed, content will not be computed
trueGET /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": [
{
"0": "[",
"1": "C",
"2": "i",
"3": "r",
"4": "c",
"5": "u",
"6": "l",
"7": "a",
"8": "r",
"9": " ",
"10": "R",
"11": "e",
"12": "f",
"13": "e",
"14": "r",
"15": "e",
"16": "n",
"17": "c",
"18": "e",
"19": "]",
"id": "text",
"title": "text",
"git": {
"oid": "text",
"path": "text"
}
}
],
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"createdAt": "2025-10-27T08:34:09.525Z",
"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
The ID of the template to use for the space
POST /v1/spaces/{spaceId}/content/template HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 96
{
"id": "text",
"params": {
"contentRefs": {
"ANY_ADDITIONAL_PROPERTY": {
"kind": "file",
"file": "text"
}
}
}
}Template applied to space.
No content
The unique id of the space
If false is passed, "git" mutable metadata will not returned. Passing false can optimize performances of the lookup.
trueIf false is passed, content will not be computed
trueGET /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-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"width": "default",
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true,
"metadata": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0,
"height": 240
},
"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.
trueIf false is passed, content will not be computed
trueGET /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.
trueIf false is passed, content will not be computed
trueGET /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-10-27T08:34:09.525Z",
"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-10-27T08:34:09.525Z",
"hasPaymentFailed": true,
"isScheduledToCancel": true,
"pricing": {
"members": {
"plus_2024": {
"monthly": 1,
"yearly": 1
},
"pro_2024": {
"monthly": 1,
"yearly": 1
}
},
"sites": {
"premium": {
"monthly": 1,
"yearly": 1
},
"ultimate": {
"monthly": 1,
"yearly": 1
}
}
},
"usageAddons": {
"ANY_ADDITIONAL_PROPERTY": {
"enabled": true
}
}
},
"mergeRules": {
"type": "rules",
"rules": [
{
"rule": "require_specific_reviewers",
"users": [
"text"
]
}
]
},
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"logo": "https://example.com"
},
"trial": {
"status": "notapplicable",
"count": 1,
"endDate": "2025-10-27T08:34:09.525Z",
"decision": "downgrade"
},
"customHostname": "text",
"blocked": {
"source": "backoffice",
"reason": "text"
},
"internal_billingMigration": {
"deadline": "2025-10-27T08:34:09.525Z",
"discountPercent": 1,
"discountEndDate": "2025-10-27T08:34:09.525Z"
},
"permissions": {
"view": true,
"admin": true,
"ownTeam": true,
"createContent": true,
"createOpenAPISpec": true,
"ingestConversations": true,
"viewBilling": true,
"listMembers": true,
"listTeams": true,
"listIntegrations": true,
"listInstallations": true,
"installIntegration": true
}
},
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"deletedAt": "2025-10-27T08:34:09.525Z",
"editMode": "live",
"mergeRules": {
"type": "inherit"
},
"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",
"language": "en",
"gitSync": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-10-27T08:34:09.525Z"
},
"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,
"installIntegration": 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.
Controls whether the document should be evaluated.
- When set to
true, the entire document will be evaluated. - When set to
deterministic-only, only expressions that depend exclusively on deterministic inputs will be evaluated.
falseIf false is passed, "git" mutable metadata will not returned. Passing false can optimize performances of the lookup.
trueIf false is passed, content will not be computed
trueGET /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-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"width": "default",
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true,
"metadata": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0,
"height": 240
},
"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-10-27T08:34:09.525Z",
"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-10-27T08:34:09.525Z",
"hasPaymentFailed": true,
"isScheduledToCancel": true,
"pricing": {
"members": {
"plus_2024": {
"monthly": 1,
"yearly": 1
},
"pro_2024": {
"monthly": 1,
"yearly": 1
}
},
"sites": {
"premium": {
"monthly": 1,
"yearly": 1
},
"ultimate": {
"monthly": 1,
"yearly": 1
}
}
},
"usageAddons": {
"ANY_ADDITIONAL_PROPERTY": {
"enabled": true
}
}
},
"mergeRules": {
"type": "rules",
"rules": [
{
"rule": "require_specific_reviewers",
"users": [
"text"
]
}
]
},
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"logo": "https://example.com"
},
"trial": {
"status": "notapplicable",
"count": 1,
"endDate": "2025-10-27T08:34:09.525Z",
"decision": "downgrade"
},
"customHostname": "text",
"blocked": {
"source": "backoffice",
"reason": "text"
},
"internal_billingMigration": {
"deadline": "2025-10-27T08:34:09.525Z",
"discountPercent": 1,
"discountEndDate": "2025-10-27T08:34:09.525Z"
},
"permissions": {
"view": true,
"admin": true,
"ownTeam": true,
"createContent": true,
"createOpenAPISpec": true,
"ingestConversations": true,
"viewBilling": true,
"listMembers": true,
"listTeams": true,
"listIntegrations": true,
"listInstallations": true,
"installIntegration": true
}
},
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"deletedAt": "2025-10-27T08:34:09.525Z",
"editMode": "live",
"mergeRules": {
"type": "inherit"
},
"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",
"language": "en",
"gitSync": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-10-27T08:34:09.525Z"
},
"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,
"installIntegration": 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-10-27T08:34:09.525Z",
"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-10-27T08:34:09.525Z",
"hasPaymentFailed": true,
"isScheduledToCancel": true,
"pricing": {
"members": {
"plus_2024": {
"monthly": 1,
"yearly": 1
},
"pro_2024": {
"monthly": 1,
"yearly": 1
}
},
"sites": {
"premium": {
"monthly": 1,
"yearly": 1
},
"ultimate": {
"monthly": 1,
"yearly": 1
}
}
},
"usageAddons": {
"ANY_ADDITIONAL_PROPERTY": {
"enabled": true
}
}
},
"mergeRules": {
"type": "rules",
"rules": [
{
"rule": "require_specific_reviewers",
"users": [
"text"
]
}
]
},
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"logo": "https://example.com"
},
"trial": {
"status": "notapplicable",
"count": 1,
"endDate": "2025-10-27T08:34:09.525Z",
"decision": "downgrade"
},
"customHostname": "text",
"blocked": {
"source": "backoffice",
"reason": "text"
},
"internal_billingMigration": {
"deadline": "2025-10-27T08:34:09.525Z",
"discountPercent": 1,
"discountEndDate": "2025-10-27T08:34:09.525Z"
},
"permissions": {
"view": true,
"admin": true,
"ownTeam": true,
"createContent": true,
"createOpenAPISpec": true,
"ingestConversations": true,
"viewBilling": true,
"listMembers": true,
"listTeams": true,
"listIntegrations": true,
"listInstallations": true,
"installIntegration": true
}
},
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"deletedAt": "2025-10-27T08:34:09.525Z",
"editMode": "live",
"mergeRules": {
"type": "inherit"
},
"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",
"language": "en",
"gitSync": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-10-27T08:34:09.525Z"
},
"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,
"installIntegration": 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-10-27T08:34:09.525Z",
"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-10-27T08:34:09.525Z",
"hasPaymentFailed": true,
"isScheduledToCancel": true,
"pricing": {
"members": {
"plus_2024": {
"monthly": 1,
"yearly": 1
},
"pro_2024": {
"monthly": 1,
"yearly": 1
}
},
"sites": {
"premium": {
"monthly": 1,
"yearly": 1
},
"ultimate": {
"monthly": 1,
"yearly": 1
}
}
},
"usageAddons": {
"ANY_ADDITIONAL_PROPERTY": {
"enabled": true
}
}
},
"mergeRules": {
"type": "rules",
"rules": [
{
"rule": "require_specific_reviewers",
"users": [
"text"
]
}
]
},
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"logo": "https://example.com"
},
"trial": {
"status": "notapplicable",
"count": 1,
"endDate": "2025-10-27T08:34:09.525Z",
"decision": "downgrade"
},
"customHostname": "text",
"blocked": {
"source": "backoffice",
"reason": "text"
},
"internal_billingMigration": {
"deadline": "2025-10-27T08:34:09.525Z",
"discountPercent": 1,
"discountEndDate": "2025-10-27T08:34:09.525Z"
},
"permissions": {
"view": true,
"admin": true,
"ownTeam": true,
"createContent": true,
"createOpenAPISpec": true,
"ingestConversations": true,
"viewBilling": true,
"listMembers": true,
"listTeams": true,
"listIntegrations": true,
"listInstallations": true,
"installIntegration": true
}
},
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"deletedAt": "2025-10-27T08:34:09.525Z",
"editMode": "live",
"mergeRules": {
"type": "inherit"
},
"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",
"language": "en",
"gitSync": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-10-27T08:34:09.525Z"
},
"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,
"installIntegration": 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 path of the page in the revision.
Output format for the content.
Controls whether the document should be evaluated.
- When set to
true, the entire document will be evaluated. - When set to
deterministic-only, only expressions that depend exclusively on deterministic inputs will be evaluated.
falseIf false is passed, "git" mutable metadata will not returned. Passing false can optimize performances of the lookup.
trueIf false is passed, content will not be computed
trueGET /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-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"width": "default",
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true,
"metadata": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0,
"height": 240
},
"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.
trueIf false is passed, content will not be computed
trueGET /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",
"git": {
"oid": "text",
"path": "text"
},
"computed": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"computedSeed": "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-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"width": "default",
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true,
"metadata": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0,
"height": 240
},
"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"
}
}
],
"reusableContents": [
{
"id": "text",
"title": "text",
"git": {
"oid": "text",
"path": "text"
},
"computed": {
"type": "builtin:openapi",
"dependencies": {
"spec": {
"ref": {
"kind": "openapi",
"spec": "text"
}
}
},
"props": {
"doc": "models"
}
},
"computedSeed": "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.
trueIf false is passed, content will not be computed
trueGET /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": [
{
"0": "[",
"1": "C",
"2": "i",
"3": "r",
"4": "c",
"5": "u",
"6": "l",
"7": "a",
"8": "r",
"9": " ",
"10": "R",
"11": "e",
"12": "f",
"13": "e",
"14": "r",
"15": "e",
"16": "n",
"17": "c",
"18": "e",
"19": "]",
"id": "text",
"title": "text",
"git": {
"oid": "text",
"path": "text"
}
}
],
"variables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"createdAt": "2025-10-27T08:34:09.525Z",
"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.
trueIf false is passed, content will not be computed
trueLimit the number of changes returned
10GET /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",
"description": {
"object": "document",
"data": {
"schemaVersion": 1,
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"nodes": [
{
"object": "block",
"type": "paragraph",
"key": "text",
"nodes": "[Circular Reference]",
"isVoid": false,
"data": {
"align": "start"
}
}
]
},
"createdBy": {
"object": "user",
"id": "text",
"displayName": "text",
"email": "text",
"photoURL": "text",
"urls": {
"location": "https://example.com"
}
},
"createdAt": "2025-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"space": "text",
"revision": "text",
"revisionInitial": "text",
"revisionMergedAncestor": "text",
"revisionMerged": "text",
"comments": 1,
"outdated": true,
"conversationsIssuesCluster": "text",
"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.
trueIf false is passed, content will not be computed
trueGET /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-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"width": "default",
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true,
"metadata": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0,
"height": 240
},
"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.
trueIf false is passed, content will not be computed
trueGET /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.
trueIf false is passed, content will not be computed
trueGET /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.
Controls whether the document should be evaluated.
- When set to
true, the entire document will be evaluated. - When set to
deterministic-only, only expressions that depend exclusively on deterministic inputs will be evaluated.
falseIf false is passed, "git" mutable metadata will not returned. Passing false can optimize performances of the lookup.
trueIf false is passed, content will not be computed
trueGET /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-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"width": "default",
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true,
"metadata": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0,
"height": 240
},
"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
Controls whether the document should be evaluated.
- When set to
true, the entire document will be evaluated. - When set to
deterministic-only, only expressions that depend exclusively on deterministic inputs will be evaluated.
falseGET /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.
Controls whether the document should be evaluated.
- When set to
true, the entire document will be evaluated. - When set to
deterministic-only, only expressions that depend exclusively on deterministic inputs will be evaluated.
falseIf false is passed, "git" mutable metadata will not returned. Passing false can optimize performances of the lookup.
trueIf false is passed, content will not be computed
trueGET /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-10-27T08:34:09.525Z",
"updatedAt": "2025-10-27T08:34:09.525Z",
"markdown": "text",
"type": "document",
"urls": {
"app": "https://example.com"
},
"slug": "text",
"path": "text",
"description": "text",
"pages": [
"[Circular Reference]"
],
"git": {
"oid": "text",
"path": "text"
},
"layout": {
"width": "default",
"cover": true,
"coverSize": "hero",
"title": true,
"description": true,
"tableOfContents": true,
"outline": true,
"pagination": true,
"metadata": true
},
"cover": {
"ref": {
"kind": "file",
"file": "text"
},
"refDark": {
"kind": "file",
"file": "text"
},
"yPos": 0,
"height": 240
},
"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.
trueIf false is passed, content will not be computed
trueGET /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",
"git": {
"oid": "text",
"path": "text"
},
"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
Controls whether the document should be evaluated.
- When set to
true, the entire document will be evaluated. - When set to
deterministic-only, only expressions that depend exclusively on deterministic inputs will be evaluated.
falseGET /v1/spaces/{spaceId}/revisions/{revisionId}/reusable-contents/{reusableContentId}/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
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"
}Last updated
Was this helpful?