Send a Salesforce record to CaseXchange as a new case or re-referral
Turns an org-side “send this record to CaseXchange” submit into a durable, idempotent CaseXchange case creation (or re-referral to a new firm) — spec §7.2. Reads the source record from Salesforce using the firm’s active, activated, interactive-send-enabled v2 sending profile, applies its confirmed prefill links plus any overrides, and creates (or re-refers) a case.
Idempotency: pass a fresh idempotencyKey (UUID) on every distinct submit. Replaying the same key returns the original outcome with 200 and attempt.replay: true instead of creating a duplicate case; a genuinely new submit must use a new key.
Observing write-back: there is NO status-check endpoint. Once this call returns, the CaseXchange case exists, but its bridge fields (match key, status, reference number, deep link) are stamped back onto the source Salesforce record asynchronously by the write-back job — observe completion by reading those fields on the source record (typically within ~5 minutes). A send that exhausts its write-back retries moves to needs_attention and is paused for an admin; that state sends NO signal to the org side, so clients should surface a send whose fields remain unstamped after a timeout as stale rather than wait indefinitely.
Error codes (409s carry a per-code error.details object — see the 409 response):
400 unsupported_match_key_mode— the resolved sending profile does not use an external-ID match key (send is not supported).400 validation_error— the built create payload failed validation;error.details.errorscarries the field-level issues.400 bad_request— a re-refer business-rule rejection propagated from the re-referral service (e.g. the case is not in a re-referable status, or no prior referral exists); the message is descriptive.404 send_mapping_not_configured— no active, activated, interactive-send-enabled v2 sending profile matches the given object/record type.404 source_record_not_found— sourceRecordId does not exist (or is not visible) in Salesforce.404 linked_case_not_found— reRefer was requested but no linked CaseXchange case exists for this record (or it no longer exists).409 record_already_sent— the record is already linked to a CaseXchange case and reRefer was not requested.error.details:{ baseCaseId, referenceNumber }(the existing case, so the client can offer re-refer).409 record_already_linked— the record already carries a match-key value from a prior send with no active link.error.details:{ matchKeyValue }.409 send_in_progress— a send for this record (or idempotency key) is already in flight.error.details:{ retryAfterMs }— the remaining in-flight window (floored at 0) to back off before retrying.409 attempt_failed— a previous send with this idempotency key failed; submit a fresh key to retry.error.details:{ failureCode, lastError }.502 salesforce_unavailable— no usable Salesforce access token for this connection.502 salesforce_read_failed— the Salesforce SOQL read of the source record failed.
Requires FULL tier.
Authorizations
Public API key (starts with cxp_). Required on every request.
Body
Salesforce record Id (15 or 18 char) of the source record being sent.
^[a-zA-Z0-9]{15,18}$Salesforce object API name, e.g. litify_pm__Matter__c.
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.
1 elementA 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.
Record type developer name. Omit or null to match profiles with no record type set.
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).
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.
64When true and the source record is already linked to a CaseXchange case, re-refer that case to targetFirmIds instead of creating a new case.
10000Optional. 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.
Optional. The roundRobinPosition from GET /routing/evaluate. Requires routingRuleId; advances the rule's round-robin pointer.
x >= 0Response
Replay of a previously processed idempotency key — returns the original outcome
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.