curl --request POST \
--url https://app.useqx.com/api/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form contact_id=com_12 \
--form document_type_id=dtp_31 \
--form collection_id=col_40 \
--form external_id=CAMBIO-2026-0042{
"id": "doc_318",
"document_type": {
"id": "dtp_31",
"name": "Fatura Comercial (Commercial Invoice)"
},
"status": "uploaded",
"reading": {
"state": "extracting",
"finished_at": null,
"refusal": null
},
"contact": {
"id": "com_12",
"type": "company",
"name": "Importadora Exemplo Ltda"
},
"collection_id": "col_40",
"in_triage": false,
"discarded": false,
"discard_reason": null,
"replaced_by": null,
"number": null,
"external_id": "CAMBIO-2026-0042",
"arrival_channel": "api",
"arrived_at": "2026-09-25T10:32:05.000-03:00",
"files": [
{
"name": "fatura.pdf",
"content_type": "application/pdf",
"size": 182044
}
],
"created_at": "2026-09-25T10:32:05.000-03:00",
"has_problem": false,
"reading_rules": [],
"fields": [
{
"key": "invoice_number",
"label": "Número da Fatura",
"raw_value": null,
"value": null,
"value_type": "text",
"source": null
},
{
"key": "invoice_date",
"label": "Data da Fatura",
"raw_value": null,
"value": null,
"value_type": "date",
"source": null
},
{
"key": "exporter_name",
"label": "Exportador (Vendedor)",
"raw_value": null,
"value": null,
"value_type": "text",
"source": null
},
{
"key": "invoice_amount",
"label": "Valor da Fatura",
"raw_value": null,
"value": null,
"value_type": "money",
"source": null
},
{
"key": "currency",
"label": "Moeda",
"raw_value": null,
"value": null,
"value_type": "text",
"source": null
},
{
"key": "incoterm",
"label": "Incoterm",
"raw_value": null,
"value": null,
"value_type": "text",
"source": null
},
{
"key": "line_items",
"label": "Itens da Fatura",
"raw_value": null,
"value": null,
"value_type": "table",
"source": null,
"complete": true
}
]
}Send a document
Sends the file of a document, with the contact and the document type. A call carries one file, and the file becomes one document. Without collection_id, the document goes to Triage, like a document that arrives by email. The reading starts, and the routing looks for a collection for the document when the reading ends. A document that the routing does not put in a collection waits in Triage. With collection_id, the document fills the empty slot of its type in the collection, and the reading starts. When every required document of the collection arrives, the collection moves to reviewing, and QX notifies the operators. The external_id keeps a value of the system of the organization, such as the number of the exchange operation. GET /documents?external_id= finds the documents by the value later. The answer comes before the end of the reading. The Location header carries the path of the document, and GET /documents/{id} reads the fields after the reading. The call counts toward the paid write limit of the key.
curl --request POST \
--url https://app.useqx.com/api/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form contact_id=com_12 \
--form document_type_id=dtp_31 \
--form collection_id=col_40 \
--form external_id=CAMBIO-2026-0042{
"id": "doc_318",
"document_type": {
"id": "dtp_31",
"name": "Fatura Comercial (Commercial Invoice)"
},
"status": "uploaded",
"reading": {
"state": "extracting",
"finished_at": null,
"refusal": null
},
"contact": {
"id": "com_12",
"type": "company",
"name": "Importadora Exemplo Ltda"
},
"collection_id": "col_40",
"in_triage": false,
"discarded": false,
"discard_reason": null,
"replaced_by": null,
"number": null,
"external_id": "CAMBIO-2026-0042",
"arrival_channel": "api",
"arrived_at": "2026-09-25T10:32:05.000-03:00",
"files": [
{
"name": "fatura.pdf",
"content_type": "application/pdf",
"size": 182044
}
],
"created_at": "2026-09-25T10:32:05.000-03:00",
"has_problem": false,
"reading_rules": [],
"fields": [
{
"key": "invoice_number",
"label": "Número da Fatura",
"raw_value": null,
"value": null,
"value_type": "text",
"source": null
},
{
"key": "invoice_date",
"label": "Data da Fatura",
"raw_value": null,
"value": null,
"value_type": "date",
"source": null
},
{
"key": "exporter_name",
"label": "Exportador (Vendedor)",
"raw_value": null,
"value": null,
"value_type": "text",
"source": null
},
{
"key": "invoice_amount",
"label": "Valor da Fatura",
"raw_value": null,
"value": null,
"value_type": "money",
"source": null
},
{
"key": "currency",
"label": "Moeda",
"raw_value": null,
"value": null,
"value_type": "text",
"source": null
},
{
"key": "incoterm",
"label": "Incoterm",
"raw_value": null,
"value": null,
"value_type": "text",
"source": null
},
{
"key": "line_items",
"label": "Itens da Fatura",
"raw_value": null,
"value": null,
"value_type": "table",
"source": null,
"complete": true
}
]
}Authorizations
Headers
Body
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.
1 - 128\S"CAMBIO-2026-0042"
Response
The new document, with the fields. The Location header carries the path of the document.
A document, with the fields.
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.
pending, uploaded, approved, rejected 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.
outside_pack, identical_copy, superseded, operator, replaced, null 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.
email, portal_upload, operator_upload, spreadsheet, vault, api, null 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.