---
title: "Upload a file to contract"
method: POST
path: "/contracts/{contract_id}/documents"
tags: ["contractorHiring"]
---

# Upload a file to contract

`POST /contracts/{contract_id}/documents`

## Request

- Base URL: `https://api.letsdeel.com/rest`
- URL: `https://api.letsdeel.com/rest/contracts/{contract_id}/documents`
- Auth: HTTP bearer

Uploads a file and attaches it as a document to the specified contract by creating an amendment with the attachment. Only supported for ongoing_time_based, milestones, payg_tasks, time_based, pay_as_you_go_time_based, and eor contract types.

 **Token scopes**: `contracts:write`

## Path parameters

- `contract_id` string, required

## Request body `multipart/form-data`

- object
  - `file` string, binary: Upload the file you want to attach to this entry.

## Response `201`

Successful operation.

- ContractorHiringCreateContractDocumentResponse201
  - `data` ContractsContractIdDocumentsPostResponsesContentApplicationJsonSchemaData, nullable, required: This object is used for linking file attachments to your records.
    - `key` string, required: You can call attachments end-point, get key and URL to upload your file.
    - `filename` string, required: Original filename you used to upload using attachments end-point.

## Other responses

- `400`: The request could not be processed, for example because the contract type does not support attached documents.
- `401`: Operation failed.
- `403`: You do not have access to this contract.
- `404`: Operation failed.
- `500`: Operation failed.
- `502`: The contract could not be read. Nothing was uploaded; retry the request.

## Changes

- **2026-11-19** `4b1c2f4f52fc`: 2 warning, 2 info
  - removed the optional property `errors/items/path` from the response with the `403` status
  - removed the optional property `request` from the response with the `403` status
  - added the non-success response with the status `502`
  - added the optional property `errors/items/code` to the response with the `403` status
- **2026-11-17** `663ae7ae82ab`: 2 warning, 1 info
  - removed the optional property `errors/items/path` from the response with the `400` status
  - removed the optional property `request` from the response with the `400` status
  - added the optional property `errors/items/code` to the response with the `400` status

[Operation history](https://skmtc.dev/deel/apis/endpoints-2/changes/contracts/:contract_id/documents/post.md)

---

[API](https://skmtc.dev/deel/apis/endpoints-2.md) - [All operations](https://skmtc.dev/deel/apis/endpoints-2/llms.txt) - [OpenAPI document](https://skmtc.dev/deel/apis/endpoints-2/revisions/b48979ae8a04?raw)
