HxConnect's communications layer brings Twilio SMS and Slack notifications into the case workflow as step types. Send templated messages with live case data, route notifications to the right channel, and maintain a full delivery audit trail — all without leaving the Work Center.
The sms_send step type sends an SMS to a recipient number using Twilio's Messaging API. Authentication uses HTTP Basic auth (Account SID as username, Auth Token as password). The message body is a template string containing {{case.*}} and {{user.*}} variable substitutions, resolved at send time from live case data.
The recipient number is derived from a configured case data field (e.g., case.data.customer_phone) or can be set as a static value in the connector config. All sent messages are stored in the sms_messages table with Twilio SID, delivery status, and timestamp.
The slack_notify step type posts a message to a Slack channel via Incoming Webhook URL. Slack's native markdown is supported in the message body — bold (*text*), code blocks (```text```), and links (<URL|label>). The webhook URL determines which channel receives the message, so different SlackConnector instances route to different channels.
Webhook URLs are stored encrypted in the connector record. All sent notifications are logged in slack_notifications. There is no delivery receipt (Slack Incoming Webhooks are fire-and-forget at the HTTP layer), but a 2xx response from Slack confirms the message was accepted.
SlackConnector instance per channel. For example, create SlackConnector-Legal pointing to #legal-cases and SlackConnector-Finance pointing to #finance-ops. Each connector instance stores its own webhook URL. When adding a slack_notify step, choose the appropriate connector instance.
| Step Type | Connector | Work Center Panel | Panel Contents | Auto-Advance Trigger |
|---|---|---|---|---|
sms_send |
TwilioConnector | SMS Panel 📱 | Recipient number (resolved from case field), message preview with substitutions rendered, Send SMS button, delivery status badge | Twilio API returns HTTP 201 (message accepted) |
slack_notify |
SlackConnector | Slack Panel 💬 | Channel name (from connector), message preview with substitutions rendered, Send to Slack button, delivery status badge | Slack Incoming Webhook returns HTTP 200 |
Both sms_send and slack_notify message templates support the following variable substitutions. Variables are resolved at send time from live case data and the sending user's profile.
| Variable | Resolves to | Example output |
|---|---|---|
{{case.ref}} |
Case reference number | REF-2024-0087 |
{{case.title}} |
Case title | Home Insurance Claim — J. Smith |
{{case.status}} |
Current case status | In Progress |
{{case.stage}} |
Current stage name | Document Review |
{{case.data.FIELD}} |
Any case data field by name | {{case.data.claim_amount}} > £15,000 |
{{user.name}} |
Full name of the sending agent | Alice Okafor |
{{user.email}} |
Email address of the sending agent | alice.okafor@firm.com |
Example SMS template:
Hi, your case {{case.ref}} ({{case.title}}) has moved to the
{{case.stage}} stage. Your case handler is {{user.name}}.
For queries contact {{user.email}}.
Example Slack template with Slack markdown:
*New case ready for review*
Case: `{{case.ref}}` — {{case.title}}
Stage: {{case.stage}} | Status: {{case.status}}
Assigned agent: {{user.name}}
<https://your-domain.com/agent/cases/{{case.id}}|Open in Velaris>
Get Twilio credentials. Log in to the Twilio Console. From the dashboard, copy your Account SID and Auth Token. Navigate to Phone Numbers > Manage > Active Numbers and copy the phone number you want to send from (E.164 format, e.g., +441234567890).
Set environment variables. Add the following and restart the case-service:
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx TWILIO_AUTH_TOKEN=your_auth_token TWILIO_FROM_NUMBER=+441234567890
Add the connector in Studio. Navigate to Studio > HxConnect > SMS and click Add Connector. Configure:
{{env.TWILIO_ACCOUNT_SID}}{{env.TWILIO_AUTH_TOKEN}}{{env.TWILIO_FROM_NUMBER}}case.data.customer_phone{{case.*}} varsCreate a Slack App with Incoming Webhooks. Go to api.slack.com/apps > Create New App > From scratch. Under Features > Incoming Webhooks, toggle Incoming Webhooks on. Click Add New Webhook to Workspace, select the target channel, and authorise. Copy the webhook URL (format: https://hooks.slack.com/services/T.../B.../...).
Repeat for each channel. Each channel requires a separate webhook URL. You can use the same Slack App or create separate apps per channel.
Add a connector instance per channel in Studio. Navigate to Studio > HxConnect > Slack and click Add Connector for each channel. The webhook URL is stored encrypted in the connector record — it does not need an environment variable, though you may use {{env.SLACK_WEBHOOK_LEGAL}} if you prefer centralised secret management.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/comms/sms/cases/{id}/send |
Sends an SMS for the case using the linked TwilioConnector. Resolves template variables and sends via Twilio API. Returns Twilio SID and status. | JWT |
POST |
/api/comms/slack/cases/{id}/send |
Posts a Slack notification for the case using the linked SlackConnector. Returns HTTP status from Slack. | JWT |
GET |
/api/comms/sms/messages |
Lists all SMS messages from sms_messages. Supports ?case_id=, ?status= filters. Returns Twilio SID, recipient, status, timestamp. |
JWT (Admin/Manager) |
GET |
/api/comms/slack/notifications |
Lists all Slack notifications from slack_notifications. Supports ?case_id=, ?connector_id= filters. |
JWT (Admin/Manager) |
curl -s -X POST https://your-domain.com/api/comms/sms/cases/c_01HZ.../send \ -H "Authorization: Bearer $VELARIS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "connector_id": "conn_twilio_01", "override_message": "Your case {{case.ref}} requires your attention. Please log in to the portal." }'
Omit override_message to use the template configured on the connector. The override_message field also supports {{case.*}} substitutions.