---
title: "Create Document with Creator Agent"
method: POST
path: "/document_generation/creator-agent-run"
tags: ["Document AI — DMS"]
---

# Create Document with Creator Agent

`POST /document_generation/creator-agent-run`

## Request

- Base URL: `https://api.paperoffice.ai/latest`
- URL: `https://api.paperoffice.ai/latest/document_generation/creator-agent-run`
- Auth: HTTP bearer

Create and store the document of a Creator Agent in the DMS.

## Request body

- object
  - `agent_id` string, required: Creator Agent ID.
  - `preview_token` string: Token from po_documents_creator_agent_preview (or from a NEEDS_INPUT / CONFIRMATION_REQUIRED response).
  - `confirm` boolean: Must be true to create the document. Only set after the user approved the preview.
  - `variables` object: Answers to questions or corrections; merged over the preview values.
  - `prompt` string: Direct run only: the request.
  - `workspace_id` integer: Target workspace (default: preview/agent configuration).
  - `title` string: Document title (placeholders allowed).
  - `ai_dms_tier` 'basic' | 'premium' | 'ultra': Classify the stored document with AI-DMS at this tier (billed separately).
  - `idempotency_key` string: Direct run in auto mode: retry-safe key. Ignored with preview_token (the token is the key).
  - `accept_open_questions` boolean: Create the document although blocking questions of the preview are unanswered (e.g. leave out an item without price). Only set after the user agreed.

## Response `200`

Success

- SuccessEnvelope: Success envelope. Payload fields are endpoint-specific (top-level fields, `result`/`job_result` for jobs, `data` on some account endpoints).
  - `status` 'success', required
  - `processing_time` union
    - string
    - number
  - `_billing` object

## Other responses

- `4XX`: Error
- `5XX`: Error

---

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