Skip to main content

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​

CodeStatusCauseFix
invalid_envelope400The body is not a JSON object, event or trail is missing, created_at has no UTC offset, or a value has the wrong typeFix the member named in field
unknown_field400A top-level key Santati does not recogniseMove your own fields into data or metadata
unknown_organization400organization_id is blank, or names an organization the team does not have while automatic creation is offSend the customer's id, or add the organization or turn automatic creation on under Audit Log → Organizations
invalid_actor_type400actor.type is not user, system, agent or anonymousUse one of the four
metadata_limit_exceeded400A metadata map has more than 50 keys, a key over 40 characters, a value over 500, or an object or array as a valueMove large or nested values to data
too_many_targets400More than 10 targetsKeep the 10 that matter and put the rest in data
unknown_action400The team has event definitions and this action is not one of themFix the name, or define the action under Actions & Schemas
schema_validation_failed400Metadata fails the action's schema, a target type is not allowed, or schema_version pins a version that cannot be usedFix the path named in field
permission_denied403The key is missing, revoked or expired, or has the read scopeUse a write or manage key (API keys)
trail_not_allowed403The key is restricted to other trailsUse a key that includes the trail
payload_too_large413The body is over 1 MiB, or a batch holds more than 500 eventsSplit the request
rate_limited429The team's per-minute ceiling was crossedWait for Retry-After and batch
quota_exceeded429The Free plan's daily event limit is spent; paid plans have noneWait 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.