Common workflows
This page maps real integration flows to the Public API endpoints under/api/public/v1. Each workflow references the autogenerated endpoint docs and links to example pages where available.
1. API key setup
Public API authentication uses long-lived API keys instead of JWT sessions.- Log in to the CaseXchange dashboard or call the Internal API
POST /api/v1/auth/loginto access your account. - Create a Public API key from Settings > API Keys in the dashboard, or programmatically via
POST /api/v1/public-api-keys. - Include the key in the
X-API-Keyheader for all subsequent Public API calls. - Verify connectivity and confirm your firm context with
GET /firms/me.
- Call
GET /firms/meimmediately after key creation to verify the key is scoped to the expected firm. - API keys are issued at three tiers (
read_only,standard,full). Choose the minimum tier your integration needs. - Store keys in a secrets manager — never commit them to source control.
2. Sending a case referral
This workflow covers creating a case, attaching it to a receiving firm, and monitoring progress.GET /case-typesandGET /jurisdictionsto fetch reference data for building your case payload.GET /firms/availableto find a receiving firm that accepts the relevant case type and jurisdiction.POST /sent-casesto create a draft case with claimant details, case type, and jurisdiction.POST /sent-cases/{id}/referto send the draft to the chosen receiving firm.- Monitor the referral with
GET /sent-cases(list view) andGET /sent-cases/{id}(detail view).
- Treat lifecycle transitions (refer, close, reject) as separate action endpoints, not generic updates.
- Handle
403(permission denied) and409(conflict / invalid state transition) on referral actions. - Use query parameters on
GET /sent-cases(status,sort,order) to build filtered dashboards.
3. Receiving and processing referrals
This workflow covers the receiver side — accepting incoming referrals and moving them through the case lifecycle.GET /received-referralsto list incoming referrals with pagination and filtering.GET /received-referrals/{id}for full referral detail. PII fields are masked until the referral is acknowledged.POST /cases/{baseCaseId}/referrals/{id}/acknowledgeto accept the referral and unmask claimant PII.PATCH /received-referrals/{id}to update editable fields such asleadAttorneyName,phase,notes, and custom metadata.- Use lifecycle action endpoints to advance the referral:
POST /received-referrals/{id}/begin-investigatingPOST /received-referrals/{id}/signPOST /received-referrals/{id}/start-litigationPOST /received-referrals/{id}/closePOST /received-referrals/{id}/reject
- PII masking is enforced at the API level — you cannot read claimant details until you acknowledge.
- Expect permission differences between the sending and receiving firm on the same case.
- Poll
GET /received-referralswith thestatusfilter to drive intake queues.
4. Documents and messages
Upload documents to a case and communicate with the partner firm on a referral. Documents:POST /cases/{caseId}/documentsto upload a file (multipart/form-data).GET /cases/{caseId}/documentsto list all documents on a case.GET /cases/{caseId}/documents/{docId}/downloadto retrieve a pre-signed download URL.
POST /messages/sendto send a message to the partner firm on a referral. Optionally include arequestedStatusto prompt a status transition.
- Use the pre-signed download URL from the response rather than constructing direct object storage paths.
- Document uploads support common file types (PDF, DOCX, JPEG, PNG). Check the
allowedMimeTypesfield on your firm profile for the full list. - Messages trigger email notifications to the partner firm.
5. Routing rules
View routing rules and evaluate routing for a given case profile.GET /routing/rulesto view the routing rules configured for your firm.GET /routing/evaluateto test which firm a referral would route to for a given case type and jurisdiction combination, without actually creating a referral.
- Use
GET /routing/evaluatein dry-run or preview UIs before sending referrals. - Rules can overlap — the API evaluates them in priority order and returns the first match.