Content
Content in GitBook is the entity for content on a page.
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
trueOK
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": [
{
"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-11-06T14:41:48.956Z",
"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
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
trueOK
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 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
trueOK
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-11-06T14:41:48.956Z",
"updatedAt": "2025-11-06T14:41:48.956Z",
"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 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
trueOK
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-11-06T14:41:48.956Z",
"updatedAt": "2025-11-06T14:41:48.956Z",
"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
URL of the Git repository to import. It can contain basic auth credentials.
Git ref to import in the format "refs/heads/main"
Unique identifier to use to cache the Git repository across multiple operations.
URL to use as a prefix for external file references.
URL to use as a prefix for the commit URL.
Path to a root directory for the project in the repository.
The timestamp of the event that triggered this import. It ensures that Git sync import and export operations are executed in the same order on GitBook and on the remote repository.
If true, the import will generate a revision without updating the space primary content.
Operation to import the repository has been started.
No content
POST /v1/spaces/{spaceId}/git/import HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 237
{
"url": "text",
"ref": "text",
"repoCacheID": "text",
"repoTreeURL": "text",
"repoCommitURL": "text",
"repoProjectDirectory": "text",
"timestamp": "2025-11-06T14:41:48.956Z",
"force": true,
"standalone": true,
"gitInfo": {
"provider": "github",
"url": "text"
}
}Operation to import the repository has been started.
No content
Was this helpful?