Get in-app notification feed for a particular subscriber

GET
/v1/subscribers/{subscriberId}/notifications/feed

Authorization

Authorization<token>

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

In: header

Path Parameters

subscriberIdRequiredstring

Query Parameters

pagenumber
limitnumber
Default: 10Maximum: 100
readboolean
seenboolean
payloadstring

Base64 encoded string of the partial payload JSON object

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

totalCountnumber

Total number of notifications available.

hasMoreRequiredboolean

Indicates if there are more notifications to load.

dataRequiredarray<object>

Array of notifications returned in the response.

@minItems 0

pageSizeRequirednumber

The number of notifications returned in this response.

pageRequirednumber

The current page number of the notifications.

export interface Response {
  /**
   * Total number of notifications available.
   */
  totalCount?: number;
  /**
   * Indicates if there are more notifications to load.
   */
  hasMore: boolean;
  /**
   * Array of notifications returned in the response.
   *
   * @minItems 0
   */
  data: NotificationFeedItemDto[];
  /**
   * The number of notifications returned in this response.
   */
  pageSize: number;
  /**
   * The current page number of the notifications.
   */
  page: number;
}
export interface NotificationFeedItemDto {
  /**
   * Unique identifier for the notification.
   */
  _id: string;
  /**
   * Identifier for the template used to generate the notification.
   */
  _templateId: string;
  /**
   * Identifier for the environment where the notification is sent.
   */
  _environmentId: string;
  /**
   * Identifier for the message template used.
   */
  _messageTemplateId: string;
  /**
   * Identifier for the organization sending the notification.
   */
  _organizationId: string;
  /**
   * Unique identifier for the notification instance.
   */
  _notificationId: string;
  /**
   * Unique identifier for the subscriber receiving the notification.
   */
  _subscriberId: string;
  /**
   * Identifier for the feed associated with the notification.
   */
  _feedId: string;
  /**
   * Identifier for the job that triggered the notification.
   */
  _jobId: string;
  /**
   * Timestamp indicating when the notification was created.
   */
  createdAt?: string | null;
  /**
   * Timestamp indicating when the notification was last updated.
   */
  updatedAt?: string | null;
  /**
   * Actor details related to the notification, if applicable.
   */
  actor?: ActorFeedItemDto;
  /**
   * Subscriber details associated with this notification.
   */
  subscriber?: SubscriberFeedResponseDto;
  /**
   * Unique identifier for the transaction associated with the notification.
   */
  transactionId: string;
  /**
   * Identifier for the template used, if applicable.
   */
  templateIdentifier?: string | null;
  /**
   * Identifier for the provider that sends the notification.
   */
  providerId?: string | null;
  /**
   * The main content of the notification.
   */
  content: string;
  /**
   * The subject line for email notifications, if applicable.
   */
  subject?: string | null;
  /**
   * Channel type through which the message is sent
   */
  channel: "in_app" | "email" | "sms" | "chat" | "push";
  /**
   * Indicates whether the notification has been read by the subscriber.
   */
  read: boolean;
  /**
   * Indicates whether the notification has been seen by the subscriber.
   */
  seen: boolean;
  /**
   * Device tokens for push notifications, if applicable.
   *
   * @minItems 0
   */
  deviceTokens?: string[] | null;
  /**
   * Call-to-action information associated with the notification.
   */
  cta: MessageCTA;
  /**
   * Current status of the notification.
   */
  status: "sent" | "error" | "warning";
  /**
   * The payload that was used to send the notification trigger.
   */
  payload?: {
    [k: string]: unknown;
  };
  /**
   * Provider-specific overrides used when triggering the notification.
   */
  overrides?: {
    [k: string]: unknown;
  };
}
export interface ActorFeedItemDto {
  /**
   * The data associated with the actor, can be null if not applicable.
   */
  data: string | null;
  /**
   * The type of the actor, indicating the role in the notification process.
   */
  type: "none" | "user" | "system_icon" | "system_custom";
}
export interface SubscriberFeedResponseDto {
  /**
   * The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier.
   */
  _id?: string;
  /**
   * The first name of the subscriber.
   */
  firstName?: string;
  /**
   * The last name of the subscriber.
   */
  lastName?: string;
  /**
   * The URL of the subscriber's avatar image.
   */
  avatar?: string;
  /**
   * The identifier used to create this subscriber, which typically corresponds to the user ID in your system.
   */
  subscriberId: string;
}
export interface MessageCTA {
  /**
   * Type of call to action
   */
  type?: "redirect";
  /**
   * Data associated with the call to action
   */
  data?: MessageCTAData;
  /**
   * Action associated with the call to action
   */
  action?: MessageAction;
}
export interface MessageCTAData {
  /**
   * URL for the call to action
   */
  url?: string;
}
export interface MessageAction {
  /**
   * Status of the message action
   */
  status?: "pending" | "done";
  /**
   * List of buttons associated with the message action
   *
   * @minItems 0
   *
   * @minItems 0
   */
  buttons?: MessageButton[];
  /**
   * Result of the message action
   */
  result?: MessageActionResult;
}
export interface MessageButton {
  /**
   * Type of button for the action result
   */
  type: "primary" | "secondary";
  /**
   * Content of the button
   */
  content: string;
  /**
   * Content of the result when the button is clicked
   */
  resultContent?: string;
}
export interface MessageActionResult {
  /**
   * Payload of the action result
   */
  payload?: {};
  /**
   * Type of button for the action result
   */
  type?: "primary" | "secondary";
}
 
curl -X GET "https://api.novu.co/v1/subscribers/string/notifications/feed?page=0&limit=10&read=true&seen=true&payload=btoa%28JSON.stringify%28%7B+foo%3A+123+%7D%29%29+results+in+base64+encoded+string+like+eyJmb28iOjEyM30%3D" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>"
{
  "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,
      "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
}