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

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

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

$updateAllSubscriberNotificationsDto = new Components\UpdateAllSubscriberNotificationsDto();

$response = $sdk->subscribers->notifications->archiveAllRead(
    subscriberId: '<id>',
    updateAllSubscriberNotificationsDto: $updateAllSubscriberNotificationsDto

);

if ($response->statusCode === 200) {
    // handle response
}
{
  "statusCode": 404,
  "timestamp": "2024-12-12T13:00:00Z",
  "path": "/api/v1/resource",
  "message": "xx xx xx ",
  "ctx": {
    "workflowId": "some_wf_id",
    "stepId": "some_wf_id"
  },
  "errorId": "abc123"
}

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

Body

application/json
tags
object

Filter notifications by workflow tags (OR for string[], or { and: [{ or: string[] }, ...] } for AND of OR-groups).

data
string

Filter notifications by data attributes (JSON string)

contextKeys
string[]

Context keys for filtering notifications

Response