The message.received event is delivered whenever a message is received at a Surge number from a contact.
postWebhookmessageReceived
Payload
Example payload
{
"account_id": "acct_01japd271aeatb7txrzr2xj8sg",
"data": {
"attachments": [
{
"id": "att_01jav8z6x1j4m1b3w8v2jz7j3r",
"type": "image",
"url": "https://toretto.family/image.jpg"
}
],
"blast_id": null,
"body": "I don't have friends, I got family.",
"conversation": {
"contact": {
"first_name": "Dominic",
"id": "ctc_01ja88cboqffhswjx8zbak3ykk",
"last_name": "Toretto",
"phone_number": "+18015551234"
},
"id": "cnv_01jav8xy7fe4nsay3c9deqxge9",
"phone_number": {
"campaign_id": "cpn_01jjnn7s0zfx5tdcsxjfy93et2",
"id": "pn_01jsjwe4d9fx3tpymgtg958d9w",
"name": "(801) 555-6789",
"number": "+18015556789",
"type": "local"
}
},
"id": "msg_01jav96823f9x9054d6gyzpp16",
"metadata": {
"order_id": "12345"
},
"received_at": "2024-10-22T23:32:49Z"
},
"timestamp": "2024-10-21T23:29:41Z",
"type": "message.received"
}Response
Return a 200 status to indicate that the data was received successfully