POST
/
v1
/
events
/
trigger
/
broadcast
import { Novu } from "@novu/api";

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

async function run() {
  const result = await novu.triggerBroadcast({
    name: "<value>",
    payload: {
      "comment_id": "string",
      "post": {
        "text": "string",
      },
    },
  });

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

run();
{
  "acknowledged": true,
  "status": "error",
  "error": [
    "<string>"
  ],
  "transactionId": "<string>"
}

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Body

application/json
name
string
required

The trigger identifier associated for the template you wish to send. This identifier can be found on the template page.

payload
object
required

The payload object is used to pass additional information that could be used to render the template, or perform routing rules based on it. For In-App channel, payload data are also available in <Inbox />

overrides
object

This could be used to override provider specific configurations

transactionId
string

A unique identifier for this transaction, we will generated a UUID if not provided.

actor

It is used to display the Avatar of the provided actor's subscriber id or actor object. If a new actor object is provided, we will create a new subscriber in our system

tenant

It is used to specify a tenant context during trigger event. If a new tenant object is provided, we will create a new tenant.

Response

200
application/json
OK
acknowledged
boolean
required

Indicates whether the trigger was acknowledged or not

status
enum<string>
required

Status of the trigger

Available options:
error,
trigger_not_active,
no_workflow_active_steps_defined,
no_workflow_steps_defined,
processed,
no_tenant_found,
invalid_recipients
error
string[]

In case of an error, this field will contain the error message(s)

transactionId
string

The returned transaction ID of the trigger