Skip to content

Twilio Messaging

CaseSolo's Twilio messaging implementation lives in src/lib/integrations/twilio.ts and the routes under:

Implemented Contracts

Admin Configuration

/api/integrations/twilio stores firm-scoped Twilio settings in firm.settings.twilio:

GET responses redact the auth token and expose only accountSidHint.

Webhook Security

Production webhook requests must include X-Twilio-Signature. Local smoke tests can require the same behavior with:

x-casesolo-require-twilio-signature: true

Status callbacks return 204. Inbound message callbacks return TwiML with Content-Type: text/xml.

Verification

Focused tests:

npm run test:run -- twilio

The tests cover live send behavior, Messaging Service/status callback payloads, E.164 validation, TCPA keywords, template rendering, inbound contact/case threading, status callbacks, and webhook signature enforcement.

Source: docs/dev/twilio-messaging.md