---
title: "Send a chat message on a case"
method: POST
path: "/cases/{id}/chats"
tags: ["Cases"]
---

# Send a chat message on a case

`POST /cases/{id}/chats`

## Request

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

Posts a new chat message on a case, visible to both the collection partner and the creditor.

**Message Details:**
- The message is attributed to the team member identified by `userId`
- The creditor will receive an email notification about the new message
- A task is created in the Debitura platform for the creditor to review the message
- Messages appear in the case chat timeline in chronological order

**Prerequisites:**
- The case must exist and be assigned to you as collection partner
- The case must have passed Debitura approval and contract signing
- For a test or demo managed case, the managing partner may save case context during review
- The `userId` must be a valid user ID from `GET /users` belonging to your team

**Use Case:**
Use this endpoint to communicate with creditors about case progress, request additional information, or provide status updates. Messages sent via this endpoint are equivalent to messages sent through the partner portal chat.

## Path parameters

- `id` string, uuid, required

## Headers

- `Idempotency-Key` string

## Request body

- DebituraWebExternalApiContractsV1ChatsSendChatRequest: Request to send a chat message on a case.
  - `message` string, required: The chat message content to send.
  - `userId` string, uuid, nullable: ID of the team member sending this message. Must be a valid user ID from GET /users belonging to your team. Deprecated: use UserEmail instead. At least one of UserId or UserEmail must be provided.
  - `userEmail` string, email, nullable: Email address of the team member sending this message. Must correspond to an active member of your team (same account as the API key). Preferred over UserId. At least one of UserEmail or UserId must be provided.

## Response `200`

Chat message sent successfully (or duplicate idempotency key — existing response returned)

- DebituraWebExternalApiContractsV1ChatsChatDto
  - `id` string, uuid
  - `dateCreated` string, date-time
  - `dateUpdated` string, date-time, nullable
  - `role` 0 | 1 | 2: Deprecated: kept as a number and never removed, but not extended — read `roleLabel` instead. Sender role: 0 = Partner, 1 = Creditor, 2 = ManagedByPartner.
  - `roleLabel` string, nullable: The sender role, readable. Always one of "Partner", "Creditor" or "Managed by partner" — these values are stable.
  - `message` string, nullable
  - `isSeen` boolean
  - `user` DebituraWebExternalApiContractsV1UsersUserRelationDto
    - `id` integer
    - `dateCreated` string, date-time, nullable
    - `dateUpdated` string, date-time, nullable
    - `firstName` string, nullable
    - `lastName` string, nullable
    - `email` string, nullable, required

## Other responses

- `400`: Validation error — missing fields, invalid userId, or invalid request body
- `404`: Case not found or not assigned to this collection partner
- `500`: Internal server error

## Changes

- **2026-10-01** `460a861d7d9b`: 3 info
  - response property `role` deprecated (media type: text/plain)
  - response property `role` deprecated (media type: application/json)
  - response property `role` deprecated (media type: text/json)
- **2026-09-20** `7a1c16414f83`: 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-collection-partner-api/changes/cases/:id/chats/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)
