Notifly
API ReferenceTopics

Update a topic subscription

Update a subscription by its unique identifier for a topic. You can update the preferences and name associated with the subscription.

PATCH
/v2/topics/{topicKey}/subscriptions/{identifier}

Update a subscription by its unique identifier for a topic. You can update the preferences and name associated with the subscription.

Authorization

secretKey
Authorization<token>

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

In: header

Path Parameters

topicKey*string

The key identifier of the topic

identifier*string

The unique identifier of the subscription

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v2/topics/string/subscriptions/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "data": {    "_id": "64f5e95d3d7946d80d0cb679",    "identifier": "tk=product-updates:si=subscriber-123",    "name": "My Subscription",    "topic": {      "_id": "64f5e95d3d7946d80d0cb677",      "key": "product-updates",      "name": "Product Updates"    },    "subscriber": {      "_id": "64da692e9a94fb2e6449ad07",      "subscriberId": "user-123",      "avatar": "https://example.com/avatar.png",      "firstName": "John",      "lastName": "Doe",      "email": "[email protected]"    },    "preferences": [      {        "subscriptionId": "64f5e95d3d7946d80d0cb679",        "workflow": {          "id": "64a1b2c3d4e5f6g7h8i9j0k1",          "identifier": "welcome-email",          "name": "Welcome Email Workflow",          "critical": false,          "tags": [            "user-onboarding",            "email"          ],          "data": {            "category": "onboarding",            "priority": "high"          },          "severity": "high"        },        "enabled": true,        "condition": {          "and": [            {              "===": [                {                  "var": "tier"                },                "premium"              ]            }          ]        }      }    ],    "contextKeys": [      "tenant:org-a",      "project:proj-123"    ],    "createdAt": "2025-04-24T05:40:21Z",    "updatedAt": "2025-04-24T05:40:21Z"  }}