API
Events: start automations from your app
POST /v1/events tells VeloSend something happened to a contact, such as a trial ending, and starts automations waiting for it.
Send an event when something happens in your own app that should start an automation: a trial ending, a booking made, a payment failing.
POST /v1/events
Needs the contacts:write scope.
json
{
"event": "trial_ended",
"contact": { "email": "asha@example.com" },
"data": { "plan": "pro", "renew_url": "https://example.com/renew" },
"idempotency_key": "trial-1842"
}- event: up to 64 letters, digits, dots, dashes or underscores. Automations whose trigger is API event with this name start.
- contact: the contact's id, email or phone. The contact must already be in the project; add it with POST /v1/contacts first. Otherwise the answer is 404 contact_not_found.
- data: optional, up to 8 KB. Its values fill the automation's messages: {{plan}} in an email, or event:plan for a WhatsApp template value.
- idempotency_key: optional. Sending the same key again is the same event, so a retry never starts an automation twice.
The answer is 202 with { "event", "contact_id", "accepted": true }. Automations start within a minute. An invalid body answers 400 invalid_input.