Skip to main content
PATCH
Write fields or send the file

Authorizations

Authorization
string
header
required

The API key of the organization, in the Authorization: Bearer <key> header. The key starts with qx_.

Headers

Idempotency-Key
string

A unique value that your system creates for each write, such as a UUID. A repeated call with the same value and the same content gets the first response, and the API writes nothing new. The API keeps the response for 24 hours.

Required string length: 1 - 255

Path Parameters

id
string
required

The id of the document. The id starts with doc_.

Body

fields
object
required

The field answers, in the { "key": value } format, with at least one key. The key is the key of a field in GET /documents/{id}. The value has the shape of the value of that field, and null erases the answer.

Example:

Response

The document, with the fields.

A document, with the fields.

id
string
required

The id of the document.

Pattern: ^doc_[1-9][0-9]*$
Example:

"doc_310"

document_type
object
required
status
enum<string>
required

The progress of the document. pending: the document waits for the upload. uploaded: the document arrived and waits for the review. approved: the operator approved the document. rejected: the operator rejected the document.

Available options:
pending,
uploaded,
approved,
rejected
reading_status
enum<string>
required

The progress of the reading of the document. not_started: the reading did not start. extracting, enriching and validating: the reading is in progress. complete: the reading ended. failed: the reading failed. no_reader: the document type has no reading.

Available options:
not_started,
extracting,
enriching,
validating,
complete,
failed,
no_reader
contact
object | null
required

The contact of the document. The value is null when the document has no contact.

collection_id
string | null
required

The id of the collection of the document. The value is null while the document is in Triage.

Pattern: ^col_[1-9][0-9]*$
Example:

"col_40"

in_triage
boolean
required

With true, the document is in Triage and has no collection yet.

discarded
boolean
required

With true, the document is discarded.

discard_reason
enum<string> | null
required

The reason for the discard. The value is null on a document that is not discarded. outside_pack: no active operation pack asks for the type of the document. identical_copy: the document repeats the file of another document. superseded: a newer document replaced this document. operator: the operator discarded the document. replaced: a file swap created a new document, and this document stayed as the previous version.

Available options:
outside_pack,
identical_copy,
superseded,
operator,
replaced,
null
replaced_by
string | null
required

In the previous version of a file swap, the id of the current document. The current document is the last document in the chain of file swaps. On the other documents, the value is null.

Pattern: ^doc_[1-9][0-9]*$
Example:

"doc_325"

number
string | null
required

The printed number that identifies the document, such as the invoice number. The value is null before the reading.

Example:

"INV-81244/2026"

arrival_channel
enum<string> | null
required

The arrival channel of the file. The value is null on an empty slot. email: the file arrived by email. portal_upload: the client sent the file on the portal. operator_upload: the operator sent the file on the QX screen. spreadsheet: the file came from a spreadsheet. vault: the client reused a file from the Vault on the portal. api: the file arrived through the API.

Available options:
email,
portal_upload,
operator_upload,
spreadsheet,
vault,
api,
null
arrived_at
string<date-time> | null
required

The date and the time when the file arrived, in the time zone of the organization. The value is null on an empty slot.

files
object[]
required

The files of the document. On an empty slot, the list is empty.

created_at
string<date-time>
required

The date and the time of the creation, in the time zone of the organization.

Example:

"2026-09-25T10:30:00.000-03:00"

fields
object[]
required

The fields of the document type, in the catalog order, without the file fields. A field without an answer has value equal to null.