---
title: "Save a document (ordered pages; a preset_id page is copied in)"
method: POST
path: "/documents"
---

# Save a document (ordered pages; a preset_id page is copied in)

`POST /documents`

## Request

- Base URL: `https://rendry.io/api/v1`
- URL: `https://rendry.io/api/v1/documents`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Up to 20 pages, each {preset_id} or its own {canvas, layers, modifications, …}. The reply is the STORED document: a page sent as preset_id comes back as the copied canvas and layers, so the reply carries no preset_id. Alternatively pass {template_id, name?} for a kind:document starter from GET /templates. Its complete pages, shared master and samples are copied into an owned document; no catalogue dependency is saved.

## Headers

- `X-Rendry-Account` string

## Request body

- union: Create with authored content, or copy one complete document starter. template_id is request-only; it cannot be combined with pages, master, id or document_id.
  - DocumentTemplate: A stored document as POST, GET and PUT /documents/{id} return it. Pages carry their own content: a page sent as {preset_id} is copied in at save time (see DocumentPageRef). GET /documents lists DocumentOverview rows instead, where `pages` is a count.
    - `id` string
    - `user_id` string
    - `name` string, required
    - `pages` DocumentPageRef[], required (unresolved $ref)
    - `master` object[]: Layers under EVERY page: logo, footer, page number ({page}/{pages} are filled in)
  - object
    - `template_id` string, required: A kind:document ID from GET /templates
    - `name` string: Optional owned-copy name; defaults to the starter name

## Response `201`

Created

- DocumentTemplate: A stored document as POST, GET and PUT /documents/{id} return it. Pages carry their own content: a page sent as {preset_id} is copied in at save time (see DocumentPageRef). GET /documents lists DocumentOverview rows instead, where `pages` is a count.
  - `id` string
  - `user_id` string
  - `name` string, required
  - `pages` DocumentPageRef[], required (unresolved $ref)
  - `master` object[]: Layers under EVERY page: logo, footer, page number ({page}/{pages} are filled in)

## Other responses

- `400`: Validation error
- `401`: Missing/invalid API key
- `403`: A read-only API key, or `document_limit_exceeded`: the account holds the most documents it may keep. The body carries used, limit, freeable (the oldest documents, {id, name}) and free_with (delete_document; DELETE /documents/{id} over REST). The cap is fixed, not a plan's.

---

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