Skip to main content
POST
Send a Salesforce record to CaseXchange as a new case or re-referral

Authorizations

X-API-Key
string
header
required

Public API key (starts with cxp_). Required on every request.

Body

application/json
sourceRecordId
string
required

Salesforce record Id (15 or 18 char) of the source record being sent.

Pattern: ^[a-zA-Z0-9]{15,18}$
sfObjectApiName
string
required

Salesforce object API name, e.g. litify_pm__Matter__c.

targetFirmIds
string<uuid>[]
required

Receiving firm id(s) for this send. Array-shaped for forward compatibility, but CaseXchange supports exactly one active referral per case — exactly one target firm per send today.

Required array length: 1 element
idempotencyKey
string<uuid>
required

A fresh UUID generated by the caller for each distinct submit. Replaying the same key returns the original outcome (200, attempt.replay: true) instead of creating a duplicate case.

sfRecordTypeDevName
string | null

Record type developer name. Omit or null to match profiles with no record type set.

overrides
object

Optional per-field overrides keyed by casex.* canonical key. Keys must be one of the interactive-send form fields returned by GET /salesforce/send-mapping (sendFields).

mappingVersion
string

Observability only, echoed from GET /salesforce/send-mapping. A stale/mismatched value is logged but never rejected — the server always re-reads current mapping config.

Maximum string length: 64
reRefer
boolean
default:false

When true and the source record is already linked to a CaseXchange case, re-refer that case to targetFirmIds instead of creating a new case.

notes
string
Maximum string length: 10000
routingRuleId
string<uuid>

Optional. Routing rule this send was chosen from (from GET /routing/evaluate). Ignored (with a server-side warning) if it is not a live rule owned by your firm.

roundRobinPosition
integer

Optional. The roundRobinPosition from GET /routing/evaluate. Requires routingRuleId; advances the rule's round-robin pointer.

Required range: x >= 0

Response

Replay of a previously processed idempotency key — returns the original outcome

data
object
required

Result of a durable, idempotent interactive send/re-refer (spec §7.2). attempt.state tells the org client where write-back stands: 'writeback_pending' means the bridge fields will be stamped by the writeback job; 'completed' means they already have been. 'superseded' (terminal, returned on replay) means a later re-refer superseded this attempt's referral, so nothing is left to stamp. There is no status-check endpoint: the only signal that write-back finished is the bridge fields appearing on the source Salesforce record (typically within ~5 minutes). A send that exhausts its retries becomes 'needs_attention' and is paused for an admin WITHOUT signalling the org, so clients should treat a still-unstamped record after a timeout as stale rather than poll indefinitely.

meta
object
required