# Create new document version

> `POST /documents/document-put` · Section: Document AI — DMS · PaperOffice AI API, release `R20261020.1746`.

`POST https://api.paperoffice.ai/latest/documents/document-put`

## Overview

Versioning is an AI-DMS feature (402 VERSIONING_REQUIRES_AI_DMS unless the source has basic, premium or ultra). Create the next version via multipart document-put (UploadFiles[]) with version_of_pofid. Own pofid, version n+1; the predecessor stays unchanged. Omit processing_mode to inherit the predecessor tier; processing_mode=no_ai_dms is not allowed. A higher ai_dms_tier is allowed; a lower tier returns HTTP 400 VERSION_TIER_DOWNGRADE. The file must be AI-DMS-processable. If the AI-DMS prepaid order is refused, no version is created (same 402).

**API reference:** `po-documents-versions-create` (documentation ID; not a `/job/add/` pipeline slug)

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `version_of_pofid` | string | Yes | POFID of the existing document (any version of the line). The source must have an AI-DMS tier (basic, premium or ultra); otherwise HTTP 402 VERSIONING_REQUIRES_AI_DMS. |
| `version_comment` | string | No | What changed (human note, immutable). Required when the predecessor is revision-secure (WORM). |
| `workspace_id` | integer | Yes | Workspace of the document line (must match the predecessor). |
| `processing_mode` | string | No | Omit to inherit the predecessor AI-DMS tier. Versions always run on AI-DMS. auto and ai_dms are equivalent here. no_ai_dms is not accepted (HTTP 402 VERSIONING_REQUIRES_AI_DMS). (allowed: auto, ai_dms) |
| `ai_dms_tier` | string | No | Raise the AI-DMS tier of the document line with this version. Omit to inherit. Equal or higher than the predecessor; lower is rejected with HTTP 400 VERSION_TIER_DOWNGRADE. (allowed: basic, premium, ultra) |
| `processing_lane` | string | No | Start-SLA lane for AI-DMS processing of the new version. Omit to inherit the workspace default. (allowed: no_sla, sla_24h, sla_12h, sla_6h, sla_1h, instant) |

**Request body:** `multipart/form-data` or `application/x-www-form-urlencoded` unless noted otherwise.

## Responses

Returns JSON with `status: "success"`; key fields: `results[]` with per-file `pofid` (not a top-level `pofid`); `results[].ai_dms` (accepted order) or `results[].ai_dms_billing` (refused, file still stored) and top-level `ai_dms_refused_count`. Optional `_billing` and `processing_time`. Errors: HTTP 4xx/5xx with `status: "error"`, `code`, and `message`.

## Essentials (all endpoints)

- **Base URL:** `https://api.paperoffice.ai/latest` · **Auth:** `Authorization: Bearer po_sk_…` or `po_ut_…` (server-side only); browser code uses `po_pk_…` with an allowlisted `Origin`. No Bearer at all on a product API returns HTTP 403 `TIER_RESTRICTED`.
- **Errors:** HTTP 4xx/5xx with `status: "error"`, `code` and `message`. Retry 429 (`Retry-After`) and 5xx with exponential backoff; do not retry validation errors.
- **Jobs:** `client_wait=true` (default) holds the connection. HTTP 202 means the job is still running — poll `GET /job/get/{job_id}` every 5–10 s until `job_status` is `completed`, then read `result ?? job_result`. `processing_lane` sets the Start-SLA; legacy `priority` is not part of the public contract.
- **Billing:** every billable product call costs at least 5 credits; read `_billing.job.credits_billed` on billed responses.
- **Mutations** use `POST` with action paths (e.g. `POST /documents/document-delete`), not HTTP `DELETE`.

---

All endpoints: [llms.txt](https://api.paperoffice.ai/latest/docs/llms.txt) · Everything in one file: [llms-full.txt](https://api.paperoffice.ai/latest/docs/llms-full.txt) · [OpenAPI 3.1](https://api.paperoffice.ai/latest/docs/openapi.json) · This page: https://api.paperoffice.ai/latest/docs/endpoints/po-documents-versions-create.md

*Generated 2026-10-20 from live API documentation (release `R20261020.1746`).*
