Skip to main content

Contract attachments

Attachments are supplementary files of the contract, such as the commercial proposal or the signed termination agreement. They do not go through automated reading. The contract must be in pending_submission, active or expired.

To add an attachment:

  1. Create the attachment.
  2. Get the attachment upload URL.
  3. Upload the file straight to that URL.

To download the file, use attachments[].download_url in the contract retrieval.

Create attachment​

Available on
ProfileHostRequired permission
Managermanager-apiWrite
Consultantconsultant-apiCreate Expense Contracts

Base URL for each host: Environments (Hosts).

ENDPOINT
/expense_contract/fund_class/{fund_class_key}/contract/{contract_key}/attachment
METHOD
POST

Path parameters​

ParameterTypeDescription
fund_class_keystringFund class key (UUID).
contract_keystringContract key (UUID).

This call has no body.

Response​

STATUS
201
Response body
{
"attachment_key": "d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a",
"status": "active",
"created_at": "2026-11-09T14:20:11.004512"
}
FieldTypeDescription
attachment_keystringAttachment key (UUID).
statusstringactive from creation; canceled after cancellation.
created_atstringCreation, ISO 8601 without a time zone.

Get attachment upload URL​

ENDPOINT
/expense_contract/fund_class/{fund_class_key}/contract/{contract_key}/attachment/{attachment_key}/upload_url
METHOD
GET

Permission: Manager (manager-api): Write. Consultant (consultant-api): Create Expense Contracts.

Path parameters​

ParameterTypeDescription
fund_class_keystringFund class key (UUID).
contract_keystringContract key (UUID).
attachment_keystringAttachment key (UUID).

Response​

STATUS
200
Response body
{
"attachment_key": "d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a",
"status": "active",
"created_at": "2026-11-09T14:20:11.004512",
"upload_url": {
"url": "https://<link-temporario-de-envio>",
"fields": {
"key": "3f2b8c1e-7d4a-4e9b-9a61-0c5d2e8f4b17/d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a",
"policy": "<policy>",
"x-amz-algorithm": "AWS4-HMAC-SHA256",
"x-amz-credential": "<credential>",
"x-amz-date": "20261109T142100Z",
"x-amz-signature": "<signature>"
}
}
}

Upload the file as for the contract document: POST multipart/form-data to upload_url.url, with all the fields from upload_url.fields and the file in the file field. The URL expires in 3 minutes and accepts files up to 50 MB.

A new upload replaces the attachment's file. There is no confirmation call.

Cancel attachment​

Marks the attachment as canceled. Canceling an already canceled attachment has no effect.

ENDPOINT
/expense_contract/fund_class/{fund_class_key}/contract/{contract_key}/attachment/{attachment_key}
METHOD
DELETE

Permission: Manager (manager-api): Write. Consultant (consultant-api): Update Expense Contracts.

Path parameters​

ParameterTypeDescription
fund_class_keystringFund class key (UUID).
contract_keystringContract key (UUID).
attachment_keystringAttachment key (UUID).

Response​

STATUS
204

No response body.

Errors​

StatuscodeWhen it happens
404ECT000005The fund class does not exist or you do not have access to it.
404ECT000009The contract does not exist in this fund class.
404ECT000050The attachment does not exist in this contract.
409ECT000048The contract is not in pending_submission, active or expired.
Example
{
"title": "Attachment not allowed",
"description": "Attachments are not handled on a contract in status canceled.",
"translation": "Anexos nao sao tratados num contrato com status canceled.",
"code": "ECT000048"
}

Authentication, permission and host errors: see API Errors.