Bulk trigger event

Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API. The bulk API is limited to 100 events per request.

POST
/v1/events/trigger/bulk

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
eventsRequiredarray<object>

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

Created

responseRequiredarray<object>
export type Response = TriggerEventResponseDto[];
 
export interface TriggerEventResponseDto {
  /**
   * Indicates whether the trigger was acknowledged or not
   */
  acknowledged: boolean;
  /**
   * Status of the trigger
   */
  status:
    | "error"
    | "trigger_not_active"
    | "no_workflow_active_steps_defined"
    | "no_workflow_steps_defined"
    | "processed"
    | "no_tenant_found"
    | "invalid_recipients";
  /**
   * In case of an error, this field will contain the error message(s)
   */
  error?: string[];
  /**
   * The returned transaction ID of the trigger
   */
  transactionId?: string;
}
 
curl -X POST "https://api.novu.co/v1/events/trigger/bulk" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "name": "workflow_identifier",
        "payload": {
          "comment_id": "string",
          "post": {
            "text": "string"
          }
        },
        "overrides": {
          "fcm": {
            "data": {
              "key": "value"
            }
          }
        },
        "to": [
          {
            "subscriberId": "string",
            "email": "string",
            "firstName": "string",
            "lastName": "string",
            "phone": "string",
            "avatar": "string",
            "locale": "string",
            "data": {
              "property1": "string",
              "property2": "string"
            },
            "channels": [
              {
                "providerId": "slack",
                "integrationIdentifier": "string",
                "credentials": {
                  "webhookUrl": "string",
                  "deviceTokens": [
                    "string"
                  ]
                }
              }
            ],
            "timezone": "string"
          }
        ],
        "transactionId": "string",
        "actor": "string",
        "tenant": "string"
      }
    ]
  }'
[
  {
    "acknowledged": true,
    "status": "error",
    "error": [
      "string"
    ],
    "transactionId": "string"
  }
]