MessageOS
API

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.

FieldTypeNotes
data.inboundMessageIdintegerThe 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.contactIdintegerThe contact.
data.externalIdstring or nullYour id for the contact, or null.
data.phoneNumberstringThe person's phone number, in E.164.
data.conversationIdintegerThe conversation. It is left out when conversations are not recorded for the environment. Optional.
data.textstringWhat the person typed, or the label of the suggestion they tapped. Empty for a file or a location sent with no words.
data.kindone of text, chip, file, locationchip when the person tapped a suggested reply or action, text when they typed, file or location when they sent one with no words.
data.postbackDatastring or nullThe postbackData of the suggestion the person tapped, or null.
data.attachmentsarray of objectFiles the person sent. Empty when there are none.
data.attachments[].urlstringWhere the file can be fetched.
data.attachments[].mediaTypestringIts media type, such as image/jpeg.
data.attachments[].kindstringimage or file.
data.attachments[].fileNamestring or null
data.locationobject or nullThe place the person shared, or null.
data.location.latitudenumber
data.location.longitudenumber
data.location.labelstring or null
data.receivedAtstring (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.

FieldTypeNotes
data.idstring or nullThe 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.messageIdinteger or nullThe number in id.
data.auditIdinteger or nullThe same number as messageId.
data.referencestring or nullThe reference you sent with the message, or null.
data.contactIdintegerThe contact.
data.externalIdstring or nullYour id for the contact, or null.
data.channelstringrcs.
data.originstring or nullWho 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.deliveredAtstring (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.

FieldTypeNotes
data.idstring or nullThe 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.messageIdinteger or nullThe number in id.
data.auditIdinteger or nullThe same number as messageId.
data.referencestring or nullThe reference you sent with the message, or null.
data.contactIdintegerThe contact.
data.externalIdstring or nullYour id for the contact, or null.
data.channelstringrcs.
data.originstring or nullWho 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.readAtstring (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.

FieldTypeNotes
data.idstring or nullThe 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.messageIdinteger or nullThe number in id.
data.auditIdinteger or nullThe same number as messageId.
data.referencestring or nullThe reference you sent with the message, or null.
data.contactIdintegerThe contact.
data.externalIdstring or nullYour id for the contact, or null.
data.channelstringrcs.
data.originstring or nullWho 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.failedAtstring (date-time)When MessageOS received the report.
data.reasonstring or nullThe 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.providerCodestring or nullThe 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.

FieldTypeNotes
data.contactIdintegerThe contact.
data.externalIdstring or nullYour id for the contact, or null.
data.optedInbooleanfalse for contact.opted_out, true for contact.opted_in.
data.changedAtstring (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.

FieldTypeNotes
data.contactIdintegerThe contact.
data.externalIdstring or nullYour id for the contact, or null.
data.optedInbooleanfalse for contact.opted_out, true for contact.opted_in.
data.changedAtstring (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.

FieldTypeNotes
data.workflowIdstringThe workflow.
data.runIdintegerThis run of the workflow.
data.contactIdintegerThe contact.
data.resultRefstringThe id of what the workflow created, such as an appointment, a request, or a finished form.
data.completionstringbook when it booked through your calendar, request when it recorded a request for your team, form when a person finished a guided form.
data.fieldsobjectThe 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": {}
}

On this page