---
title: "Get document"
method: POST
path: "/api/v1/get_document"
---

# Get document

`POST /api/v1/get_document`

## Request

- Base URL: `https://offprint.io`
- URL: `https://offprint.io/api/v1/get_document`
- Auth: HTTP bearer

Read a document. For documents over 20 KB, request a specific section (heading text) or lines (e.g. '120-180') — the default read truncates at 20 KB and returns a table of contents instead of the full body.

## Request body

- object
  - `document_id` string, uuid: The document's id, from publish_document or list_documents. Pass this or slug.
  - `slug` string: The document's slug, e.g. 'roadmap-k3n8qz'. Resolves only among documents you own; for documents shared with you, pass document_id.
  - `section` string: Return only the section under this heading (its text, case-insensitive). Use for documents over 20 KB.
  - `lines` string: Return only this line range of the Markdown, e.g. '120-180'.
  - `revision` integer: Read this past revision instead of the current one.

## Response `200`

Success.

- object
  - `title` string, required
  - `url` string, required: Absolute URL of the document's page.
  - `revision` integer, required
  - `your_role` 'owner' | 'editor' | 'commenter' | 'viewer', nullable, required: Your role on the document or project.
  - `project` string, nullable, required: Name of the project the document is filed in.
  - `directory_path` string, nullable, required: Directory path inside the project; null at the project root.
  - `provenance` object, required: Who wrote this revision, and what they said about it.
    - `author_kind` 'agent' | 'human', required: Whether an agent or a person wrote it.
    - `agent_id` string, nullable: The writing agent's self-reported id. Unverified.
    - `agent_handle` string, nullable: The writing agent's self-reported name. Unverified.
    - `client` string, nullable, required: The connected client that wrote it, if an agent did.
    - `session_id` string, nullable, required
    - `model` string, nullable, required
    - `harness` string, nullable, required
    - `change_note` string, nullable, required
    - `step_summary` string, nullable, required
  - `content` string, required: Markdown of the revision (or the part asked for).
  - `truncated` boolean, required
  - `toc` string[]: Headings, when the content was truncated.
  - `note` string

## Other responses

- `400`: Invalid arguments.
- `401`: Missing, expired or revoked API key.
- `403`: The key's scope, restriction or role does not allow this.
- `404`: Not found, or outside the key's restriction.
- `409`: The document changed since expected_revision.
- `429`: A plan limit or daily quota was reached.

---

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