GET
/
v1
/
messages
import { Novu } from "@novu/api";

const novu = new Novu({
  secretKey: "YOUR_SECRET_KEY_HERE",
});

async function run() {
  const result = await novu.messages.retrieve({});

  // Handle the result
  console.log(result);
}

run();
{
  "hasMore": true,
  "data": [
    {
      "_id": "<string>",
      "_environmentId": "<string>",
      "_organizationId": "<string>",
      "_subscriberId": "<string>",
      "transactionId": "<string>",
      "_templateId": "<string>",
      "_digestedNotificationId": "<string>",
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "channels": [
        "in_app"
      ],
      "subscriber": {
        "firstName": "<string>",
        "subscriberId": "<string>",
        "_id": "<string>",
        "lastName": "<string>",
        "email": "<string>",
        "phone": "<string>"
      },
      "template": {
        "_id": "<string>",
        "name": "<string>",
        "origin": "novu-cloud",
        "triggers": [
          {
            "type": "event",
            "identifier": "<string>",
            "variables": [
              {
                "name": "<string>"
              }
            ],
            "subscriberVariables": [
              {
                "name": "<string>"
              }
            ]
          }
        ]
      },
      "jobs": [
        {
          "_id": "<string>",
          "type": "in_app",
          "digest": {
            "digestKey": "<string>",
            "amount": 123,
            "unit": "seconds",
            "type": "regular",
            "events": [
              {}
            ],
            "backoff": true,
            "backoffAmount": 123,
            "backoffUnit": "seconds",
            "updateMode": true,
            "timed": {
              "atTime": "<string>",
              "weekDays": [
                "monday"
              ],
              "monthDays": [
                123
              ],
              "ordinal": "1",
              "ordinalValue": "day",
              "monthlyType": "each",
              "cronExpression": "<string>"
            }
          },
          "executionDetails": [
            {
              "_id": "<string>",
              "createdAt": "<string>",
              "status": "Success",
              "detail": "<string>",
              "isRetry": true,
              "isTest": true,
              "providerId": "emailjs",
              "raw": "<string>",
              "source": "Credentials"
            }
          ],
          "step": {
            "_id": "<string>",
            "active": true,
            "replyCallback": {},
            "controlVariables": {},
            "metadata": {},
            "issues": {},
            "filters": [
              {
                "isNegated": true,
                "type": "BOOLEAN",
                "value": "AND",
                "children": [
                  {
                    "field": "<string>",
                    "value": "<string>",
                    "operator": "LARGER",
                    "on": "subscriber"
                  }
                ]
              }
            ],
            "template": {},
            "variants": [
              {}
            ],
            "_templateId": "<string>",
            "name": "<string>",
            "_parentId": "<string>"
          },
          "payload": {},
          "providerId": "emailjs",
          "status": "<string>",
          "updatedAt": "<string>"
        }
      ],
      "payload": {},
      "tags": [
        "<string>"
      ],
      "controls": {},
      "to": {}
    }
  ],
  "pageSize": 123,
  "page": 123
}

Authorizations

Authorization
string
header
required

API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".

Headers

idempotency-key
string

A header for idempotency purposes

Query Parameters

channel
enum<string>

Channel type through which the message is sent

Available options:
in_app,
email,
sms,
chat,
push
subscriberId
string
transactionId
string[]
page
number
default:
0
limit
number
default:
10

Response

200
application/json
hasMore
boolean
required

Indicates if there are more activities in the result set

data
object[]
required

Array of activity notifications

pageSize
number
required

Page size of the activities

page
number
required

Current page of the activities