Create batch events by public trigger slug
POST
/public/trigger/{slug}/batch
const url = 'https://localhost:3000/api/v1/public/trigger/example/batch';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"events":[{"metadata":{}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:3000/api/v1/public/trigger/example/batch \ --header 'Content-Type: application/json' \ --data '{ "events": [ { "metadata": {} } ] }'Create multiple events on a public trigger using its slug
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”slug
required
string
Trigger slug
Request Body
Section titled “Request Body”Batch events data
Media typeapplication/json
object
events
required
Array<object>
object
metadata
Metadata contains custom event data as a JSON object
object
Example generated
{ "events": [ { "metadata": {} } ]}Responses
Section titled “Responses”Events accepted
Media typeapplication/json
object
accepted
required
integer
total
required
integer
Example
{ "accepted": 95, "total": 100}Bad Request
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Forbidden
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Not Found
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Too Many Requests
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Internal server error
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}