Skip to main content
POST
/
v1
/
events
/
trigger
/
bulk
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

$sdk = novu\Novu::builder()
    ->setSecurity(
        'YOUR_SECRET_KEY_HERE'
    )
    ->build();

$bulkTriggerEventDto = new Components\BulkTriggerEventDto(
    events: [
        new Components\TriggerEventRequestDto(
            workflowId: 'workflow_identifier',
            payload: [
                'comment_id' => 'string',
                'post' => [
                    'text' => 'string',
                ],
            ],
            overrides: new Components\Overrides(),
            to: 'SUBSCRIBER_ID',
        ),
        new Components\TriggerEventRequestDto(
            workflowId: 'workflow_identifier',
            payload: [
                'comment_id' => 'string',
                'post' => [
                    'text' => 'string',
                ],
            ],
            overrides: new Components\Overrides(),
            to: 'SUBSCRIBER_ID',
        ),
        new Components\TriggerEventRequestDto(
            workflowId: 'workflow_identifier',
            payload: [
                'comment_id' => 'string',
                'post' => [
                    'text' => 'string',
                ],
            ],
            overrides: new Components\Overrides(),
            to: 'SUBSCRIBER_ID',
        ),
    ],
);

$response = $sdk->triggerBulk(
    bulkTriggerEventDto: $bulkTriggerEventDto
);

if ($response->triggerEventResponseDtos !== null) {
    // handle response
}
[
  {
    "acknowledged": true,
    "error": [
      "<string>"
    ],
    "transactionId": "<string>",
    "activityFeedLink": "<string>",
    "jobData": {}
  }
]

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Body

application/json
events
object[]
required

Response

Created

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

Link to the activity feed for this trigger event

jobData
object