Webhook events
Every event an endpoint can receive, and the fields of each.
An endpoint subscribes to any of reply.received, message.delivered, message.read, message.failed, contact.opted_out, contact.opted_in, workflow.completed. The webhooks guide covers registering an endpoint, the signature, and retries.
Every event is a JSON object with id (evt_ and a UUID, also in the x-messageos-event-id header), type, createdAt, clientId, and data. Each endpoint gets its own copy of an event, with its own id. New fields can be added to data, so ignore fields you do not know.
reply.received
The person sent a message: words, a tap on a suggestion, a file, or a location. STOP, HELP, and the other keywords are reported too, and MessageOS also answers those itself. Two things are not reported: a message MessageOS holds because the person sent too many in a short time, and an opt-out made with the phone's own control instead of a message, which arrives as contact.opted_out only.
| Field | Type | Notes |
|---|---|---|
data.inboundMessageId | integer | The id of the person's message, the same id it has in GET /v1/conversations/{id}/messages. Send it as inReplyTo to answer the message. |
data.contactId | integer | The contact. |
data.externalId | string or null | Your id for the contact, or null. |
data.phoneNumber | string | The person's phone number, in E.164. |
data.conversationId | integer | The conversation. It is left out when conversations are not recorded for the environment. Optional. |
data.text | string | What the person typed, or the label of the suggestion they tapped. Empty for a file or a location sent with no words. |
data.kind | one of text, chip, file, location | chip when the person tapped a suggested reply or action, text when they typed, file or location when they sent one with no words. |
data.postbackData | string or null | The postbackData of the suggestion the person tapped, or null. |
data.attachments | array of object | Files the person sent. Empty when there are none. |
data.attachments[].url | string | Where the file can be fetched. |
data.attachments[].mediaType | string | Its media type, such as image/jpeg. |
data.attachments[].kind | string | image or file. |
data.attachments[].fileName | string or null | |
data.location | object or null | The place the person shared, or null. |
data.location.latitude | number | |
data.location.longitude | number | |
data.location.label | string or null | |
data.receivedAt | string (date-time) | When MessageOS received it. |
{
"id": "evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b",
"type": "reply.received",
"createdAt": "2026-10-28T23:00:10.000Z",
"clientId": "example",
"data": {
"inboundMessageId": 981,
"contactId": 42,
"externalId": "crm-881",
"phoneNumber": "+15555550123",
"conversationId": 7,
"text": "On my way",
"kind": "chip",
"postbackData": "eta_now",
"attachments": [],
"location": null,
"receivedAt": "2026-10-28T23:00:05.000Z"
}
}message.delivered
The phone received a message.
| Field | Type | Notes |
|---|---|---|
data.id | string or null | The id the send answered with, such as msg_123. Read it with GET /v1/messages/{id}. null when the report cannot be matched to a send record. |
data.messageId | integer or null | The number in id. |
data.auditId | integer or null | The same number as messageId. |
data.reference | string or null | The reference you sent with the message, or null. |
data.contactId | integer | The contact. |
data.externalId | string or null | Your id for the contact, or null. |
data.channel | string | rcs. |
data.origin | string or null | Who sent the message: agent, api, dashboard, job, event, or system. api is a send through this API. null when the report cannot be matched to a send record. |
data.deliveredAt | string (date-time) | When MessageOS received the report. |
{
"id": "evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b",
"type": "message.delivered",
"createdAt": "2026-10-28T23:00:10.000Z",
"clientId": "example",
"data": {
"id": "msg_123",
"messageId": 123,
"auditId": 123,
"reference": "order-8841",
"contactId": 42,
"externalId": "crm-881",
"channel": "rcs",
"origin": "api",
"deliveredAt": "2026-10-28T23:00:02.000Z"
}
}message.read
The person opened a message. A phone with read receipts turned off never reports it, and the same message can be reported more than once.
| Field | Type | Notes |
|---|---|---|
data.id | string or null | The id the send answered with, such as msg_123. Read it with GET /v1/messages/{id}. null when the report cannot be matched to a send record. |
data.messageId | integer or null | The number in id. |
data.auditId | integer or null | The same number as messageId. |
data.reference | string or null | The reference you sent with the message, or null. |
data.contactId | integer | The contact. |
data.externalId | string or null | Your id for the contact, or null. |
data.channel | string | rcs. |
data.origin | string or null | Who sent the message: agent, api, dashboard, job, event, or system. api is a send through this API. null when the report cannot be matched to a send record. |
data.readAt | string (date-time) | When MessageOS received the report. |
{
"id": "evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b",
"type": "message.read",
"createdAt": "2026-10-28T23:00:10.000Z",
"clientId": "example",
"data": {
"id": "msg_123",
"messageId": 123,
"auditId": 123,
"reference": "order-8841",
"contactId": 42,
"externalId": "crm-881",
"channel": "rcs",
"origin": "api",
"readAt": "2026-10-28T23:00:09.000Z"
}
}message.failed
A message that was sent could not be delivered. A send that is blocked or refused is answered on the request itself and has no event.
| Field | Type | Notes |
|---|---|---|
data.id | string or null | The id the send answered with, such as msg_123. Read it with GET /v1/messages/{id}. null when the report cannot be matched to a send record. |
data.messageId | integer or null | The number in id. |
data.auditId | integer or null | The same number as messageId. |
data.reference | string or null | The reference you sent with the message, or null. |
data.contactId | integer | The contact. |
data.externalId | string or null | Your id for the contact, or null. |
data.channel | string | rcs. |
data.origin | string or null | Who sent the message: agent, api, dashboard, job, event, or system. api is a send through this API. null when the report cannot be matched to a send record. |
data.failedAt | string (date-time) | When MessageOS received the report. |
data.reason | string or null | The messaging network's own words for why, such as a file it could not fetch. null when it gave none. They are for a log or a person to read: they are not a fixed list and can change, so do not branch on a value you have not seen. |
data.providerCode | string or null | The messaging network's code for the failure, or null. Not a fixed list. |
{
"id": "evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b",
"type": "message.failed",
"createdAt": "2026-10-28T23:00:10.000Z",
"clientId": "example",
"data": {
"id": "msg_123",
"messageId": 123,
"auditId": 123,
"reference": "order-8841",
"contactId": 42,
"externalId": "crm-881",
"channel": "rcs",
"origin": "api",
"failedAt": "2026-10-28T23:00:02.000Z",
"reason": "MEDIA_FETCH_FAILED",
"providerCode": null
}
}contact.opted_out
The person opted out, with STOP or their phone's own control. Nothing can be sent to them until they opt back in.
| Field | Type | Notes |
|---|---|---|
data.contactId | integer | The contact. |
data.externalId | string or null | Your id for the contact, or null. |
data.optedIn | boolean | false for contact.opted_out, true for contact.opted_in. |
data.changedAt | string (date-time) | When the change was recorded. |
{
"id": "evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b",
"type": "contact.opted_out",
"createdAt": "2026-10-28T23:00:10.000Z",
"clientId": "example",
"data": {
"contactId": 42,
"externalId": "crm-881",
"optedIn": false,
"changedAt": "2026-10-28T23:00:00.000Z"
}
}contact.opted_in
The person opted back in.
| Field | Type | Notes |
|---|---|---|
data.contactId | integer | The contact. |
data.externalId | string or null | Your id for the contact, or null. |
data.optedIn | boolean | false for contact.opted_out, true for contact.opted_in. |
data.changedAt | string (date-time) | When the change was recorded. |
{
"id": "evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b",
"type": "contact.opted_in",
"createdAt": "2026-10-28T23:00:10.000Z",
"clientId": "example",
"data": {
"contactId": 42,
"externalId": "crm-881",
"optedIn": true,
"changedAt": "2026-10-28T23:00:00.000Z"
}
}workflow.completed
A guided workflow finished its task. It does not include message text.
| Field | Type | Notes |
|---|---|---|
data.workflowId | string | The workflow. |
data.runId | integer | This run of the workflow. |
data.contactId | integer | The contact. |
data.resultRef | string | The id of what the workflow created, such as an appointment, a request, or a finished form. |
data.completion | string | book when it booked through your calendar, request when it recorded a request for your team, form when a person finished a guided form. |
data.fields | object | The answers the workflow collected, by name. Answers your workflow marks as sensitive are left out. |
{
"id": "evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b",
"type": "workflow.completed",
"createdAt": "2026-10-28T23:00:10.000Z",
"clientId": "example",
"data": {
"workflowId": "booking",
"runId": 55,
"contactId": 42,
"resultRef": "form_55",
"completion": "form",
"fields": {
"day": "Tuesday"
}
}
}webhook.test
POST /v1/webhooks/{id}/test sends it to that endpoint only, and its delivery usually starts at once. It is not one of the types an endpoint subscribes to.
data is an empty object.
{
"id": "evt_2b7f4c1e-8a9d-4e3f-b6a1-5c0d9e8f7a6b",
"type": "webhook.test",
"createdAt": "2026-10-28T23:00:10.000Z",
"clientId": "example",
"data": {}
}Objects
The fields of each object the API returns.
Check a phone number for RCS GET
Answers 404 until MessageOS turns it on for you: GET /whoami shows rcsExtras true once it is. Asks the messaging network whether one phone can receive RCS from this agent, and what it supports, so you can check a number before you send to it.
