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: cxp_<hex> (firm-scoped) or cxpp_<hex> (provider-scoped). 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 when the selected slot is a first-look slot (its attempt window includes attempt 1); re-look-only slots leave the pointer unchanged.

Required range: x >= 0
allowDuplicateClient
boolean
default:false

Send even though your firm already referred this client to the same receiving firm from another case of the same case type (409 duplicate_client_referral). Set it only after confirming this is a separate matter; each override is audited.

warmTransferHandoffId
string<uuid>

Optional. Handoff id from POST /handoffs. The referral claims that handoff when it belongs to your firm and to the receiving firm, and the receiving firm's Retell call for it is linked to the referral. Without it, the newest unclaimed handoff for the same sourceRecordId and receiving firm is claimed. A re-refer claims too. A handoff that cannot be claimed is ignored; it never fails the send, and a replay of an idempotency key never claims.

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