---
title: "Pages in a space"
method: GET
path: "/api/pages"
tags: ["pages"]
---

# Pages in a space

`GET /api/pages`

## Request

- Base URL: `https://telawiki.com`
- URL: `https://telawiki.com/api/pages`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `tela_session`

Flat by default (one level, filtered by `parent_id`), or the whole nested tree with `tree=1`. Bodies are **not** included — use `GET /api/pages/{id}` or `/api/pages/bodies`.

## Query parameters

- `space_id` integer, required
- `parent_id` string
- `tree` '1'

## Response `200`

Pages. Nodes carry `children` only in tree mode.

- object
  - `pages` PageNode[], required
    - `id` integer, required
    - `space_id` integer, required
    - `parent_id` integer, nullable, required
    - `title` string, required
    - `body` string, required: Canonical markdown. This is the whole document — tela has no block model.
    - `position` integer, required: Sort order among siblings.
    - `props` PageProps: Free-form page properties. Reserved keys are dropped. Two are load-bearing: `deck: true` makes the body a Slidev presentation, `sheet: true` makes it a spreadsheet — both are then stored verbatim, frontmatter included.
    - `created_at` string, required: `YYYY-MM-DD HH:MM:SS` in UTC.
    - `updated_at` string, required: `YYYY-MM-DD HH:MM:SS` in UTC.
    - `version` integer: Advances on every title/body/props change. Send it back as `base_version` on update to refuse overwriting an edit you haven't seen.
    - `status` 'draft' | 'published': A `draft` is labelled in the app and never served on public spaces or share links until published.
    - `exposure` Exposure, required: How far outside the space this page is readable.
      - `state` 'private' | 'public' | 'password', required: `public` = reachable with no credential; `password` = reachable with a share password.
      - `inherited` boolean, required: True when the exposure comes from an ancestor's subtree share rather than this page.
      - `expires_at` string, nullable, required
    - `children` PageNode[]: Present only in tree mode (`?tree=1`).

## Other responses

- `400`: `invalid_query` — `space_id` missing or malformed, or a bad `parent_id`.
- `403`: `forbidden` (no access, or the role is too low), `viewer_no_write`, `api_key_scope` (the token's scope forbids this method), or `api_key_space_scope` (the token is pinned to another space).
- `404`: `space_not_found`.
- `500`: `internal` — server error.

---

[API](https://skmtc.dev/telawiki/apis/tela-rest-api.md) · [All operations](https://skmtc.dev/telawiki/apis/tela-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telawiki/apis/tela-rest-api/revisions/f316f31f6fcb?raw)
