Messages

Retrieve a message

Changed on

Retrieves a Message object.

get/messages/{id}

Request

  • Base URL
    https://api.surge.app
  • URL
    https://api.surge.app/messages/{id}
  • Auth
    HTTP bearer

Path parameters

idstring required

The ID of the message to retrieve.

Example:msg_01j9e0m1m6fc38gsv2vkfqgzz2

Response

Message

blast_idstring nullable

The ID of the blast this message belongs to, if any. This can be used to attribute messages back to a specific blast.

bodystring nullable

The message body.

created_atstring date-time nullable required

When the message was added to the conversation, in ISO8601 UTC format. Null for scheduled messages until they are created. For imported messages, this is the original creation time.

failure_reasonstring nullable

The reason the message failed, or null if no failure reason is set.

idstring

Unique identifier for the object.

metadataMetadata

Set of key-value pairs that will be stored with the object.

status'pending' | 'received' | 'sent' | 'delivered' | 'failed'

The current status of the message.

Example response

{
  "attachments": [
    {
      "id": "att_01j9e0m1m6fc38gsv2vkfqgzz2",
      "type": "image",
      "url": "https://api.surge.app/attachments/att_01jbwyqj7rejzat7pq03r7fgmf"
    }
  ],
  "blast_id": null,
  "body": "Thought you could leave without saying goodbye?",
  "conversation": {
    "contact": {
      "first_name": "Dominic",
      "id": "ctc_01j9dy8mdzfn3r0e8x1tbdrdrf",
      "last_name": "Toretto",
      "phone_number": "+18015551234"
    },
    "id": "cnv_01j9e0dgmdfkj86c877ws0znae",
    "phone_number": {
      "id": "pn_01jsjwe4d9fx3tpymgtg958d9w",
      "metadata": {
        "location": "Downtown store"
      },
      "number": "+18015552345",
      "type": "local"
    }
  },
  "created_at": "2024-10-21T23:29:40Z",
  "failure_reason": null,
  "id": "msg_01j9e0m1m6fc38gsv2vkfqgzz2",
  "metadata": {
    "external_id": "12345"
  },
  "status": "delivered"
}

Changes

    • info

      added the required property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property // to the response with the status