Post a merchant message on a case
curl --request POST \
--url https://api.prets.app/v1/cases/{caseId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "The customer asked to move the appointment to next week.",
"messageId": "csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2"
}
'import requests
url = "https://api.prets.app/v1/cases/{caseId}/messages"
payload = {
"body": "The customer asked to move the appointment to next week.",
"messageId": "csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
body: JSON.stringify('The customer asked to move the appointment to next week.'),
messageId: 'csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2'
})
};
fetch('https://api.prets.app/v1/cases/{caseId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.prets.app/v1/cases/{caseId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'body' => 'The customer asked to move the appointment to next week.',
'messageId' => 'csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.prets.app/v1/cases/{caseId}/messages"
payload := strings.NewReader("{\n \"body\": \"The customer asked to move the appointment to next week.\",\n \"messageId\": \"csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.prets.app/v1/cases/{caseId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"The customer asked to move the appointment to next week.\",\n \"messageId\": \"csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prets.app/v1/cases/{caseId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body\": \"The customer asked to move the appointment to next week.\",\n \"messageId\": \"csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"messageId": "csmsg_01ARZ3NDEKTSV4RRFFQ69G5AV",
"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"
}
}Cases
Post a merchant message on a case
POST
/
v1
/
cases
/
{caseId}
/
messages
Post a merchant message on a case
curl --request POST \
--url https://api.prets.app/v1/cases/{caseId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "The customer asked to move the appointment to next week.",
"messageId": "csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2"
}
'import requests
url = "https://api.prets.app/v1/cases/{caseId}/messages"
payload = {
"body": "The customer asked to move the appointment to next week.",
"messageId": "csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
body: JSON.stringify('The customer asked to move the appointment to next week.'),
messageId: 'csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2'
})
};
fetch('https://api.prets.app/v1/cases/{caseId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.prets.app/v1/cases/{caseId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'body' => 'The customer asked to move the appointment to next week.',
'messageId' => 'csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.prets.app/v1/cases/{caseId}/messages"
payload := strings.NewReader("{\n \"body\": \"The customer asked to move the appointment to next week.\",\n \"messageId\": \"csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.prets.app/v1/cases/{caseId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"The customer asked to move the appointment to next week.\",\n \"messageId\": \"csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prets.app/v1/cases/{caseId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body\": \"The customer asked to move the appointment to next week.\",\n \"messageId\": \"csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"messageId": "csmsg_01ARZ3NDEKTSV4RRFFQ69G5AV",
"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"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Platform case id (cas_{ULID})
Pattern:
^cas_[0-9A-HJKMNP-TV-Z]{26}$Example:
"cas_01ARZ3NDEKTSV4RRFFQ69G5AV"
Body
application/json
Opening or reply message body. Optional client ULID for idempotent create.
Plain-text message body (max 32,000 characters, per Salesforce long text area)
Required string length:
1 - 32000Example:
"The customer asked to move the appointment to next week."
Client-generated id (csmsg_{ULID}). When provided the server uses it as the canonical message id, enabling optimistic UI.
Pattern:
^csmsg_[0-9A-HJKMNP-TV-Z]{26}$Example:
"csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2"
Response
Message posted successfully
The message that was posted
One message in a Case conversation. Immutable through the API; erasure is a tombstone.
Show child attributes
Show child attributes
Was this page helpful?
⌘I