List all pages in a space with their hierarchy and metadata

Returns the complete list of all pages in a space's current revision, including their titles, URL paths, and parent-child relationships. Use this to understand the full content structure of a space or build navigation. For the content of a single page, use getPageById or getPageByPath instead. With tag, the hierarchy is narrowed to the document pages with any of those tags, plus the pages above them.

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_-]+$
Query parameters
metadatabooleanOptional

If false is passed, "git" mutable metadata will not returned. Passing false can optimize performances of the lookup.

Default: true
computedbooleanOptional

If false is passed, content will not be computed

Default: true
tagstring[] · min: 1Optional

Narrow the page hierarchy to the document pages tagged with any of these tag or category slugs (OR), plus the pages above them. Repeat the parameter for several slugs. A tag or category also matches pages tagged with anything nested below it; categories never match through direct page assignments. Hidden pages are left out when filtering, and unknown slugs match nothing.

Responses
200

OK

application/json
get/spaces/{spaceId}/content/pages
GET /v1/spaces/{spaceId}/content/pages HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "pages": [
    {
      "id": "text",
      "title": "text",
      "linkTitle": "text",
      "emoji": "🎉",
      "icon": "gear",
      "createdAt": "2026-01-01T00:00:00.000Z",
      "updatedAt": "2026-01-01T00:00:00.000Z",
      "condition": "text",
      "markdown": "# Hello World\n\nThis is a markdown document linking to [another page](/pages/page_id).\n",
      "type": "document",
      "urls": {
        "app": "https://example.com"
      },
      "slug": "text",
      "path": "text",
      "description": "text",
      "tagTitle": "text",
      "pages": [
        "[Circular Reference]"
      ],
      "git": {
        "oid": "text",
        "path": "text"
      },
      "layout": {
        "width": "default",
        "cover": true,
        "coverSize": "hero",
        "coverMask": "none",
        "title": true,
        "description": true,
        "tableOfContents": true,
        "outline": true,
        "pagination": true,
        "metadata": true,
        "tags": true,
        "actions": true,
        "anchors": true
      },
      "cover": {
        "ref": {
          "kind": "file",
          "file": "text",
          "space": "text"
        },
        "refDark": {
          "kind": "file",
          "file": "text",
          "space": "text"
        },
        "textColor": "black",
        "textColorDark": "black",
        "yPos": 0,
        "height": 240
      },
      "variables": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      },
      "hidden": false,
      "noIndex": false,
      "noRobotsIndex": false,
      "metaLinks": {
        "canonical": {
          "kind": "page",
          "page": "text",
          "space": "text"
        },
        "alternates": [
          {
            "kind": "page",
            "page": "text",
            "space": "text"
          }
        ]
      },
      "tags": [
        {
          "tag": {
            "kind": "tag",
            "tag": "text",
            "space": "text"
          },
          "primary": true
        }
      ],
      "computed": {
        "type": "builtin:openapi",
        "dependencies": {
          "spec": {
            "ref": {
              "kind": "openapi",
              "spec": "text"
            }
          }
        },
        "props": {
          "doc": "models"
        }
      },
      "computedSeed": "text"
    }
  ]
}

Last updated

Was this helpful?

Powered by GitBook