Skip to main content
POST

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

Body

multipart/form-data
file
file
required

The file of the document, up to 25 MB. QX accepts PDF, JPEG, PNG, TIFF, TXT, XLS, XLSX and XML. A type without a file field accepts only PDF, JPEG and PNG, up to 10 MB.

document_type_id
string
required

The id of the document type. GET /packs lists the types that each pack asks for.

Example:

"dtp_31"

contact_id
string

The id of the contact of the document. Send the contact_id or the tax_id, only one of the two.

Example:

"com_12"

tax_id
string

The CPF or the CNPJ of the contact of the document, with or without punctuation. Send the contact_id or the tax_id, only one of the two.

Example:

"12.345.678/0001-95"

collection_id
string

The id of an open collection of the same contact. Without this field, the document goes to Triage.

Example:

"col_40"

external_id
string

The external id: a value of the system of the organization, such as the number of the exchange operation, up to 128 characters. QX keeps the value as it came and returns it in external_id. The same value can go with many uploads, such as the documents of one exchange operation.

Required string length: 1 - 128
Pattern: \S
Example:

"CAMBIO-2026-0042"

Response

The new document, with the fields. The Location header carries the path of the document.

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
object
required

The reading of the document.

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"

external_id
string | null
required

The external id that the system of the organization sent with the upload through the API. The new document of a file swap keeps the value of the upload. The value is null on a document that arrived without it.

Example:

"CAMBIO-2026-0042"

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"

has_problem
boolean
required

With true, the document is a document with a problem. In a collection, the reading refused the file, or a blocking validation or a reading rule failed. In Triage, the Triage rule applies: the blocking validations and the reading rules of the message of the document. In Triage, the refused reading stays out. While the reading is in progress, the field leaves out the refusal and the reading rules. The field also leaves out the reading rules that only the team or only the operator sees.

reading_rules
object[]
required

The reading rules of the document that the client sees in the portal, with the sentence of the portal. The list leaves out the rules that only the team or only the operator sees.

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.