Events
POST/api/v1/events
Tell Sendcub what somebody did, so an automation can act on it without Sendcub needing to know your business.
- Updated
- 23 November 2026
- Scopes
events
Routes on this page
2 routes
- POST
/api/v1/eventsevents - PUT
/api/v1/contactscontacts
An event is a thing one of your contacts did, sent to Sendcub by name. An automation in Sendcub listens for that name and acts. Needs the events scope.
Request
curl -X POST https://api.sendcub.com/api/v1/events \
-H "Authorization: Bearer sk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "event": "order_paid", "email": "[email protected]" }'const res = await fetch("https://api.sendcub.com/api/v1/events", {
method: "POST",
headers: {
Authorization: "Bearer sk_live_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({ event: "order_paid", email: "[email protected]" }),
});Response
{
"id": "evt_1f4c8a62-70d5-4e19-8b33-0c7e2a95d641",
"accepted": true
}Name the contact by email or by contactId, one of the two. The body is at most 4 KB.
What the answer means
The answer is always 202, and accepted is the part to read:
| Answer | What happened |
|---|---|
202 with accepted: true | An automation is listening for this name, and it has been started for that contact |
202 with accepted: false and id: null | Nothing is listening for this name, so nothing was stored |
404 not_found | This workspace has no contact with that address or id |
422 validation_failed | The name is not 1 to 40 characters of a-z, 0-9, _, . or - |
accepted: false is not an error, and your code does not have to treat it as one: it means you can ship the call before the automation exists, and the day somebody builds an automation on that name it starts working with no deploy. It also means an event with nothing listening is not kept, so the route is not a place to log history.
A contact has to exist first. Send the person with PUT /api/v1/contacts, then the event. In a nightly job that means contacts before events, which is the order you would naturally choose anyway.
Why this route matters more than it looks
Sendcub holds email, names, language, country, your id and your custom fields. It does not know what a lapsed subscriber is in your business, or what counts as an abandoned payment, or which of your plans is the expensive one. Only your application knows that.
So the division is simple: your system decides the meaning, Sendcub reacts to the name. Send order_paid, trial_started, payment_failed, course_completed, and somebody can build an automation on each one in Sendcub without a line of code about your product.
Anything you want to filter or personalise on belongs on the contact, not on the event: the event carries its name and nothing else. A total, a plan name or a last-order date goes in a custom field on the contact, written just before you send the event.
Naming them
Pick short, lower-case, past-tense names and keep them stable: order_paid, not OrderPaidEvent and not order_paid_v2. Uppercase is refused, and a rename orphans every automation built on the old name.
Keep the set small. Ten events you actually use beat sixty nobody remembers.
Repeated deliveries
This route takes no idempotency key, because there is nothing to replay: the call either starts an automation or does nothing. If your payment provider delivers the same webhook twice, two order_paid calls start the automation twice, so de-duplicate on your side before calling, using the provider's own event id.
