---
title: "Upload a file to a case"
method: POST
path: "/cases/{id}/files"
tags: ["Cases"]
---

# Upload a file to a case

`POST /cases/{id}/files`

## Request

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

Uploads a file and attaches it to a case. Mirrors the file upload action available in the Partner portal.

**Access:** Collection partners only. Managing partners are rejected.

**Status gate:** Allowed on all non-Merged statuses, including Closed. Only Merged cases are rejected.

**File requirements:**
- Maximum size: 25 MB
- Allowed extensions: `.pdf` `.doc` `.docx` `.xls` `.xlsx` `.jpg` `.jpeg` `.png` `.txt` `.zip` `.csv` `.eml`

**DocumentType (optional):**
Omit it when the type is unknown; the file is stored as not specified and returned as `null`.
Values are case-insensitive: OriginalInvoice, AccountStatement, Contract, TermsAndConditions,
ProofOfDelivery, DemandLetter, Correspondence, PaymentProof, CourtDocument, IdentityDocument, Miscellaneous.
Legacy names remain accepted for existing integrations: DebtorDocuments, CreditorDocuments, PartnerDocuments.
Unknown names, numeric values, and AutoGeneratedSummary are rejected with 400 and error InvalidDocumentType.

The file is immediately visible to the creditor.

## Path parameters

- `id` string, uuid, required

## Headers

- `Idempotency-Key` string

## Request body `multipart/form-data`

- object
  - `File` string, binary: The file to upload. Required. Allowed extensions: .pdf .doc .docx .xls .xlsx .jpg .jpeg .png .txt .zip .csv .eml Maximum size: 25 MB.
  - `DocumentType` string: Optional document type, case-insensitive. Omit (or pass null) 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".
  - `Description` string: Optional free-text description / label for the file (max 500 characters).

## Response `200`

File uploaded successfully

- DebituraWebExternalApiContractsV1FilesCaseFileDto
  - `id` string, uuid
  - `dateCreated` string, date-time
  - `dateUpdated` string, date-time
  - `caseId` string, uuid
  - `entityType` string, nullable
  - `entityId` string, uuid
  - `fileName` string, nullable
  - `url` string, nullable
  - `description` string, nullable
  - `documentType` string, nullable

## Other responses

- `400`: Invalid request — missing file, unsupported extension, or request validation error
- `404`: Case not found or not assigned to this collection partner
- `409`: Case is Merged and cannot accept new files
- `413`: File exceeds the 25 MB size limit
- `415`: Unsupported file extension
- `500`: Internal server error

## Changes

- **2026-09-20** `7a1c16414f83`: 1 breaking
  - for the `header` request parameter `Idempotency-Key`, the minLength was increased from `0` to `1`
- **2026-08-08** `fdce87e999c8`: 1 info
  - added the new optional `header` request parameter `Idempotency-Key`

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

---

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