GitBook Space Content API

Manage pages and content within a space.

GitHub OpenAPI
Business capability
Content Management AE-170.70

Operations 25

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /spaces/{spaceId}/search Search a space's published pages · Full-text search across all pages in a space #
Ask an LLM
“How do I find a page by keyword in a published GitBook space?”
“Can I search all pages in one space and get ranked excerpts?”
Tell an agent
Search space {spaceId} for {query}.
Find pages in {spaceId} matching {query} using {limit} results per page.
GET /spaces/{spaceId}/content Get the live published content of a space · Get the current published content revision of a space #
Ask an LLM
“What does the currently published content of my space look like?”
“Can I get the full page tree and files of a space as it's live right now?”
Tell an agent
Get the current published content of space {spaceId}.
Show the live page tree and files for {spaceId}.
POST /spaces/{spaceId}/content/template Bootstrap a space with a content template · Apply a content template to populate a space with initial pages #
Ask an LLM
“How do I populate a new space with a standard documentation layout?”
“Can I apply a template to a change request instead of main content?”
Tell an agent
Apply template {id} to space {spaceId}.
Bootstrap {spaceId} with template {id} using parameters {params}.
GET /spaces/{spaceId}/content/pages List all pages in a space · List all pages in a space with their hierarchy and metadata #
Ask an LLM
“What pages exist in my space and how are they nested?”
“Can I get every page's title, URL and parent-child links?”
Tell an agent
List all pages in space {spaceId}.
Show the full page hierarchy of {spaceId}.
GET /spaces/{spaceId}/content/files List uploaded files in a space · List all uploaded files and assets in a space #
Ask an LLM
“Which images and attachments are uploaded to my space?”
“Can I page through all assets in a space's current revision?”
Tell an agent
List uploaded files in space {spaceId}.
Show {limit} assets per page in {spaceId}.
GET /spaces/{spaceId}/content/files/{fileId} Get an uploaded file by ID · Get a specific uploaded file from a space by its ID #
Ask an LLM
“How do I get the download URL and MIME type of a file I already uploaded?”
“What metadata comes back for a specific file ID in a space?”
Tell an agent
Get file {fileId} in space {spaceId}.
Show the download URL of {fileId} from {spaceId}.
GET /spaces/{spaceId}/content/page/{pageId} Get a page by ID · Get a single page from a space by its ID #
Ask an LLM
“How do I fetch the content of one page when I know its ID?”
“Can I get a page's content as markdown with relative references?”
Tell an agent
Get page {pageId} in space {spaceId}.
Show {pageId} from {spaceId} as {format}.
GET /spaces/{spaceId}/content/path/{pagePath} Get a page by its URL path · Get a page from a space by its URL path #
Ask an LLM
“How do I find a page when I know its URL path, like /guides/getting-started?”
“Can I look up a page by path instead of by ID?”
Tell an agent
Get the page at path {pagePath} in space {spaceId}.
Look up {pagePath} in {spaceId} and return it as {format}.
GET /spaces/{spaceId}/content/reusable-contents/{reusableContentId} Get a reusable content block by ID · Get a reusable content block from a space by its ID #
Ask an LLM
“How do I read the content of a reusable snippet I already created?”
“Can I fetch one reusable content block by its ID?”
Tell an agent
Get reusable content block {reusableContentId} in space {spaceId}.
Show the snippet {reusableContentId} from {spaceId}.
POST /spaces/{spaceId}/content/computed/document Render a single computed document · Compute and render a document from a structured content source #
Ask an LLM
“How do I preview how a dynamic document will render before publishing?”
“Can I compute a document from a content source definition with a seed value?”
Tell an agent
Compute document {source} in space {spaceId} with seed {seed}.
Render the single document {source} from {spaceId} using seed {seed}.
POST /spaces/{spaceId}/content/computed/revision Render a full computed revision · Compute and render a full revision from a structured content source #
Ask an LLM
“Can I preview every page and file of a computed revision before publishing?”
“How do I resolve all template expressions in a content source definition into a full revision?”
Tell an agent
Compute a full revision of {source} in space {spaceId} with seed {seed}.
Render every page and file in {source} for {spaceId} using seed {seed}.
GET /spaces/{spaceId}/documents/{documentId} Get a raw document by ID · Get a raw document from a space by its document ID #
Ask an LLM
“What does the raw block-level JSON document look like for a page?”
“Can I fetch a document's raw structure by its ID?”
Tell an agent
Get document {documentId} in space {spaceId}.
Show the raw block structure of {documentId} from {spaceId}.
GET /spaces/{spaceId}/revisions/{revisionId} Get a historical space revision · Get a specific historical revision of a space #
Ask an LLM
“How do I inspect the content of a space as it was at a past revision?”
“Can I see the page tree and metadata of an old snapshot of my space?”
Tell an agent
Get revision {revisionId} of space {spaceId}.
Show the page tree of {revisionId} in {spaceId}.
GET /spaces/{spaceId}/revisions/{revisionId}/changes See what a revision changed · Get semantic content changes introduced by a revision #
Ask an LLM
“What pages were added, removed or updated in a specific revision?”
“Can I get a semantic diff of a revision compared to its parent?”
Tell an agent
Show the semantic changes introduced by revision {revisionId} in space {spaceId}.
Compare {revisionId} to its parent in {spaceId} and limit changes to {limit}.
GET /spaces/{spaceId}/revisions/{revisionId}/pages List pages in a historical revision · List all pages in a specific historical revision of a space #
Ask an LLM
“Which pages existed in a past snapshot of my space?”
“Can I get the full flat list of pages from a historical revision?”
Tell an agent
List all pages in revision {revisionId} of space {spaceId}.
Show every page in {revisionId} from {spaceId}.
GET /spaces/{spaceId}/revisions/{revisionId}/files List files in a historical revision · List all files (images, assets) in a specific space revision #
Ask an LLM
“Which images and assets were attached to a past snapshot of my space?”
“Can I page through the files in a historical revision?”
Tell an agent
List files in revision {revisionId} of space {spaceId}.
Show {limit} assets per page in {revisionId} from {spaceId}.
GET /spaces/{spaceId}/revisions/{revisionId}/files/{fileId} Get a file from a historical revision · Get a specific file from a space revision by its file ID #
Ask an LLM
“How do I get the download URL of an image that was attached to a past revision?”
“What metadata comes back for one file in a historical snapshot?”
Tell an agent
Get file {fileId} from revision {revisionId} in space {spaceId}.
Show the download URL of {fileId} in {revisionId} of {spaceId}.
GET /spaces/{spaceId}/revisions/{revisionId}/page/{pageId} Get a page from a historical revision · Get a page from a specific historical revision by its page ID #
Ask an LLM
“How do I fetch a page's content from a past snapshot of my space?”
“Can I get a page from a historical revision as markdown?”
Tell an agent
Get page {pageId} from revision {revisionId} in space {spaceId}.
Show {pageId} in {revisionId} of {spaceId} as {format}.
GET /spaces/{spaceId}/revisions/{revisionId}/page/{pageId}/document Get a page's raw document in a revision · Get the raw document body of a page in a historical revision #
Ask an LLM
“What does the raw block tree of a page look like in a past snapshot?”
“Can I fetch a page's document body from a historical revision?”
Tell an agent
Get the raw document of page {pageId} in revision {revisionId} of space {spaceId}.
Show the block tree of {pageId} from {revisionId} in {spaceId}.
GET /spaces/{spaceId}/revisions/{revisionId}/path/{pagePath} Get a page by path in a historical revision · Get a page from a specific historical revision by its URL path #
Ask an LLM
“How do I read a page's content from a past revision when I only know its path?”
“Can I get a page's markdown from a historical revision by its URL path?”
Tell an agent
Get the page at path {pagePath} in revision {revisionId} of space {spaceId}.
Fetch page {pagePath} from revision {revisionId} of space {spaceId} as {format}.
GET /spaces/{spaceId}/revisions/{revisionId}/reusable-contents/{reusableContentId} Get reusable content metadata in a revision · Get a reusable content block from a historical revision by its ID #
Ask an LLM
“How do I look up the metadata of a reusable content block in a past revision?”
“Can I check when a reusable snippet was last edited in a historical revision?”
Tell an agent
Get reusable content {reusableContentId} in revision {revisionId} of space {spaceId}.
Show metadata for reusable snippet {reusableContentId} from revision {revisionId} of space {spaceId}.
GET /spaces/{spaceId}/revisions/{revisionId}/reusable-contents/{reusableContentId}/document Get reusable content body in a revision · Get the document body of a reusable content block in a historical revision #
Ask an LLM
“How do I read the actual content of a reusable snippet from a historical revision?”
“Can I get a reusable block's document body at a point in time?”
Tell an agent
Get the document body of reusable content {reusableContentId} in revision {revisionId} of space {spaceId}.
Fetch reusable snippet {reusableContentId} from revision {revisionId} of space {spaceId} with references dereferenced {dereferenced}.
GET /spaces/{spaceId}/pdf Get a PDF download link for a space · Get a temporary URL to download a space or page as PDF #
Ask an LLM
“How do I generate a PDF of my whole space for a past revision?”
“Can I get a temporary link to download a single page as PDF?”
Tell an agent
Get a temporary PDF link for space {spaceId}.
Generate a PDF of page {page} in space {spaceId} only.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/gitbook:gitbook-space-content-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

gitbook-space-content-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitBook Space Content API
  description: The GitBook API
  termsOfService: https://policies.gitbook.com
  contact:
    name: API Support
    url: https://gitbook.com/support
    email: support@gitbook.com
  version: 0.0.1-beta
servers:
- url: '{host}/v1'
  variables:
    host:
      default: https://api.gitbook.com
security:
- user: []
- user-internal: []
- user-staff: []
- integration: []
- integration-installation: []
tags:


# --- truncated at 32 KB (176 KB total) ---
# Full source: https://artifacts.apis.io/gitbook/openapi/gitbook-space-content-api-openapi.yml