Skip to Content
Prets Developer Portal

Post a merchant message on a case

POST
/v1/cases/{caseId}/messages

to try read requests with your account, or paste an API key into the Authorization field. Create an API key in the Partner Portal.

Adds a reply from your organization to an open case. If the case was waiting on you, your reply hands it back to Prets. Send your own messageId to retry safely.

Returns the posted message. A retry with the same messageId and body returns the original message without posting it twice. Returns 409 when the case is closed or the messageId is already used with a different body, and 404 when the case does not exist or is not visible to you.

Path Parameters

caseId*string

Platform case id (cas_{ULID})

Match^cas_[0-9A-HJKMNP-TV-Z]{26}$

Request Body

application/json
  1. body

Opening or reply message body. Optional client ULID for idempotent create.

messageId?string

Client-generated id (csmsg_{ULID}). When provided the server uses it as the canonical message id, enabling optimistic UI.

Match^csmsg_[0-9A-HJKMNP-TV-Z]{26}$
body*string

Plain-text message body (max 32,000 characters, per Salesforce long text area)

Length1 <= length <= 32000

Response Body

The posted message

application/json
  1. response

The message that was posted

data*

One message in a Case conversation. Immutable through the API; erasure is a tombstone.

Authorization

bearerAuth
headerAuthorizationBearer <token>
Example Request
curl -X POST 'https://api.prets.app/v1/cases/cas_01ARZ3NDEKTSV4RRFFQ69G5FAV/messages' \  -H 'Content-Type: application/json' \  -d '{  "body": "The customer asked to move the appointment to next week."}'
Example Response
{  "data": {    "messageId": "csmsg_01ARZ3NDEKTSV4RRFFQ69G5FAV",    "body": "We have received your request.",    "author": {      "type": "merchant",      "contactId": "con_01HYQ4R7T0WKM2XB8ZFPC3NDV9",      "name": "Jane Advisor"    },    "createdAt": "2024-12-31T14:30:00.000Z",    "redactedAt": "2026-08-16T07:10:00.000Z"  }}