Syntext DOCS
Get Started
API Pages & Content API

Pages & Content API

These endpoints power the web editor and let you read and write documentation content programmatically. All require authentication. All paths are relative to /v1/projects/{projectId}.

List Pages

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

Get Page Content

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

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

Update Page Content

The full MDX source. The version you read. If the page changed since, the API returns 409 Conflict — re-read and merge.

Batch Save

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

Array of { path, content } objects.

Lint a Page

Runs the project's style rules against supplied content and returns violations without saving.

Preview a Page

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

Request a Review

Creates a review request for pending changes — see Collaboration.

Conflict Handling

Content writes are optimistic-concurrency controlled. On 409:

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

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

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.

Assistant
Responses are generated using AI and may contain mistakes.

Ask me anything about the documentation.

ESC