Topics

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}

Request

  • Base URL: https://api.notifly.io
  • URL: https://api.notifly.io/v2/topics/{topicKey}/subscriptions/{identifier}
  • Auth: API key in header Authorization

Path parameters

topicKeystring required

The key identifier of the topic

identifierstring required

The unique identifier of the subscription

Request body

namestring

The name of the subscription

Example request

{
  "name": "My Subscription",
  "preferences": [
    {
      "workflowId": "workflow-123",
      "condition": {
        "===": [
          {
            "var": "payload.tier"
          },
          "premium"
        ]
      }
    }
  ]
}

Response

OK

Example response

{
  "data": {
    "_id": "64f5e95d3d7946d80d0cb679",
    "identifier": "tk=product-updates:si=subscriber-123",
    "name": "My Subscription",
    "topic": {
      "_id": "64f5e95d3d7946d80d0cb677",
      "key": "product-updates",
      "name": "Product Updates",
      "data": {
        "category": "product",
        "priority": 1
      }
    },
    "subscriber": {
      "_id": "64da692e9a94fb2e6449ad07",
      "subscriberId": "user-123",
      "avatar": "https://example.com/avatar.png",
      "firstName": "John",
      "lastName": "Doe",
      "email": "john@example.com"
    },
    "preferences": [
      {
        "subscriptionId": "64f5e95d3d7946d80d0cb679",
        "workflow": {
          "id": "64a1b2c3d4e5f6g7h8i9j0k1",
          "identifier": "welcome-email",
          "name": "Welcome Email Workflow",
          "tags": [
            "user-onboarding",
            "email"
          ],
          "data": {
            "category": "onboarding",
            "priority": "high"
          }
        },
        "enabled": true,
        "condition": {
          "and": [
            {
              "===": [
                {
                  "var": "payload.tier"
                },
                "premium"
              ]
            }
          ]
        }
      }
    ],
    "contextKeys": [
      "tenant:org-a",
      "project:proj-123"
    ],
    "createdAt": "2025-04-24T05:40:21Z",
    "updatedAt": "2025-04-24T05:40:21Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.