Document Upload
Add supporting documents to an expense or contract. The documents go through QI Tech analysis and are required for the expense submission.
You can include documents directly in the body of the expense creation — in that case, the expense already enters pending_adm_approval without having to call this endpoint separately.
invoice— Electronic invoice (NF-e)calculation_memory— Calculation memo or computation spreadsheetcontract— Contract of the service providedbank_slip— Bankslip
Document upload to an expense
Path params
| Parameter | Type | Description |
|---|---|---|
fund_class_key | string | Unique key of the fund (UUID) |
contract_key | string | Unique key of the contract |
expense_key | string | Unique key of the expense (UUID) |
{
"name": "NF-e 001234 - Auditoria jun/2026",
"document_type": "invoice",
"document_b64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwKL0xlbmd0aCAzIDAgUgo..."
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
name | string | required | Document name. Maximum of 255 characters. |
document_type | string | required | Document type: invoice, calculation_memory, contract or bank_slip. |
document_b64 | string | required | File content encoded in Base64. |
Response
{
"name": "NF-e 001234 - Auditoria jun/2026",
"expense_document_key": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
"expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
"document_type": "invoice",
"status": "pending_adm_approval"
}
Response attributes
| Field | Type | Description |
|---|---|---|
name | string | Document name. |
expense_document_key | string | Unique key of the document (UUID). |
expense_key | string | Key of the expense the document belongs to. |
document_type | string | Document type. |
status | string | Initial status of the document. Always returns pending_adm_approval. |
Document upload to a contract
Documents can also be linked directly to the contract (e.g. the contract of the service provided).
Path params
| Parameter | Type | Description |
|---|---|---|
fund_class_key | string | Unique key of the fund (UUID) |
contract_key | string | Unique key of the contract |
The body and the response attributes follow the same structure as the upload to an expense, with the contract_document_key and contract_key fields in place of expense_document_key and expense_key.
{
"name": "Contrato de Prestação de Serviços - Auditoria 2026",
"contract_document_key": "e5f6a7b8-c9d0-1234-ef56-7890abcdef12",
"contract_key": "contrato-auditoria-2026",
"document_type": "contract",
"status": "pending_adm_approval"
}
Query document by key
Retrieve the data of a document and access the file download link.
Expense document
{
"name": "NF-e 001234 - Auditoria jun/2026",
"expense_document_key": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
"expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
"document_type": "invoice",
"status": "approved",
"document_url": "https://storage.example.com/documents/NF-001234.pdf?X-Amz-Expires=3600&..."
}
| Field | Type | Description |
|---|---|---|
document_url | string | Pre-signed URL to download the file. Valid for a limited time. |
status | string | Document status: pending_adm_approval, approved or rejected. |
Possible errors
Expense not found
The set of keys in the URL does not correspond to any registered expense.
{
"title": "Expense Not Found",
"description": "Expense with key {expense_key} was not found.",
"translation": "A despesa com chave {expense_key} não foi encontrada.",
"code": "ESB000016"
}
Document not found
The provided document_key does not correspond to any document registered for this expense.
{
"title": "Document Not Found",
"description": "Document with key {document_key} was not found.",
"translation": "O documento com chave {document_key} não foi encontrado.",
"code": "ESB000015"
}
Invalid document format
The content in document_b64 is not valid Base64 or the file format is not supported.
{
"title": "Invalid Document Format",
"description": "The document format is invalid.",
"translation": "Formato do documento invalido.",
"code": "ESB000014"
}
Next steps
With at least one document in pending_adm_approval or approved, the expense is ready to be submitted:
Submit the expense — forward it for QI Tech analysis.