Skip to main content
GET
/
messages
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: 'My API Key',
});

const messages = await client.messages.list();

console.log(messages.paging);
{
  "paging": {
    "cursor": "<string>",
    "more": true
  },
  "results": [
    {
      "id": "<string>",
      "status": "CANCELED",
      "enqueued": 123,
      "sent": 123,
      "delivered": 123,
      "opened": 123,
      "clicked": 123,
      "recipient": "<string>",
      "event": "<string>",
      "notification": "<string>",
      "error": "<string>",
      "reason": "BOUNCED"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

archived
boolean | null

A boolean value that indicates whether archived messages should be included in the response.

cursor
string | null

A unique identifier that allows for fetching the next set of messages.

event
string | null

A unique identifier representing the event that was used to send the event.

list
string | null

A unique identifier representing the list the message was sent to.

messageId
string | null

A unique identifier representing the message_id returned from either /send or /send/list.

notification
string | null

A unique identifier representing the notification that was used to send the event.

provider
(string | null)[]

The key assocated to the provider you want to filter on. E.g., sendgrid, inbox, twilio, slack, msteams, etc. Allows multiple values to be set in query parameters.

recipient
string | null

A unique identifier representing the recipient associated with the requested profile.

status
(string | null)[]

An indicator of the current status of the message. Allows multiple values to be set in query parameters.

tag
(string | null)[]

A tag placed in the metadata.tags during a notification send. Allows multiple values to be set in query parameters.

tags
string | null

A comma delimited list of 'tags'. Messages will be returned if they match any of the tags passed in.

tenant_id
string | null

Messages sent with the context of a Tenant

enqueued_after
string | null

The enqueued datetime of a message to filter out messages received before.

traceId
string | null

The unique identifier used to trace the requests

Response

200 - application/json
paging
object
required

Paging information for the result set.

results
MessageDetails · object[]
required

An array of messages with their details.