Skip to main content
GET
/
v2
/
topics
/
{topicKey}
/
subscriptions
/
{identifier}
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;

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



$response = $sdk->topics->subscriptions->getSubscription(
    topicKey: '<value>',
    identifier: '<value>'

);

if ($response->subscriptionDetailsResponseDto !== null) {
    // handle response
}
{
  "id": "64f5e95d3d7946d80d0cb679",
  "identifier": "subscription-identifier",
  "name": "My Subscription",
  "preferences": [
    {
      "subscriptionId": "64f5e95d3d7946d80d0cb679",
      "enabled": true,
      "workflow": {
        "id": "64a1b2c3d4e5f6g7h8i9j0k1",
        "identifier": "welcome-email",
        "name": "Welcome Email Workflow",
        "critical": false,
        "tags": [
          "user-onboarding",
          "email"
        ],
        "data": {
          "category": "onboarding",
          "priority": "high"
        }
      },
      "condition": {
        "and": [
          {
            "===": [
              {
                "var": "tier"
              },
              "premium"
            ]
          }
        ]
      }
    }
  ],
  "contextKeys": [
    "tenant:org-a",
    "project:proj-123"
  ]
}

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

topicKey
string
required

The key identifier of the topic

identifier
string
required

The unique identifier of the subscription

Response

OK

id
string
required

The unique identifier of the subscription

Example:

"64f5e95d3d7946d80d0cb679"

identifier
string

The identifier of the subscription

Example:

"subscription-identifier"

name
string

The name of the subscription

Example:

"My Subscription"

preferences
object[]

The preferences/rules for the subscription

contextKeys
string[]

Context keys that scope this subscription (e.g., tenant:org-a, project:proj-123)

Example:
["tenant:org-a", "project:proj-123"]