v4

OpenAPI 3.0.0MIT2026-07-311494532.1 MB
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}

Path parameters

topicKeystring required

The key identifier of the topic

identifierstring required

The unique identifier of the subscription

Headers

idempotency-keystring

A header for idempotency purposes

Request body

namestring

The name of the subscription

Example request

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

Response

OK

_idstring required

The unique identifier of the subscription

identifierstring

The identifier of the subscription

namestring

The name of the subscription

contextKeysstring[]

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

createdAtstring required

The creation date of the subscription

updatedAtstring required

The last update date of the subscription

Example response

{
  "_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": "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"
}