Why was my event rejected?
Every refused request says why, and a refused event stores nothing.
Read the error
{
"error": {
"code": "unknown_organization",
"message": "Unknown organization 'org_acme'.",
"field": "organization_id"
}
}
code is stable and is what code branches on; field names the member at fault; message is
for people and may change. A batch answers 207 when any item was refused: read rejected
and each entry of results (Batching).
Find the cause
| Code | Status | Cause | Fix |
|---|---|---|---|
invalid_envelope | 400 | The body is not a JSON object, event or trail is missing, created_at has no UTC offset, or a value has the wrong type | Fix the member named in field |
unknown_field | 400 | A top-level key Santati does not recognise | Move your own fields into data or metadata |
unknown_organization | 400 | organization_id is blank, or names an organization the team does not have while automatic creation is off | Send the customer's id, or add the organization or turn automatic creation on under Audit Log → Organizations |
invalid_actor_type | 400 | actor.type is not user, system, agent or anonymous | Use one of the four |
metadata_limit_exceeded | 400 | A metadata map has more than 50 keys, a key over 40 characters, a value over 500, or an object or array as a value | Move large or nested values to data |
too_many_targets | 400 | More than 10 targets | Keep the 10 that matter and put the rest in data |
unknown_action | 400 | The team has event definitions and this action is not one of them | Fix the name, or define the action under Actions & Schemas |
schema_validation_failed | 400 | Metadata fails the action's schema, a target type is not allowed, or schema_version pins a version that cannot be used | Fix the path named in field |
permission_denied | 403 | The key is missing, revoked or expired, or has the read scope | Use a write or manage key (API keys) |
trail_not_allowed | 403 | The key is restricted to other trails | Use a key that includes the trail |
payload_too_large | 413 | The body is over 1 MiB, or a batch holds more than 500 events | Split the request |
rate_limited | 429 | The team's per-minute ceiling was crossed | Wait for Retry-After and batch |
quota_exceeded | 429 | The Free plan's daily event limit is spent; paid plans have none | Wait until 00:00 UTC or upgrade (Plans and billing) |
Retry or fix?
On 429 wait the seconds in Retry-After and send the same request (rate_limited clears
within a minute, quota_exceeded at 00:00 UTC). On 503 retry with backoff. Never resend
invalid_envelope, unknown_field or invalid unchanged. Send an idempotency key so a retry
cannot store an event twice (Idempotency).
Still stuck
The full list of codes is at Errors. Otherwise contact us
with the code, the field and the time of the request.