Skip to content

Mark a notification as unread

Mark a specific in-app (inbox) notification as unread by its unique identifier notificationId.

PATCH
/v2/subscribers/{subscriberId}/notifications/{notificationId}/unread

Authorization

Authorization<token>

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

In: header

Path Parameters

subscriberIdRequiredstring

The identifier of the subscriber

notificationIdRequiredstring

The identifier of the notification

Query Parameters

contextKeysarray<string>

Context keys for filtering

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

idRequiredstring

Unique identifier of the notification

transactionIdRequiredstring

Transaction identifier of the notification

subjectstring

Subject of the notification

bodyRequiredstring

Body content of the notification

toRequiredobject

Subscriber this notification was sent to

isReadRequiredboolean

Whether the notification has been read

isSeenRequiredboolean

Whether the notification has been seen

isArchivedRequiredboolean

Whether the notification has been archived

isSnoozedRequiredboolean

Whether the notification is snoozed

snoozedUntilstring | null

ISO timestamp when the notification will be unsnoozed

deliveredAtarray<string>

Timestamps when the notification was delivered

@minItems 0

createdAtRequiredstring

ISO timestamp when the notification was created

readAtstring | null

ISO timestamp when the notification was read

firstSeenAtstring | null

ISO timestamp when the notification was first seen

archivedAtstring | null

ISO timestamp when the notification was archived

avatarstring

Avatar URL for the notification

primaryActionobject

Primary action button for the notification

secondaryActionobject

Secondary action button for the notification

channelTypeRequiredstring

Channel type through which the message is sent

Value in: "in_app" | "email" | "sms" | "chat" | "push"
tagsarray<string>

Tags associated with the notification

@minItems 0

dataobject

Custom data payload of the notification

redirectobject

Redirect configuration for the notification

workflowobject

Workflow associated with the notification

severityRequiredstring

Severity of the workflow

Value in: "high" | "medium" | "low" | "none"
export interface Response {
  /**
   * Unique identifier of the notification
   */
  id: string;
  /**
   * Transaction identifier of the notification
   */
  transactionId: string;
  /**
   * Subject of the notification
   */
  subject?: string;
  /**
   * Body content of the notification
   */
  body: string;
  /**
   * Subscriber this notification was sent to
   */
  to: InboxSubscriberResponseDto;
  /**
   * Whether the notification has been read
   */
  isRead: boolean;
  /**
   * Whether the notification has been seen
   */
  isSeen: boolean;
  /**
   * Whether the notification has been archived
   */
  isArchived: boolean;
  /**
   * Whether the notification is snoozed
   */
  isSnoozed: boolean;
  /**
   * ISO timestamp when the notification will be unsnoozed
   */
  snoozedUntil?: string | null;
  /**
   * Timestamps when the notification was delivered
   *
   * @minItems 0
   */
  deliveredAt?: string[];
  /**
   * ISO timestamp when the notification was created
   */
  createdAt: string;
  /**
   * ISO timestamp when the notification was read
   */
  readAt?: string | null;
  /**
   * ISO timestamp when the notification was first seen
   */
  firstSeenAt?: string | null;
  /**
   * ISO timestamp when the notification was archived
   */
  archivedAt?: string | null;
  /**
   * Avatar URL for the notification
   */
  avatar?: string;
  /**
   * Primary action button for the notification
   */
  primaryAction?: InboxActionDto;
  /**
   * Secondary action button for the notification
   */
  secondaryAction?: InboxActionDto1;
  /**
   * Channel type through which the message is sent
   */
  channelType: "in_app" | "email" | "sms" | "chat" | "push";
  /**
   * Tags associated with the notification
   *
   * @minItems 0
   */
  tags?: string[];
  /**
   * Custom data payload of the notification
   */
  data?: {
    [k: string]: unknown;
  };
  /**
   * Redirect configuration for the notification
   */
  redirect?: RedirectDto1;
  /**
   * Workflow associated with the notification
   */
  workflow?: NotificationWorkflowDto;
  /**
   * Severity of the workflow
   */
  severity: "high" | "medium" | "low" | "none";
}
export interface InboxSubscriberResponseDto {
  /**
   * Unique identifier of the subscriber
   */
  id: string;
  /**
   * First name of the subscriber
   */
  firstName?: string;
  /**
   * Last name of the subscriber
   */
  lastName?: string;
  /**
   * Avatar URL of the subscriber
   */
  avatar?: string;
  /**
   * External subscriber identifier
   */
  subscriberId: string;
}
export interface InboxActionDto {
  /**
   * Label of the action button
   */
  label: string;
  /**
   * Whether the action has been completed
   */
  isCompleted: boolean;
  /**
   * Redirect configuration for the action
   */
  redirect?: RedirectDto;
}
export interface RedirectDto {
  /**
   * URL to redirect to
   */
  url: string;
  /**
   * Target attribute for the redirect link
   */
  target?: "_self" | "_blank" | "_parent" | "_top" | "_unfencedTop";
}
export interface InboxActionDto1 {
  /**
   * Label of the action button
   */
  label: string;
  /**
   * Whether the action has been completed
   */
  isCompleted: boolean;
  /**
   * Redirect configuration for the action
   */
  redirect?: RedirectDto;
}
export interface RedirectDto1 {
  /**
   * URL to redirect to
   */
  url: string;
  /**
   * Target attribute for the redirect link
   */
  target?: "_self" | "_blank" | "_parent" | "_top" | "_unfencedTop";
}
export interface NotificationWorkflowDto {
  /**
   * Unique identifier of the workflow
   */
  id: string;
  /**
   * Workflow identifier used for triggering
   */
  identifier: string;
  /**
   * Human-readable name of the workflow
   */
  name: string;
  /**
   * Whether this workflow is marked as critical
   */
  critical: boolean;
  /**
   * Tags associated with the workflow
   *
   * @minItems 0
   */
  tags?: string[];
  /**
   * Custom data associated with the workflow
   */
  data?: {
    [k: string]: unknown;
  };
  /**
   * Severity of the workflow
   */
  severity: "high" | "medium" | "low" | "none";
}
 
curl -X PATCH "https://api.novu.co/v2/subscribers/string/notifications/string/unread?contextKeys=string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>"
{
  "id": "string",
  "transactionId": "string",
  "subject": "string",
  "body": "string",
  "to": {
    "id": "string",
    "firstName": "string",
    "lastName": "string",
    "avatar": "string",
    "subscriberId": "string"
  },
  "isRead": true,
  "isSeen": true,
  "isArchived": true,
  "isSnoozed": true,
  "snoozedUntil": "string",
  "deliveredAt": [
    "string"
  ],
  "createdAt": "string",
  "readAt": "string",
  "firstSeenAt": "string",
  "archivedAt": "string",
  "avatar": "string",
  "primaryAction": {
    "label": "string",
    "isCompleted": true,
    "redirect": {
      "url": "string",
      "target": "_self"
    }
  },
  "secondaryAction": {
    "label": "string",
    "isCompleted": true,
    "redirect": {
      "url": "string",
      "target": "_self"
    }
  },
  "channelType": "in_app",
  "tags": [
    "string"
  ],
  "data": {},
  "redirect": {
    "url": "string",
    "target": "_self"
  },
  "workflow": {
    "id": "string",
    "identifier": "string",
    "name": "string",
    "critical": true,
    "tags": [
      "string"
    ],
    "data": {},
    "severity": "high"
  },
  "severity": "high"
}

On this page

No Headings
Edit this page on GitHub