curl --request POST \
--url https://api.casexchange.com/api/public/v1/messages/send \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"id": "<string>",
"message": "<string>"
}
'import requests
url = "https://api.casexchange.com/api/public/v1/messages/send"
payload = {
"id": "<string>",
"message": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', message: '<string>'})
};
fetch('https://api.casexchange.com/api/public/v1/messages/send', 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.casexchange.com/api/public/v1/messages/send",
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([
'id' => '<string>',
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.casexchange.com/api/public/v1/messages/send"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.casexchange.com/api/public/v1/messages/send")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casexchange.com/api/public/v1/messages/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referralId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referenceNumber": "<string>",
"status": "draft",
"message": "<string>",
"isMessage": true,
"source": "manual",
"createdAt": "2023-11-07T05:31:56Z",
"createdByName": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}Send a partner message
Posts a message to the other firm on a referral identified by a flexible id. When the id resolves to a case rather than a single referral, the most recent referral involving the caller’s firm is used. Messages cannot be sent on DRAFT, REJECTED, WITHDRAWN or CLOSED referrals (400 invalid_state). Optionally requests a status change the other party can confirm. Requires STANDARD tier.
curl --request POST \
--url https://api.casexchange.com/api/public/v1/messages/send \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"id": "<string>",
"message": "<string>"
}
'import requests
url = "https://api.casexchange.com/api/public/v1/messages/send"
payload = {
"id": "<string>",
"message": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', message: '<string>'})
};
fetch('https://api.casexchange.com/api/public/v1/messages/send', 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.casexchange.com/api/public/v1/messages/send",
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([
'id' => '<string>',
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.casexchange.com/api/public/v1/messages/send"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.casexchange.com/api/public/v1/messages/send")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casexchange.com/api/public/v1/messages/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referralId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referenceNumber": "<string>",
"status": "draft",
"message": "<string>",
"isMessage": true,
"source": "manual",
"createdAt": "2023-11-07T05:31:56Z",
"createdByName": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Public API key: cxp_<hex> (firm-scoped) or cxpp_<hex> (provider-scoped). Required on every request.
Body
Flexible identifier. Accepts a referral UUID, a base-case UUID, a CaseXchange reference number (e.g. PREFIX-0001, exact match), or one of the calling firm's own integration ids: a case-management id it holds on a referral it received (DearLegal case id, Neos intake id, Clio matter id, SmartAdvocate case id, Salesforce intake record id, Case Status user-entered id, or numeric Case Status internal id), or the Salesforce record id of a case it sent. An integration id belongs to the firm whose system it points to: another firm's ids never resolve, not even on a case both firms share. Resolution order is UUID, then reference number, then integration ids; the calling firm must be a party to the match (sender or receiver) or the request returns 404. A case-management or Case Status id that matches more than one of the calling firm's cases returns 409 ambiguous_external_id; one that matches several referrals of a single case (the firm received the case again) resolves to the live referral. The Salesforce record id of cases the firm sent resolves to the one still being referred (latest referral not rejected, withdrawn or closed), or to the newest when none is, and returns 409 only when more than one is still being referred.
11 - 5000Optional status the sender is asking the other firm to move to (case-insensitive)
draft, sent, received, under_evaluation, investigating, signed, in_litigation, closing, won, lost, closed, rejected, withdrawn, terminated, exhausted, pending_spin_off 
