Status and inbound message callbacks

Get message delivery statuses and incoming SMS, WhatsApp, iMessage and RCS messages pushed to your app instead of polling — where to set the callback URL, the two events, their payloads, verifying the signature, and what is and isn't sent today.


Your app can poll GET /api/v1/ext/messages for new messages and statuses, or it can have myCRMSIM push them to a URL of yours as they happen. This guide covers the push.
No code? Give a workspace its own webhook
If you only want messages sent to another tool (an automation platform, a helpdesk, a sheet), you don't need an API app. A Custom Location workspace can post every incoming message, and every status change, to a webhook URL you paste in:
  1. In the sidebar, open Manage Workspaces (the Workspaces / Webhooks page) and click Add Workspace.
  2. Give it a Name, then open Advanced (optional).
  3. Under External system (webhook), paste the tool's webhook URL. Use Add Header if the tool needs a key in a header. The same URL and headers show on Developers → Webhooks, where you can also send a test.
  4. Click Create Workspace.
  5. Open Subaccount SIM, assign a line to the new workspace, and set its Message Routing.
Your tool now receives a POST for each message:
type
When
Fields
MESSAGEA message arrived, or was sent from the phonemessage, phone, isMe (true for messages you sent), attachments, location_id
STATUS-UPDATEA message you sent changed status message_id, status (such as sent, delivered, failed)
To send from your tool, POST to the send URL shown under Instructions on the workspace's row. The message goes out on the workspace's routing; a channel field is ignored. Deleting the workspace stops both directions.
Tip: for Zapier or Make there's a ready-made app, so you don't need the webhook: see Zapier and Make.
Set the callback URL
The URL belongs to your API app. Set it when you request the app, under Integrations → Custom Integration → Request API app, in the Callback URL field. To change it later, open the card's View details, choose Edit, and send the change for review; your app keeps using the current URL until the change is approved.
One URL receives every event below. It must be a public https:// (or http://) address that answers a POST quickly.
Custom Location workspaces don't need this URL for inbound messages: they already receive them on the inbound webhook set on the workspace itself (see Get workspace / Update workspace). They do need it for call events, which go only to this URL.


Who gets a callback
A callback is sent to every app that:
  • is installed and active on the account that owns the message, and
  • is itself active (not disconnected), and
  • has a callback URL set.
If two apps share the same URL, that URL is called once.

Standard and Custom Location workspaces

Event
Standard workspace
Custom Location workspace
message.statusYour app's callback URL Your app's callback URL, and the workspace's own webhook as before
message.inboundYour app's callback URLOnly the workspace's own inbound webhook, unchanged

So a Custom Location integration keeps working exactly as it did; the callback URL adds inbound messages for standard workspaces.

The events
Every callback is a POST with a JSON body. Read the event field to tell the two apart, and app_id to see which of your apps it is for.
message.status — a delivery status changed
Sent when an outbound message moves to a new status: sent, delivered, read or failed. Today this covers SMS, iMessage, WhatsApp and RCS, for every kind of workspace.
Channel
Statuses you receive
SMSsent, delivered, failed
iMessagesent, delivered, read, failed
RCSsent, failed
WhatsAppsent, failed
WhatsApp: WhatsApp reports when a message leaves your WhatsApp line, not when it reaches the contact's phone, so you get sent (or failed) and never delivered. If the WhatsApp line was briefly unreachable, the message is held and sent again automatically; you receive its sent or failed when that resend finishes, which can be a few minutes later.


RCS: like WhatsApp, RCS reports whether the message left your RCS line, so you get sent or failed (with error_message), not delivered.


iMessage: you can receive all four statuses for an iMessage:
Status
Meaning
sentThe Mac sent the message to Apple.
deliveredIt reached the contact's Apple device.
readThe contact opened it (only when they have read receipts turned on).
failedIt could not be sent; error_message says why.

A message usually moves sent → delivered → read. read and delivered may arrive without sent before them when the Mac reports late, and read never arrives for a contact with read receipts off.

  • message_id is the same id Send message returned and Get message takes.
  • error_message explains a failed status. It is sent for SMS, RCS and iMessage, not yet for WhatsApp; treat it as optional. Get message returns the stored reason for any channel.
  • A status only ever moves forward: you won't get sent after delivered (or delivered after read), and a repeat of the same status is not sent again.
  • read is iMessage only: the contact opened the message. It comes after delivered, and only when the contact has read receipts on.
message.inbound — a message was received
Sent when a contact messages the workspace. Today this covers SMS (including MMS), RCS, and one-to-one WhatsApp and iMessage messages on standard workspaces. Not covered: Custom Location workspaces, which use their own inbound webhook; group chats; iMessage tapback reactions; and calls, which have their own events (see Call events below). channel tells you which line the message came in on.
  • attachments is always a list of file URLs; empty for a plain text. A WhatsApp file of 5 MB or more is not attached: message then says to view the file on the phone that received it.
  • For WhatsApp, phone is the contact's WhatsApp number.
  • For iMessage, phone is the handle the contact wrote from: a phone number, or their Apple ID email when they message from an email address.
  • A message the contact's inbound Do-Not-Disturb blocks is not stored and sends no callback.

Call events

The same URL also receives call.status (an outgoing call is ringing, was answered, ended), for apps granted calls.read or calls.write. They are signed the same way as the events above; the payloads are in Build calling into your own system.
Verify the signature
Each callback carries an X-MyCRMSIM-Signature header:
It is an HMAC-SHA256 of the raw request body, keyed with your app's client secret. Compute the same value and compare before trusting the body:
If you regenerate the client secret, callbacks are signed with the new one from then on — update your verifier at the same time.
Respond fast, and keep polling as a backstop
  • Answer with any 2xx within 4 seconds; do slow work after you respond.
  • A callback is sent once. A timeout, a non-2xx answer or an unreachable URL is not retried, so treat the push as the fast path and List messages / Get message as the source of truth.
  • Callbacks can arrive out of order and, rarely, more than once: use message_id (and status) to make handling idempotent.
 
 

Was this article helpful?

0 out of 0 liked this article

Still need help? Message Us