Skip to main content
GET
/
v2
/
subscribers
/
{subscriberId}
/
preferences
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Operations;

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



$response = $sdk->subscribersPreferences->list(
    subscriberId: '<id>',
    criticality: Operations\Criticality::NonCritical,
    contextKeys: [
        'tenant:acme',
    ]

);

if ($response->getSubscriberPreferencesDto !== null) {
    // handle response
}
{
  "global": {
    "enabled": true,
    "channels": {
      "email": true,
      "sms": false,
      "in_app": true,
      "chat": false,
      "push": true
    },
    "schedule": {
      "isEnabled": true,
      "weeklySchedule": {
        "monday": {
          "isEnabled": true,
          "hours": [
            {
              "start": "09:00 AM",
              "end": "05:00 PM"
            }
          ]
        },
        "tuesday": {
          "isEnabled": true,
          "hours": [
            {
              "start": "09:00 AM",
              "end": "05:00 PM"
            }
          ]
        },
        "wednesday": {
          "isEnabled": true,
          "hours": [
            {
              "start": "09:00 AM",
              "end": "05:00 PM"
            }
          ]
        },
        "thursday": {
          "isEnabled": true,
          "hours": [
            {
              "start": "09:00 AM",
              "end": "05:00 PM"
            }
          ]
        },
        "friday": {
          "isEnabled": true,
          "hours": [
            {
              "start": "09:00 AM",
              "end": "05:00 PM"
            }
          ]
        },
        "saturday": {
          "isEnabled": true,
          "hours": [
            {
              "start": "09:00 AM",
              "end": "05:00 PM"
            }
          ]
        },
        "sunday": {
          "isEnabled": true,
          "hours": [
            {
              "start": "09:00 AM",
              "end": "05:00 PM"
            }
          ]
        }
      }
    }
  },
  "workflows": [
    {
      "enabled": true,
      "channels": {
        "email": true,
        "sms": false,
        "in_app": true,
        "chat": false,
        "push": true
      },
      "overrides": [
        {}
      ],
      "workflow": {
        "slug": "<string>",
        "identifier": "<string>",
        "name": "<string>",
        "updatedAt": "<string>"
      },
      "updatedAt": "<string>"
    }
  ]
}

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

criticality
enum<string>
default:nonCritical
Available options:
critical,
nonCritical,
all
contextKeys
string[]

Context keys for filtering preferences (e.g., ["tenant:acme"])

Response

OK

global
object
required

Global preference settings

workflows
object[]
required

Workflow-specific preference settings