GET
/
v1
/
subscribers
/
{subscriberId}
/
notifications
/
feed
import { Novu } from "@novu/api";

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

async function run() {
  const result = await novu.subscribers.notifications.feed({
    subscriberId: "<id>",
    payload: "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=",
  });

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

run();
{
  "totalCount": 5,
  "hasMore": true,
  "data": [
    {
      "_id": "615c1f2f9b0c5b001f8e4e3b",
      "_templateId": "template_12345",
      "_environmentId": "env_67890",
      "_messageTemplateId": "message_template_54321",
      "_organizationId": "org_98765",
      "_notificationId": "notification_123456",
      "_subscriberId": "subscriber_112233",
      "_feedId": "feed_445566",
      "_jobId": "job_778899",
      "createdAt": "2024-12-10T10:10:59.639Z",
      "updatedAt": "2024-12-10T10:10:59.639Z",
      "actor": {
        "data": null,
        "type": "none"
      },
      "subscriber": {
        "_id": "<string>",
        "firstName": "<string>",
        "lastName": "<string>",
        "avatar": "<string>",
        "subscriberId": "<string>"
      },
      "transactionId": "transaction_123456",
      "templateIdentifier": "template_abcdef",
      "providerId": "provider_xyz",
      "content": "This is a test notification content.",
      "subject": "Test Notification Subject",
      "channel": "in_app",
      "read": false,
      "seen": true,
      "deleted": false,
      "deviceTokens": [
        "token1",
        "token2"
      ],
      "cta": {
        "type": "redirect",
        "data": {
          "url": "<string>"
        },
        "action": {
          "status": "pending",
          "buttons": [
            {
              "type": "primary",
              "content": "<string>",
              "resultContent": "<string>"
            }
          ],
          "result": {
            "payload": {},
            "type": "primary"
          }
        }
      },
      "status": "sent",
      "payload": {
        "key": "value"
      },
      "overrides": {
        "overrideKey": "overrideValue"
      }
    }
  ],
  "pageSize": 2,
  "page": 1
}

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

subscriberId
string
required

Query Parameters

page
number
limit
number
default:
10
Required range: x < 100
read
boolean
seen
boolean
payload
string

Base64 encoded string of the partial payload JSON object

Response

200
application/json
OK
hasMore
boolean
required

Indicates if there are more notifications to load.

data
object[]
required

Array of notifications returned in the response.

pageSize
number
required

The number of notifications returned in this response.

page
number
required

The current page number of the notifications.

totalCount
number

Total number of notifications available.