{
  "account_id": "acct_01japd271aeatb7txrzr2xj8sg",
  "data": {
    "id": "msg_01jav96823f9x9054d6gyzpp16",
    "body": "I don't have friends, I got family.",
    "attachments": [
      {
        "id": "att_01jav8z6x1j4m1b3w8v2jz7j3r",
        "type": "image",
        "url": "https://toretto.family/image.jpg"
      }
    ],
    "received_at": "2024-10-22T23:32:49Z",
    "conversation": {
      "id": "cnv_01jav8xy7fe4nsay3c9deqxge9",
      "contact": {
        "id": "ctc_01ja88cboqffhswjx8zbak3ykk",
        "last_name": "Dominic",
        "first_name": "Toretto",
        "phone_number": "+18015551234"
      }
    }
  },
  "type": "message.received"
}

The message.received event is delivered whenever someone sends a message to a Surge number you own.

Common Use Cases

  • Trigger automated responses
  • Update conversation analytics
  • Send notifications to other systems
  • Log customer interactions

Payload Structure

{
  "account_id": "acct_01japd271aeatb7txrzr2xj8sg",
  "data": {
    "id": "msg_01jav96823f9x9054d6gyzpp16",
    "body": "I don't have friends, I got family.",
    "attachments": [
      {
        "id": "att_01jav8z6x1j4m1b3w8v2jz7j3r",
        "type": "image",
        "url": "https://toretto.family/image.jpg"
      }
    ],
    "received_at": "2024-10-22T23:32:49Z",
    "conversation": {
      "id": "cnv_01jav8xy7fe4nsay3c9deqxge9",
      "contact": {
        "id": "ctc_01ja88cboqffhswjx8zbak3ykk",
        "last_name": "Dominic",
        "first_name": "Toretto",
        "phone_number": "+18015551234"
      }
    }
  },
  "type": "message.received"
}
account_id
string
required

The ID of the account that received the message

type
string
required

Always message.received for this event

data
message
id
string

The unique identifier for the message

body
string

The content of the message

attachments
attachment[]
received_at
string

ISO 8601 timestamp of when the message was received

conversation
conversation