---
title: Pages & Content API
description: "Read and write documentation content programmatically — the API behind the web editor."
---

# Pages & Content API

These endpoints power the [web editor](/platform/web-editor) and let you read and write documentation content programmatically. All require [authentication](/api-reference/authentication). All paths are relative to `/v1/projects/{projectId}`.

## List Pages

<Endpoint method="GET" path="/v1/projects/{projectId}/pages" />

Returns the project's page tree (paths, titles, last modified).

## Get Page Content

<Endpoint method="GET" path="/v1/projects/{projectId}/pages/{path}/content" />

Returns the raw MDX source of a page. URL-encode the path (e.g. `guides%2Fquickstart`).

```json
{
  "data": {
    "path": "guides/quickstart",
    "content": "---\ntitle: Quickstart\n---\n\n# Quickstart\n...",
    "version": "a1b2c3"
  }
}
```

## Update Page Content

<Endpoint method="PUT" path="/v1/projects/{projectId}/pages/{path}/content" />

<ParamField body="content" type="string" required>The full MDX source.</ParamField>
<ParamField body="version" type="string">The version you read. If the page changed since, the API returns `409 Conflict` — re-read and merge.</ParamField>

## Batch Save

<Endpoint method="POST" path="/v1/projects/{projectId}/pages/save" />

Save multiple pages in one transaction — preferred for multi-file edits.

<ParamField body="files" type="array" required>
  Array of `{ path, content }` objects.
</ParamField>

## Lint a Page

<Endpoint method="POST" path="/v1/projects/{projectId}/pages/{path}/lint" />

Runs the project's [style rules](/platform/collaboration) against supplied content and returns violations without saving.

## Preview a Page

<Endpoint method="POST" path="/v1/projects/{projectId}/pages/{path}/preview" />

Compiles supplied MDX and returns rendered HTML — used for live preview in the editor.

## Request a Review

<Endpoint method="POST" path="/v1/projects/{projectId}/reviews" />

Creates a review request for pending changes — see [Collaboration](/api-reference/collaboration/overview).

## Conflict Handling

Content writes are optimistic-concurrency controlled. On `409`:

```json
{
  "error": {
    "code": "conflict",
    "message": "Page was modified since you loaded it",
    "details": { "paths": ["guides/quickstart"] }
  }
}
```

Re-fetch the page, merge your changes, and retry.

<Warning>
Edits made through this API apply to the project's managed content. If your docs are synced from a git repo, prefer committing to the repo — repo pushes are the source of truth and will trigger rebuilds.
</Warning>
