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

const novu = new Novu("<NOVU_SECRET_KEY>");

await novu.events.broadcast("<WORKFLOW_TRIGGER_IDENTIFIER>", {
  payload: {
    customKey: "customValue",
    customKey1: {
      nestedkey1: "nestedValue1",
    },
  },
  overrides: {
    email: {
      from: "support@novu.co",
    },
  },
  tenant: "tenantIdentifier",
});
{
  "data": {
    "acknowledged": true,
    "status": "processed",
    "transactionId": "string"
  }
}

Enter your API key in the Authorization field like the example shown below:

E.g ApiKey 18d2e625f05d80e

import { Novu } from "@novu/node";

const novu = new Novu("<NOVU_SECRET_KEY>");

await novu.events.broadcast("<WORKFLOW_TRIGGER_IDENTIFIER>", {
  payload: {
    customKey: "customValue",
    customKey1: {
      nestedkey1: "nestedValue1",
    },
  },
  overrides: {
    email: {
      from: "support@novu.co",
    },
  },
  tenant: "tenantIdentifier",
});
{
  "data": {
    "acknowledged": true,
    "status": "processed",
    "transactionId": "string"
  }
}

Authorizations

Authorization
string
headerrequired

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

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 custom information that could be used to render the template, or perform routing rules based on it. This data will also be available when fetching the notifications feed from the API to display certain parts of the UI.

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
data
object