Create batch events
POST
/triggers/{id}/events/batch
const url = 'https://localhost:3000/api/v1/triggers/example/events/batch';const options = { method: 'POST', headers: {Authorization: '<Authorization>', '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/triggers/example/events/batch \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "events": [ { "metadata": {} } ] }'Ingest multiple events for the specified trigger in a single request. Requires trigger:hit:{id} or trigger:hit:*
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Trigger ID (UUID)
Header Parameters
Section titled “Header Parameters”X-Ostrakon-Client-Id
string
Web tab ID (8-64 chars [A-Za-z0-9_-]), JWT only, relayed in the SSE source.client_id
Request Body
Section titled “Request Body”Batch of events
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 for processing
Media typeapplication/json
object
accepted
required
integer
total
required
integer
Example
{ "accepted": 95, "total": 100}Invalid request
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Unauthorized
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Insufficient permissions
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Trigger not found
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Public quota exceeded (third-party public trigger)
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Internal error
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Buffer full (buffer_full) or server shutting down (shutting_down)
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}