For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get a raw document from a space by its document ID

Returns the structured JSON document for a specific document ID within a space. Documents are the low-level block-based representation of page content. Use this when you have a documentId and need the raw block structure. To retrieve a page's document by pageId, use the page document endpoint instead.

Available in MCP
get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
spaceIdstringRequired

A unique entity identifier

Pattern: ^[a-zA-Z0-9_-]+$
documentIdstringRequired

ID of the document in the space

Query parameters
schemastring · enumOptional

Version of the schema used for the document.

Possible values:
Responses
200

Document

application/json
objectstring · enumRequiredPossible values:
get/spaces/{spaceId}/documents/{documentId}
GET /v1/spaces/{spaceId}/documents/{documentId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Document

{
  "object": "document",
  "data": {},
  "nodes": [
    {
      "object": "block",
      "type": "paragraph",
      "data": {},
      "nodes": [
        {
          "object": "text",
          "leaves": [
            {
              "object": "leaf",
              "text": "Hello world",
              "marks": []
            }
          ]
        }
      ]
    }
  ]
}

Last updated

Was this helpful?

Powered by GitBook