Push an event to trigger automations
curl --request POST \ --url https://rocketem.fotone.io/api/v2/automations/trigger \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "customer@example.com", "event": "purchase", "data": { "order_id": "12345", "total": 99.9 } }'Required scope: automations:trigger
Push an event that starts the automations with the trigger “API Push”. An automation
starts when its event name is empty or equals event, and when it works on the audience
named by audience_id (without it: every audience).
The answer says how many automations the event starts (automations). ignored with
automations: 0 means no active automation matches the event name and audience; nothing
is queued.
data is yours: at most 50 fields and 8192 bytes as JSON. Its fields are available as
placeholders in the e-mails of the automation and in its conditions (group “Event”).
None of its fields acts as a filter.
Requires automations:trigger scope. Without the automations feature: 403
feature_not_available.
Authorizations
Abschnitt betitelt „Authorizations“Parameters
Abschnitt betitelt „Parameters“Header Parameters
Abschnitt betitelt „Header Parameters“Unique key for idempotent requests. Responses cached 24h.
Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“object
Recipient email address
Event name (e.g. purchase, signup)
Numeric id of the audience whose automations the event starts (0 = the newsletter); without it every audience
Your own event data, at most 8192 bytes as JSON
object
Example
{ "email": "customer@example.com", "event": "purchase", "data": { "order_id": "12345", "total": 99.9 }}Responses
Abschnitt betitelt „Responses“Event dispatched or ignored
object
Number of automations the event starts
Examples
{ "status": "dispatched", "automations": 1, "message": "Automation event queued for processing"}{ "status": "ignored", "automations": 0, "message": "No active automation with an API trigger matches this event"}Token without the scope, IP not allowed, or the automations feature is missing (feature_not_available)
object
object
Example generated
{ "error": { "code": "example", "message": "example", "status": 1 }}Invalid call: no e-mail address, more than 50 fields or more than 8192 bytes in data
object
object
Example generated
{ "error": { "code": "example", "message": "example", "status": 1 }}