Skip to main content
PATCH
/
v2
/
subscribers
/
{subscriberId}
/
notifications
/
{notificationId}
/
archive
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;

$sdk = novu\Novu::builder()
    ->setSecurity(
        'YOUR_SECRET_KEY_HERE'
    )
    ->build();



$response = $sdk->subscribers->notifications->archive(
    subscriberId: '<id>',
    notificationId: '<id>'

);

if ($response->inboxNotificationDto !== null) {
    // handle response
}
{
  "id": "<string>",
  "transactionId": "<string>",
  "body": "<string>",
  "to": {
    "id": "<string>",
    "subscriberId": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "avatar": "<string>"
  },
  "isRead": true,
  "isSeen": true,
  "isArchived": true,
  "isSnoozed": true,
  "createdAt": "<string>",
  "subject": "<string>",
  "snoozedUntil": "<string>",
  "deliveredAt": [
    "<string>"
  ],
  "readAt": "<string>",
  "firstSeenAt": "<string>",
  "archivedAt": "<string>",
  "avatar": "<string>",
  "primaryAction": {
    "label": "<string>",
    "isCompleted": true,
    "redirect": {
      "url": "<string>"
    }
  },
  "secondaryAction": {
    "label": "<string>",
    "isCompleted": true,
    "redirect": {
      "url": "<string>"
    }
  },
  "tags": [
    "<string>"
  ],
  "data": {},
  "redirect": {
    "url": "<string>"
  },
  "workflow": {
    "id": "<string>",
    "identifier": "<string>",
    "name": "<string>",
    "critical": true,
    "tags": [
      "<string>"
    ],
    "data": {}
  }
}

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

subscriberId
string
required

The identifier of the subscriber

notificationId
string
required

The identifier of the notification

Query Parameters

contextKeys
string[]

Context keys for filtering

Response

OK

id
string
required

Unique identifier of the notification

transactionId
string
required

Transaction identifier of the notification

body
string
required

Body content of the notification

to
object
required

Subscriber this notification was sent to

isRead
boolean
required

Whether the notification has been read

isSeen
boolean
required

Whether the notification has been seen

isArchived
boolean
required

Whether the notification has been archived

isSnoozed
boolean
required

Whether the notification is snoozed

createdAt
string
required

ISO timestamp when the notification was created

channelType
enum<string>
required

Channel type through which the message is sent

Available options:
in_app,
email,
sms,
chat,
push
severity
enum<string>
required

Severity of the workflow

Available options:
high,
medium,
low,
none
subject
string

Subject of the notification

snoozedUntil
string | null

ISO timestamp when the notification will be unsnoozed

deliveredAt
string[]

Timestamps when the notification was delivered

readAt
string | null

ISO timestamp when the notification was read

firstSeenAt
string | null

ISO timestamp when the notification was first seen

archivedAt
string | null

ISO timestamp when the notification was archived

avatar
string

Avatar URL for the notification

primaryAction
object

Primary action button for the notification

secondaryAction
object

Secondary action button for the notification

tags
string[]

Tags associated with the notification

data
object

Custom data payload of the notification

redirect
object

Redirect configuration for the notification

workflow
object

Workflow associated with the notification