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

# Upload a file to a managed case

`POST /managed-cases/{id}/files`

## Request

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

Uploads one ordinary case document to a case you submitted as managing partner.

**Access:** The authenticated partner must match the case's managing partner. This is separate from the collecting-partner upload route.

**Status gate:** Allowed on every lifecycle except Merged, including Closed.

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

**Optional fields:** `Description` is limited to 500 characters.

`DocumentType` is case-insensitive. Omit it when the type is unknown; the file is stored as not specified and returned as `null`.
Valid values: 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.

Use `Idempotency-Key` to retry safely. An identical replay returns the original response. Separate uploads with the same filename are stored independently and cannot overwrite one another.

## 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`: Missing file or invalid request
- `404`: Case not found or not managed by this partner
- `409`: Case is merged or idempotent request is in progress
- `413`: File exceeds 25 MB
- `415`: Unsupported file extension
- `422`: Idempotency-Key reused with a different request
- `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
  - endpoint added

[Operation history](https://skmtc.dev/debitura/apis/debitura-collection-partner-api/changes/managed-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)
