---
title: "Upload a file to a case. Optionally posts a system chat message to notify the collection partner."
method: POST
path: "/cases/{caseId}/files"
tags: ["Cases"]
---

# Upload a file to a case. Optionally posts a system chat message to notify the collection partner.

`POST /cases/{caseId}/files`

## Request

- Base URL: `https://referral-api.debitura.com`
- URL: `https://referral-api.debitura.com/cases/{caseId}/files`
- Auth: API key in header `XApiKey`

Uploads a file and associates it with a case owned by one of the referral partner's clients.

File requirements:
- Maximum file size: 25 MB
- Allowed types: PDF, Excel (.xls, .xlsx), CSV, Text (.txt), Images (.jpg, .jpeg, .png, .gif)

documentType (optional form field, case-insensitive) says what the document is. Omit it when you do not know it;
the file is then stored as not specified. Valid values: OriginalInvoice, AccountStatement, Contract, TermsAndConditions,
ProofOfDelivery, DemandLetter, Correspondence, PaymentProof, CourtDocument, IdentityDocument, Miscellaneous.
Still accepted for existing integrations: DebtorDocuments, CreditorDocuments, PartnerDocuments.
Any other value is rejected with 400 and error InvalidDocumentType.

When sendChatNotification is true (default), a system message is posted on the case chat
to notify the collection partner that a new file was uploaded.

## Path parameters

- `caseId` string, uuid, required

## Query parameters

- `sendChatNotification` boolean

## Headers

- `Idempotency-Key` string

## Request body `multipart/form-data`

- object
  - `file` string, binary
  - `documentType` string

## Response `200`

File uploaded successfully

## Other responses

- `400`: Validation error
- `404`: Case not found
- `413`: File too large
- `415`: Unsupported file type
- `500`: Internal server error

## Changes

- **2026-10-01** `739ec0889478`: 1 info
  - added the new optional request property `documentType`
- **2026-09-04** `98a930b13785`: 1 breaking
  - for the `header` request parameter `Idempotency-Key`, the minLength was increased from `0` to `1`

[Operation history](https://skmtc.dev/debitura/apis/debitura-referral-partner-api/changes/cases/:caseId/files/post.md)

---

[API](https://skmtc.dev/debitura/apis/debitura-referral-partner-api.md) - [All operations](https://skmtc.dev/debitura/apis/debitura-referral-partner-api/llms.txt) - [OpenAPI document](https://skmtc.dev/debitura/apis/debitura-referral-partner-api/revisions/cf12c7f270d9?raw)
