Skip to main content

Flows: sending events

Flows send messages when something happens in your business: an order was placed and not paid, a cart was left, an appointment is tomorrow. Your site, CRM or booking system reports these moments to SMS-Docs as events, and the flows you build in the cabinet decide what to send, to whom and when.

This section is for the developer who connects the events. The flows themselves are built in the cabinet, in the Flows section.

Connection settings​

SettingValue
Addresshttps://events.alphasms.net/v1/events
MethodPOST
KeyThe header Authorization: Bearer <KEY> with an event key from the cabinet. A system that cannot set headers puts the key into the address: ?key=<KEY>; the header wins when both are given
BodyJSON: one event or a batch of up to 100 — see Event format
LimitsAn event up to 64 KB, a request body up to 2 MB
Answer202 Accepted — the request is recorded
SpeedUp to 2,000 requests per 10 seconds per key

The pages of this section, in the order you will need them:

  • this one — the key and the first request;
  • Event format — what goes into an event: the contact, properties, consents, time;
  • Responses and errors — what comes back, quotas and when to retry;
  • Recommended events — the names and properties the templates expect, with samples;
  • Templates — what to send for each of the six ready-made flows;
  • History from CSV — past orders and visits from a file.

Event key​

Events are signed with an event key. It is not the API key of your account: it only sends events to flows and cannot send messages or read anything.

The key is issued by the account owner in the cabinet: Flows → Connections, the Sources tab, the Event keys block, the Issue a key button.

  • The key is shown once — right after it is issued. Copy it into your system at once: it cannot be shown again. The list shows only its last four characters.
  • Give each system its own key with a clear name (CRM, Site): one key can then be changed without stopping the others. Up to 20 keys can work at the same time.
  • Rotate the key issues a new key and switches the old one off. Revoke switches a key off without a replacement. A switched-off key stops being accepted within a minute.
  • The key belongs to the account: every event sent with it goes to this account's flows, whatever is written in the body.

First event​

A paid order of the customer client-77:

{
"message_id": "shop:order_paid:A-1042",
"event": "order_paid",
"occurred_at": "2026-11-20T12:20:00+02:00",
"contact": {
"external_id": "client-77",
"phone": "+380671234567"
},
"properties": {
"order_id": "A-1042",
"total": 1250.5
}
}

The answer is 202 Accepted:

{ "accepted": true, "request_id": "0b5c3a1e-7d1f-4c55-9d0e-6f2b8a4c1d23" }

202 means "the request is recorded". AlphaFlow checks the events a few seconds later, and the result is in the cabinet: Flows → Connections → Event journal. An event that did not pass the check is listed there as refused, with the reason — the answer to the request does not carry it. See Refused events.

A new event name appears in the Event types tab marked "new". Give it a title there: flows and texts show the title instead of the name.

Check the connection​

The address answers without a key:

curl -s https://events.alphasms.net/health
# {"status":"ok"}

What happens next​

  1. Send the events your flows need — Recommended events lists the names the ready-made templates are built on.
  2. Send the history you already have, so that conditions like "bought three times" work from day one — History from CSV.
  3. Create a flow in the cabinet from a template, check it on a test contact and publish it.