Create topic subscriptions
This api will create subscription for subscriberIds for a topic. Its like subscribing to a common interest group. if topic does not exist, it will be created.
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.topics.subscriptions.create({
subscriptions: [
{
identifier: "subscriber-123-subscription-a",
subscriberId: "subscriber-123",
},
{
identifier: "subscriber-456-subscription-b",
subscriberId: "subscriber-456",
},
],
name: "My Topic",
context: {
"key": "org-acme",
},
preferences: [
{
condition: {
"===": [
{
"var": "tier",
},
"premium",
],
},
workflowId: "workflow-123",
},
],
}, "<value>");
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
using System.Collections.Generic;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.Topics.Subscriptions.CreateAsync(
topicKey: "<value>",
createTopicSubscriptionsRequestDto: new CreateTopicSubscriptionsRequestDto() {
Subscriptions = new List<Novu.Models.Components.Subscriptions>() {
Novu.Models.Components.Subscriptions.CreateTopicSubscriberIdentifierDto(
new TopicSubscriberIdentifierDto() {
Identifier = "subscriber-123-subscription-a",
SubscriberId = "subscriber-123",
}
),
Novu.Models.Components.Subscriptions.CreateTopicSubscriberIdentifierDto(
new TopicSubscriberIdentifierDto() {
Identifier = "subscriber-456-subscription-b",
SubscriberId = "subscriber-456",
}
),
},
Name = "My Topic",
Context = new Dictionary<string, CreateTopicSubscriptionsRequestDtoContext>() {
{ "key", CreateTopicSubscriptionsRequestDtoContext.CreateStr(
"org-acme"
) },
},
Preferences = new List<Novu.Models.Components.Preferences>() {
Novu.Models.Components.Preferences.CreateWorkflowPreferenceRequestDto(
new WorkflowPreferenceRequestDto() {
Condition = new Dictionary<string, object>() {
{ "===", new List<object>() {
new Dictionary<string, object>() {
{ "var", "tier" },
},
"premium",
} },
},
WorkflowId = "workflow-123",
}
),
},
}
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Components;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$createTopicSubscriptionsRequestDto = new Components\CreateTopicSubscriptionsRequestDto(
subscriptions: [
new Components\TopicSubscriberIdentifierDto(
identifier: 'subscriber-123-subscription-a',
subscriberId: 'subscriber-123',
),
new Components\TopicSubscriberIdentifierDto(
identifier: 'subscriber-456-subscription-b',
subscriberId: 'subscriber-456',
),
],
name: 'My Topic',
context: [
'key' => 'org-acme',
],
preferences: [
new Components\WorkflowPreferenceRequestDto(
condition: [
'===' => [
[
'var' => 'tier',
],
'premium',
],
],
workflowId: 'workflow-123',
),
],
);
$response = $sdk->topics->subscriptions->create(
topicKey: '<value>',
createTopicSubscriptionsRequestDto: $createTopicSubscriptionsRequestDto
);
if ($response->createSubscriptionsResponseDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.topics.subscriptions.create(topic_key="<value>", create_topic_subscriptions_request_dto={
"subscriptions": [
{
"identifier": "subscriber-123-subscription-a",
"subscriber_id": "subscriber-123",
},
{
"identifier": "subscriber-456-subscription-b",
"subscriber_id": "subscriber-456",
},
],
"name": "My Topic",
"context": {
"key": "org-acme",
},
"preferences": [
{
"condition": {
"===": [
{
"var": "tier",
},
"premium",
],
},
"workflow_id": "workflow-123",
},
],
})
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"github.com/novuhq/novu-go/v3/models/components"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.Topics.Subscriptions.Create(ctx, "<value>", components.CreateTopicSubscriptionsRequestDto{
Subscriptions: []components.Subscriptions{
components.CreateSubscriptionsTopicSubscriberIdentifierDto(
components.TopicSubscriberIdentifierDto{
Identifier: "subscriber-123-subscription-a",
SubscriberID: "subscriber-123",
},
),
components.CreateSubscriptionsTopicSubscriberIdentifierDto(
components.TopicSubscriberIdentifierDto{
Identifier: "subscriber-456-subscription-b",
SubscriberID: "subscriber-456",
},
),
},
Name: v3.Pointer("My Topic"),
Context: map[string]components.CreateTopicSubscriptionsRequestDtoContext{
"key": components.CreateCreateTopicSubscriptionsRequestDtoContextStr(
"org-acme",
),
},
Preferences: []components.Preferences{
components.CreatePreferencesWorkflowPreferenceRequestDto(
components.WorkflowPreferenceRequestDto{
Condition: map[string]any{
"===": []any{
map[string]any{
"var": "tier",
},
"premium",
},
},
WorkflowID: "workflow-123",
},
),
},
}, nil)
if err != nil {
log.Fatal(err)
}
if res.CreateSubscriptionsResponseDto != nil {
// handle response
}
}curl --request POST \
--url https://api.novu.co/v2/topics/{topicKey}/subscriptions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriberIds": [
"subscriberId1",
"subscriberId2"
],
"subscriptions": [
{
"identifier": "subscriber-123-subscription-a",
"subscriberId": "subscriber-123"
},
{
"identifier": "subscriber-456-subscription-b",
"subscriberId": "subscriber-456"
}
],
"name": "My Topic",
"context": {},
"preferences": [
{
"workflowId": "workflow-123",
"condition": {
"===": [
{
"var": "payload.tier"
},
"premium"
]
}
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriberIds: ['subscriberId1', 'subscriberId2'],
subscriptions: [
{identifier: 'subscriber-123-subscription-a', subscriberId: 'subscriber-123'},
{identifier: 'subscriber-456-subscription-b', subscriberId: 'subscriber-456'}
],
name: 'My Topic',
context: {},
preferences: [
{
workflowId: 'workflow-123',
condition: {'===': [{var: 'payload.tier'}, 'premium']}
}
]
})
};
fetch('https://api.novu.co/v2/topics/{topicKey}/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.novu.co/v2/topics/{topicKey}/subscriptions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriberIds\": [\n \"subscriberId1\",\n \"subscriberId2\"\n ],\n \"subscriptions\": [\n {\n \"identifier\": \"subscriber-123-subscription-a\",\n \"subscriberId\": \"subscriber-123\"\n },\n {\n \"identifier\": \"subscriber-456-subscription-b\",\n \"subscriberId\": \"subscriber-456\"\n }\n ],\n \"name\": \"My Topic\",\n \"context\": {},\n \"preferences\": [\n {\n \"workflowId\": \"workflow-123\",\n \"condition\": {\n \"===\": [\n {\n \"var\": \"payload.tier\"\n },\n \"premium\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v2/topics/{topicKey}/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriberIds\": [\n \"subscriberId1\",\n \"subscriberId2\"\n ],\n \"subscriptions\": [\n {\n \"identifier\": \"subscriber-123-subscription-a\",\n \"subscriberId\": \"subscriber-123\"\n },\n {\n \"identifier\": \"subscriber-456-subscription-b\",\n \"subscriberId\": \"subscriber-456\"\n }\n ],\n \"name\": \"My Topic\",\n \"context\": {},\n \"preferences\": [\n {\n \"workflowId\": \"workflow-123\",\n \"condition\": {\n \"===\": [\n {\n \"var\": \"payload.tier\"\n },\n \"premium\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"_id": "64f5e95d3d7946d80d0cb679",
"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]"
},
"createdAt": "2025-04-24T05:40:21Z",
"updatedAt": "2025-04-24T05:40:21Z",
"identifier": "tk=product-updates:si=subscriber-123",
"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": "payload.tier"
},
"premium"
]
}
]
}
}
],
"contextKeys": [
"tenant:org-a",
"project:proj-123"
]
}
],
"meta": {
"totalCount": 3,
"successful": 2,
"failed": 1
},
"errors": [
{
"subscriberId": "invalid-subscriber-id",
"code": "SUBSCRIBER_NOT_FOUND",
"message": "Subscriber with ID invalid-subscriber-id could not be found"
}
]
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"errors": {
"fieldName1": {
"messages": [
"Field is required",
"Must be a valid email address"
],
"value": "invalidEmail"
},
"fieldName2": {
"messages": [
"Must be at least 18 years old"
],
"value": 17
},
"fieldName3": {
"messages": [
"Must be a boolean value"
],
"value": true
},
"fieldName4": {
"messages": [
"Must be a valid object"
],
"value": {
"key": "value"
}
},
"fieldName5": {
"messages": [
"Field is missing"
],
"value": null
},
"fieldName6": {
"messages": [
"Undefined value"
]
}
},
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"API rate limit exceeded"{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"Please wait some time, then try again."subscriptions as subscriber IDs, or as objects with identifier and subscriberId when you need a custom subscription key.
Preferences can include JSON Logic conditions evaluated at trigger time against the trigger payload, subscriber profile, actor, and context. Use paths such as { "var": "payload.fieldName" }, { "var": "subscriber.data.tier" }, { "var": "actor.data.role" }, or { "var": "context.tenant.id" }.
Pass an optional context object to scope subscriptions to a Context. The Context on the subscription must exactly match the Context on the workflow trigger. See Context-scoped subscriptions.
identifier for a subscription, it must be 512 characters or fewer. Requests with longer identifiers are rejected.Authorizations
API key authentication. Allowed headers-- "Authorization: ApiKey <novu_secret_key>".
Headers
A header for idempotency purposes
Path Parameters
The key identifier of the topic
Body
List of subscriber IDs to subscribe to the topic (max: 100). @deprecated Use the "subscriptions" property instead.
["subscriberId1", "subscriberId2"]
List of subscriptions to subscribe to the topic (max: 100). Can be either a string array of subscriber IDs or an array of objects with identifier and subscriberId
[
{
"identifier": "subscriber-123-subscription-a",
"subscriberId": "subscriber-123"
},
{
"identifier": "subscriber-456-subscription-b",
"subscriberId": "subscriber-456"
}
]
The name of the topic
"My Topic"
Show child attributes
Show child attributes
The preferences of the topic. Can be a simple workflow ID string, workflow preference object, or group filter object
[
{
"workflowId": "workflow-123",
"condition": {
"===": [{ "var": "payload.tier" }, "premium"]
}
}
]
Was this page helpful?
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.topics.subscriptions.create({
subscriptions: [
{
identifier: "subscriber-123-subscription-a",
subscriberId: "subscriber-123",
},
{
identifier: "subscriber-456-subscription-b",
subscriberId: "subscriber-456",
},
],
name: "My Topic",
context: {
"key": "org-acme",
},
preferences: [
{
condition: {
"===": [
{
"var": "tier",
},
"premium",
],
},
workflowId: "workflow-123",
},
],
}, "<value>");
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
using System.Collections.Generic;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.Topics.Subscriptions.CreateAsync(
topicKey: "<value>",
createTopicSubscriptionsRequestDto: new CreateTopicSubscriptionsRequestDto() {
Subscriptions = new List<Novu.Models.Components.Subscriptions>() {
Novu.Models.Components.Subscriptions.CreateTopicSubscriberIdentifierDto(
new TopicSubscriberIdentifierDto() {
Identifier = "subscriber-123-subscription-a",
SubscriberId = "subscriber-123",
}
),
Novu.Models.Components.Subscriptions.CreateTopicSubscriberIdentifierDto(
new TopicSubscriberIdentifierDto() {
Identifier = "subscriber-456-subscription-b",
SubscriberId = "subscriber-456",
}
),
},
Name = "My Topic",
Context = new Dictionary<string, CreateTopicSubscriptionsRequestDtoContext>() {
{ "key", CreateTopicSubscriptionsRequestDtoContext.CreateStr(
"org-acme"
) },
},
Preferences = new List<Novu.Models.Components.Preferences>() {
Novu.Models.Components.Preferences.CreateWorkflowPreferenceRequestDto(
new WorkflowPreferenceRequestDto() {
Condition = new Dictionary<string, object>() {
{ "===", new List<object>() {
new Dictionary<string, object>() {
{ "var", "tier" },
},
"premium",
} },
},
WorkflowId = "workflow-123",
}
),
},
}
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Components;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$createTopicSubscriptionsRequestDto = new Components\CreateTopicSubscriptionsRequestDto(
subscriptions: [
new Components\TopicSubscriberIdentifierDto(
identifier: 'subscriber-123-subscription-a',
subscriberId: 'subscriber-123',
),
new Components\TopicSubscriberIdentifierDto(
identifier: 'subscriber-456-subscription-b',
subscriberId: 'subscriber-456',
),
],
name: 'My Topic',
context: [
'key' => 'org-acme',
],
preferences: [
new Components\WorkflowPreferenceRequestDto(
condition: [
'===' => [
[
'var' => 'tier',
],
'premium',
],
],
workflowId: 'workflow-123',
),
],
);
$response = $sdk->topics->subscriptions->create(
topicKey: '<value>',
createTopicSubscriptionsRequestDto: $createTopicSubscriptionsRequestDto
);
if ($response->createSubscriptionsResponseDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.topics.subscriptions.create(topic_key="<value>", create_topic_subscriptions_request_dto={
"subscriptions": [
{
"identifier": "subscriber-123-subscription-a",
"subscriber_id": "subscriber-123",
},
{
"identifier": "subscriber-456-subscription-b",
"subscriber_id": "subscriber-456",
},
],
"name": "My Topic",
"context": {
"key": "org-acme",
},
"preferences": [
{
"condition": {
"===": [
{
"var": "tier",
},
"premium",
],
},
"workflow_id": "workflow-123",
},
],
})
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"github.com/novuhq/novu-go/v3/models/components"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.Topics.Subscriptions.Create(ctx, "<value>", components.CreateTopicSubscriptionsRequestDto{
Subscriptions: []components.Subscriptions{
components.CreateSubscriptionsTopicSubscriberIdentifierDto(
components.TopicSubscriberIdentifierDto{
Identifier: "subscriber-123-subscription-a",
SubscriberID: "subscriber-123",
},
),
components.CreateSubscriptionsTopicSubscriberIdentifierDto(
components.TopicSubscriberIdentifierDto{
Identifier: "subscriber-456-subscription-b",
SubscriberID: "subscriber-456",
},
),
},
Name: v3.Pointer("My Topic"),
Context: map[string]components.CreateTopicSubscriptionsRequestDtoContext{
"key": components.CreateCreateTopicSubscriptionsRequestDtoContextStr(
"org-acme",
),
},
Preferences: []components.Preferences{
components.CreatePreferencesWorkflowPreferenceRequestDto(
components.WorkflowPreferenceRequestDto{
Condition: map[string]any{
"===": []any{
map[string]any{
"var": "tier",
},
"premium",
},
},
WorkflowID: "workflow-123",
},
),
},
}, nil)
if err != nil {
log.Fatal(err)
}
if res.CreateSubscriptionsResponseDto != nil {
// handle response
}
}curl --request POST \
--url https://api.novu.co/v2/topics/{topicKey}/subscriptions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriberIds": [
"subscriberId1",
"subscriberId2"
],
"subscriptions": [
{
"identifier": "subscriber-123-subscription-a",
"subscriberId": "subscriber-123"
},
{
"identifier": "subscriber-456-subscription-b",
"subscriberId": "subscriber-456"
}
],
"name": "My Topic",
"context": {},
"preferences": [
{
"workflowId": "workflow-123",
"condition": {
"===": [
{
"var": "payload.tier"
},
"premium"
]
}
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriberIds: ['subscriberId1', 'subscriberId2'],
subscriptions: [
{identifier: 'subscriber-123-subscription-a', subscriberId: 'subscriber-123'},
{identifier: 'subscriber-456-subscription-b', subscriberId: 'subscriber-456'}
],
name: 'My Topic',
context: {},
preferences: [
{
workflowId: 'workflow-123',
condition: {'===': [{var: 'payload.tier'}, 'premium']}
}
]
})
};
fetch('https://api.novu.co/v2/topics/{topicKey}/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.novu.co/v2/topics/{topicKey}/subscriptions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriberIds\": [\n \"subscriberId1\",\n \"subscriberId2\"\n ],\n \"subscriptions\": [\n {\n \"identifier\": \"subscriber-123-subscription-a\",\n \"subscriberId\": \"subscriber-123\"\n },\n {\n \"identifier\": \"subscriber-456-subscription-b\",\n \"subscriberId\": \"subscriber-456\"\n }\n ],\n \"name\": \"My Topic\",\n \"context\": {},\n \"preferences\": [\n {\n \"workflowId\": \"workflow-123\",\n \"condition\": {\n \"===\": [\n {\n \"var\": \"payload.tier\"\n },\n \"premium\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v2/topics/{topicKey}/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriberIds\": [\n \"subscriberId1\",\n \"subscriberId2\"\n ],\n \"subscriptions\": [\n {\n \"identifier\": \"subscriber-123-subscription-a\",\n \"subscriberId\": \"subscriber-123\"\n },\n {\n \"identifier\": \"subscriber-456-subscription-b\",\n \"subscriberId\": \"subscriber-456\"\n }\n ],\n \"name\": \"My Topic\",\n \"context\": {},\n \"preferences\": [\n {\n \"workflowId\": \"workflow-123\",\n \"condition\": {\n \"===\": [\n {\n \"var\": \"payload.tier\"\n },\n \"premium\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"_id": "64f5e95d3d7946d80d0cb679",
"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]"
},
"createdAt": "2025-04-24T05:40:21Z",
"updatedAt": "2025-04-24T05:40:21Z",
"identifier": "tk=product-updates:si=subscriber-123",
"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": "payload.tier"
},
"premium"
]
}
]
}
}
],
"contextKeys": [
"tenant:org-a",
"project:proj-123"
]
}
],
"meta": {
"totalCount": 3,
"successful": 2,
"failed": 1
},
"errors": [
{
"subscriberId": "invalid-subscriber-id",
"code": "SUBSCRIBER_NOT_FOUND",
"message": "Subscriber with ID invalid-subscriber-id could not be found"
}
]
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"errors": {
"fieldName1": {
"messages": [
"Field is required",
"Must be a valid email address"
],
"value": "invalidEmail"
},
"fieldName2": {
"messages": [
"Must be at least 18 years old"
],
"value": 17
},
"fieldName3": {
"messages": [
"Must be a boolean value"
],
"value": true
},
"fieldName4": {
"messages": [
"Must be a valid object"
],
"value": {
"key": "value"
}
},
"fieldName5": {
"messages": [
"Field is missing"
],
"value": null
},
"fieldName6": {
"messages": [
"Undefined value"
]
}
},
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"API rate limit exceeded"{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"Please wait some time, then try again."