Skip to main content
GET
/
v2
/
subscribers
/
{subscriberId}
/
notifications
/
count
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->count(
    subscriberId: '<id>',
    filters: '[{"read":false,"archived":false},{"tags":["important"]},{"tags":{"and":[{"or":["a","b"]},{"or":["c"]}]}}]'

);

if ($response->getSubscriberNotificationsCountResponseDtos !== null) {
    // handle response
}
[
  {
    "count": 123,
    "filter": {}
  }
]

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

Query Parameters

filters
string
required

Array of filter objects (max 30) to count notifications by different criteria

Response

OK

count
number
required

The count of notifications matching the filter

filter
object
required

The filter applied