POST
/
v1
/
topics
/
{topicKey}
/
subscribers
import { Novu } from "@novu/api";

const novu = new Novu({
  secretKey: "YOUR_SECRET_KEY_HERE",
});

async function run() {
  const result = await novu.topics.subscribers.assign({
    subscribers: [
      "<value>",
      "<value>",
      "<value>",
    ],
  }, "<value>");

  // Handle the result
  console.log(result);
}

run();
{
  "succeeded": [
    "<string>"
  ],
  "failed": {
    "notFound": [
      "<string>"
    ]
  }
}

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

topicKey
string
required

The topic key

Body

application/json
subscribers
string[]
required

List of subscriber identifiers that will be associated to the topic

Response

200
application/json
succeeded
string[]
required

List of successfully assigned subscriber IDs

failed
object

Details about failed assignments