Skip to main content

What you will do

Register an HTTPS endpoint, receive a test delivery on it, verify the signature, and then watch a real referral event arrive. Budget about thirty minutes. You need a firm-scoped cxp_ API key at the standard tier or above, and your firm’s account must have the Public API integration enabled. See Webhooks for the full prerequisites.
1

Get a standard-tier API key

Generate the key from Settings > API Keys in the CaseXchange dashboard, or programmatically with a JWT session — the Quickstart and the JWT guide both cover it.A read_only key can list subscriptions and read the delivery log, but it cannot create, change, test or delete a subscription. Those calls return 403 insufficient_tier.
Admin keys, Salesforce cxsf_ tokens and MCP-issued keys cannot manage webhooks at any tier. They return 403 wrong_scope.
2

Stand up an endpoint

Your endpoint must:
  • be reachable at https:// on port 443, with a hostname that resolves to a public address;
  • read the raw request body, because that is what the signature covers;
  • answer 2xx quickly, and do the real work afterwards.
Here is a minimal Express receiver. The verify function is the reference implementation from Verify signatures — copy it from there.
Developing locally? localhost and private addresses are rejected. Use an HTTPS tunnel, a hosted request-capture service, or echo mode, which needs no endpoint of your own at all.
3

Create the subscription

Response 201
secret is returned here and in the response to POST /webhooks/{id}/rotate-secret, and nowhere else. It cannot be read back. Store it in your secrets manager before you close the terminal.
There is no events field: every active subscription receives every event for your firm. Your firm may hold five active subscriptions at once.
4

Send a test event

Response 200
The body that arrives at your endpoint is not the event envelope. webhook.test is a synthetic delivery with its own flat shape, and its eventId travels only in the X-CaseXchange-Event-Id header:
It is signed like any other delivery, so it exercises your verification code end to end.Confirm it landed:
If it says FAILED or EXHAUSTED instead, lastStatusCode and lastError say why — see Troubleshooting.
5

Receive a real event

A test delivery proves your transport and your signature check. To exercise your event handling, create a case through the API and move it through a status change: POST /sent-cases then POST /sent-cases/{id}/refer produces referral.sent for your firm. See Sent Cases examples.Every firm event envelope carries isTestCase, so your handler can route or ignore test traffic — the synthetic webhook.test body is not an envelope and has no isTestCase. An ordinary referral arrives with isTestCase: false. If you would rather not exercise this against live referral traffic, drive a test case through a status change instead — every delivery for it carries isTestCase: true, so your handler can route or ignore it. This is an abbreviated envelope — the event catalog has the full field list and the data shape for each event:

Before you go live

  • Verify X-CaseXchange-Signature before parsing the body, using the raw bytes.
  • Deduplicate on X-CaseXchange-Delivery. Retries reuse it; eventId is shared across firms and subscriptions and is not unique per delivery.
  • Answer 2xx as soon as the body is stored. Anything else is a failed attempt.
  • Ignore event names your handler does not recognise rather than erroring on them.
  • Filter on isTestCase so test traffic never reaches production records.
  • Check piiMasked before reading client fields; a masked snapshot omits them entirely rather than sending nulls. See Client data and masking.
  • Apply the delivery with the greatest occurredAt; there is no ordering guarantee.
  • Store the secret in a secrets manager. Never log it.
  • Plan for rotation: POST /webhooks/{id}/rotate-secret takes effect immediately, with no dual-signing window. Deploy a verifier that accepts both secrets, rotate, then drop the old one.
  • Reconcile periodically against GET /status-updates and the case read endpoints. Webhooks are a signal, not a complete change feed — see Known gaps.
  • Monitor GET /webhooks/{id}/deliveries for EXHAUSTED runs. Ten consecutive exhausted deliveries deactivate the subscription; see Reliability.

Next steps

Managing subscriptions

Every endpoint, the URL rules, the five-subscription limit, and the error codes.

Anatomy of a delivery

Headers, the envelope, idempotency and ordering.

Verify signatures

The reference implementations and the rotation procedure.

Testing

Test deliveries, echo mode, and local development.