Messages

List All Messages

Returns a paged list of messages sorted with the most recent messages appearing first.

Permissions

The API token must include the following scopes: Messaging.

get/Accounts/{AccountSid}/Messages

Path parameters

AccountSidstring uuid required

The unique identifier of the project that sent or received this message.

Query parameters

DateSentstring

Only return messages sent on this particular date, formatted as YYYY-MM-DD in UTC. You can also append < or > to return a range of messages. For example, use DateSent< to return messages sent on or before midnight of the date, or DateSent> to return messages sent on or after midnight of the date.

Fromstring

The phone number in E.164 format. For inbound messages, this will be the remote phone number who sent the message. For outbound messages, this will be one of your SignalWire phone numbers.

Example:+15551234567
Tostring

The phone number in E.164 format that received the message. For inbound messages, this is one of your SignalWire phone numbers; for outbound messages, this is the remote phone number that received the message.

Example:+15557654321
Status'queued' | 'sending' | 'sent' | 'delivered' | 'undelivered' | 'failed' | 'receiving' | 'received'

Current status of the message.

Example:sent
PageSizeinteger

Specify the number of results to return on a single page. The default page size is 50 and the maximum is 1000.

Response

OK

uristring
first_page_uristring
next_page_uristring
previous_page_uristring
pageinteger
page_sizeinteger

Example response

{
  "messages": [
    {
      "account_sid": "ea108133-d6b3-407c-9536-9fad8a929a6a",
      "api_version": "2010-04-01",
      "body": "Hello World!",
      "date_created": "Mon, 13 Aug 2018 21:38:46 +0000",
      "date_sent": "null",
      "date_updated": "Mon, 13 Aug 2018 21:38:46 +0000",
      "direction": "outbound-api",
      "from": "+15551234567",
      "price_unit": "USD",
      "sid": "0a059168-ead0-41af-9d1f-343dae832527",
      "status": "sent",
      "to": "+15557654321",
      "messaging_service_sid": "null",
      "uri": "/api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/0a059168-ead0-41af-9d1f-343dae832527",
      "subresource_uris": {
        "media": "/api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/0a059168-ead0-41af-9d1f-343dae832527/Media"
      }
    }
  ]
}

Changes