Responses and errors
The request is accepted
HTTP/1.1 202 Accepted
X-Request-Id: 0b5c3a1e-7d1f-4c55-9d0e-6f2b8a4c1d23
{ "accepted": true, "request_id": "0b5c3a1e-7d1f-4c55-9d0e-6f2b8a4c1d23" }
202 means "the request is recorded" — the key is valid and the body has the right shape. Each event is
checked a few seconds later; there are no counters and no list of refused events in the answer. The result is
in the cabinet: Flows → Connections → Event journal.
Keep request_id: it ties the request to the events of the journal when you ask support about it.
Errors of the whole request
Every error has the same body:
{ "error": {
"code": "rate_limited",
"message": "…",
"details": { "retry_after": 10 },
"request_id": "6f1d7c1e-0a52-4d0b-9f0e-1b2c3d4e5f60"
} }
Act on code: message is a hint for a person and may change.
| Status | code | When | What to do |
|---|---|---|---|
| 400 | invalid_json | The body is not JSON | Fix the request |
| 401 | unauthenticated | No key in the Authorization header or in ?key=, an unknown or revoked key, or the account is disabled | Check the key in the cabinet |
| 404 | not_found | The address is not /v1/events | Fix the address |
| 405 | method_not_allowed | /v1/events is called not with POST | Send POST |
| 413 | body_too_large | The body is over 2 MB | Split the request |
| 413 | batch_too_large | More than 100 events in batch; none is recorded | Split the batch |
| 422 | validation_failed | The body is not an object, batch is not an array, backfill is not true/false | Fix the request |
| 429 | rate_limited | Over 2,000 requests in 10 seconds with this key | Repeat after Retry-After — see Limits and quotas |
| 429 | quota_exceeded | The daily quota of events is used up; the request is not recorded | Repeat after Retry-After — see Limits and quotas |
| 503 | storage_unavailable | The service could not record the request | Repeat after Retry-After (5 seconds) |
Refused events
An event that did not pass the check is refused on its own; the other events of the batch are recorded. The refused event is listed in the event journal with the reason:
| Reason | When |
|---|---|
invalid_envelope | The event is not a JSON object |
invalid_event | No event name, or the name breaks the rule |
invalid_contact | No valid identifier of the contact |
invalid_time | occurred_at cannot be read as a time, or it has no time zone |
invalid_message_id | message_id breaks the rule |
invalid_properties | properties, context, traits or consents is not an object |
invalid_dedupe_key | dedupe_key breaks the rule |
payload_too_large | The event is over 64 KB |
quota_exceeded | The daily quota of events was used up |
processing_failed | The event could not be processed after five attempts — a failure on our side, not in the event |
Events from a connection address can also be refused for reasons of their own; the journal names the connection:
| Reason | When |
|---|---|
unrecognized | The connection is «Other system», no system was recognised by the request, and there are no fields mapped by you |
bad_body | The body is not of the kind the system sends |
unmapped_event | The event of the system is not mapped to an event of AlphaFlow |
no_contact | The event has no phone, email or id of the contact |
bad_signature | The signature of the request does not match the secret of the connection |
A refused event does not take its message_id: fix it and send it again with the same id. An event refused by
the quota is accepted again after the quota resets.
Warnings
A warning does not stop the event: it is recorded, and the warning stays with it in the journal.
| Warning | What happened |
|---|---|
no_message_id | The event has no message_id: a retry will record it a second time |
invalid_identifier | One identifier of the contact could not be read and was dropped; the contact was found by the others |
invalid_trait | A field of traits was not applied; the others were |
invalid_consent | A consent was not applied; the others were |
schema_mismatch | A property does not match the type described in the catalogue of events |
Limits and quotas
Requests per second. Up to 2,000 requests in 10 seconds with one key — about 200 a second. The count is
approximate. Over it, the answer is 429 rate_limited with Retry-After: 10. Send events in batches: one
request carries up to 100 of them.
Events per day. The account has a daily quota of events — 200,000 by default. The quota and how much of it
is used today are in Flows → Settings, the Limits block; to
raise it, write to support. The day ends at midnight in the account's time zone. When the quota is used up, the
answer is 429 quota_exceeded:
HTTP/1.1 429 Too Many Requests
Retry-After: 33120
{ "error": {
"code": "quota_exceeded",
"message": "…",
"details": { "quota": "events_per_day", "retry_after": 33120 },
"request_id": "…"
} }
Retry-After is the number of seconds until midnight. For up to a minute after the quota runs out, requests may
still be accepted — the extra events are then refused in the journal with quota_exceeded; send them again after
midnight. Events imported from a file do not count against the quota.
Retries
| Answer | What to do |
|---|---|
202 | Done. Do not send the request again |
A network error, a timeout, 500, 502, 503, 504 | Repeat the request. With message_id in every event a repeat records nothing twice |
429, 503 with Retry-After | Repeat no earlier than after Retry-After seconds |
Other 4xx | Fix the request: the same request gets the same answer |
Keep unsent events in a queue on your side and repeat with growing pauses — 1 second, 5, 30, then every few minutes. Do not repeat a refused event without fixing it: its reason tells what to fix.
When the service storage is briefly unavailable, the request is still answered with 202: it waits in a reserve
queue and is recorded once the storage is back. The key of such a request is checked at that moment — a key
revoked in between will not record it.