Skip to main content
POST
Automatically detect fillable regions in a document (or reuse a pre-defined template) and apply the values described in instructions. Persisted as an Edit resource, retrievable via GET /v1/edits/{edit_id}. Either document or template_id must be provided; they are mutually exclusive.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Public create-edit request body.

instructions
string
required

Instructions describing how to fill the form fields.

document
MIMEData · object | null

A file represented by its filename and a base64 data url.

template_id
string | null

EditTemplate id to fill. When provided, uses the template's pre-defined form fields and empty PDF. Mutually exclusive with document.

model
string
default:retab-small

The model to use for edit inference.

config
EditConfig · object

Edit configuration (rendering options).

bust_cache
boolean
default:false

If true, skip the LLM cache and force a fresh completion.

background
boolean
default:false

If true, run asynchronously: returns immediately with status 'queued' and an empty output. Poll GET /v1//{id} until status is terminal. Mutually exclusive with stream.

Response

Successful Response

An edit result: form-field values written onto a document or template PDF.

id
string
required

Unique identifier of the edit.

file
FileRef · object
required

Information about the source file (input document or template PDF).

model
string
required

Model used for the edit operation.

config
EditConfig · object
required

Configuration used for the edit operation.

instructions
string | null

Free-form instructions supplied with the edit request.

template_id
string | null

Template id used when the edit was created from a template; null for direct-document edits.

output
EditResult · object

The edit result: filled form fields and the rendered PDF. An empty sentinel until status == 'completed'; gate reads on status.

status
enum<string>
default:pending

Lifecycle status. The synchronous path returns 'completed'. Background runs progress pending -> queued -> in_progress -> completed | failed | cancelled.

Available options:
pending,
queued,
in_progress,
completed,
failed,
cancelled
error
PrimitiveError · object | null

Error details when a background run fails; null otherwise. Always present so consumers can read it without an existence check.

filled_document_ref
FileRef · object | null

Durable file reference for the filled document, when materialized.

usage
RetabUsage · object | null

Usage information for the edit operation.

created_at
string<date-time> | null