---
title: "List documents"
method: POST
path: "/api/v1/list_documents"
---

# List documents

`POST /api/v1/list_documents`

## Request

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

List documents you can access through any membership — owned and shared with you. your_role on each result tells you whether you can write before you try. Never includes content; use get_document.

## Request body

- object
  - `query` string: Filter to documents whose title contains this text (case-insensitive).
  - `visibility` 'public' | 'private': Filter to public or private documents.
  - `role` 'owner' | 'editor' | 'commenter' | 'viewer': Filter to documents where you have this role.
  - `owned_by_me` boolean: Only documents you own.
  - `project` string: Filter to one project (name or id). Names resolve against your own projects.
  - `limit` integer: Maximum results to return (default 20, at most 50).
  - `cursor` string: The next_cursor from a previous call, to fetch the next page.

## Response `200`

Success.

- object
  - `documents` object[], required
    - `id` string, required
    - `slug` string, required
    - `title` string, required
    - `url` string, required: Absolute URL of the document's page.
    - `revision` integer, required
    - `your_role` 'owner' | 'editor' | 'commenter' | 'viewer', required: Your role on the document or project.
    - `owner_handle` string, required
    - `visibility` 'public' | 'private', required
    - `project` string, required
    - `directory_path` string, nullable, required: Directory path inside the project; null at the project root.
    - `updated_at` string, required: ISO 8601 timestamp.
    - `bytes` integer, required
  - `next_cursor` string, nullable, required: Pass as cursor to get the next page; null on the last page.

## 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)
