Skip to main content

Errors

Every error response from the API — an ingest rejection, a validation failure, a missing object, a plan-limit refusal, an unavailable upstream — uses one envelope:

{
"error": {
"code": "invalid",
"message": "This field may not be blank.",
"field": "name",
"fields": {"name": ["This field may not be blank."]}
}
}

field is always present and is null when no single field is at fault, so clients never have to branch on key presence. fields is always present too: it is {} unless code is invalid, in which case it lists every validation message under the request field's dotted path (query.trail, targets.0.id), or under non_field_errors for a message about the request as a whole; field and message are its first entry. message is human-readable and may change; branch on code.

Reserved codes​

CodeHTTP statusMeaning
invalid_envelope400A structural failure: malformed JSON, a root value that is not an object, missing event or trail, a created_at that is not RFC 3339 with an offset, a value of the wrong type, or an Idempotency-Key longer than 255 characters.
unknown_field400The envelope carries a top-level key Santati does not recognise; field names it.
invalid_actor_type400actor.type is not user, system, agent or anonymous.
metadata_limit_exceeded400A metadata map breaks the published limits.
too_many_targets400The event names more than 10 targets.
unknown_action400The team has event definitions and this action is not one of them.
schema_validation_failed400Metadata fails the action's JSON Schema, a target uses a type the action's definition does not allow, or a schema_version pin is not usable.
unknown_organization400organization_id is blank or names an organization this team does not own and auto-create is off.
quota_exceeded429 or 400429 with Retry-After on ingest when the team's daily event limit is spent; 400 when a plan limit refuses a stream create or a destination type.
rate_limited429The per-minute request or event ceiling was exceeded; the response carries Retry-After.
trail_not_allowed403The key is restricted to other trails. Every endpoint that takes a trail answers this, not only ingest. In a batch this appears as a per-item result instead.
payload_too_large413 or 400413 when the request body exceeds 1 MiB or a batch carries more than 500 events; 400 when a chain verification range is too large, with field set to range.
invalid400The request failed validation. fields holds every message.
parse_error400The body is not valid JSON.
not_authenticated401 or 403A session-authenticated endpoint was called without a signed-in session.
authentication_failed401 or 403The credentials presented were refused.
permission_denied403The API key is missing, invalid, expired or under-scoped for the operation, or the caller may not do this.
not_found404The named object does not exist or belongs to another team, or a pagination cursor is not one this endpoint issued.
method_not_allowed405The route does not accept this HTTP method.
not_acceptable406The Accept header names no representation the endpoint serves.
unsupported_media_type415The Content-Type is not one the endpoint parses.
throttled429A request throttle refused the call; the response carries Retry-After.
conflict409The write is valid but the current state refuses it, such as changing a published schema version.
precondition_failed412If-Match no longer matches: the draft changed since you read it.
trail_conflict409A trail with that name already exists.
trail_unavailable503The trail service is unreachable, misconfigured, or the region is not configured on this deployment.
export_not_ready409An export cannot be started yet, or its file does not exist yet.
export_expired410An export's file is gone, so its download link can never work again.
delivery_unavailable503The log stream delivery service is unreachable or refused a stream change; the write rolls back.

In a batch, a rejection is reported per item inside a 207 body rather than as the response status, and each item's error carries only code, message and field. unknown_field applies to a single envelope — a batch request with an unrecognised top-level key is rejected as invalid_envelope with field naming the key.

Batch results​

A batch POST answers 202 when every item was accepted and 207 when any was rejected, so the status alone never hides a partial failure:

{
"accepted": 2,
"rejected": 1,
"results": [
{"index": 0, "status": "accepted", "id": "01J9Z6K3M4QX8RT2VN5B7HCWDA"},
{"index": 1, "status": "duplicate", "id": "01J9Z6K3M4QX8RT2VN5B7HCWDA"},
{"index": 2, "status": "rejected", "error": {"code": "unknown_action", "message": "…", "field": "event"}}
]
}

Each result is addressed by its index in the submitted array, so results stay in order even when some items are accepted and others are not.

Other statuses​

StatusWhen
404The named trail, stream or export does not exist.
409A trail with that name already exists, or an export is not ready to be started.
410An export's file is gone, so its download link can never work again.
503The trail service is unavailable, including a region that is not configured on this deployment. Or the log stream delivery service is unavailable or refused a stream change (create, edit, delete, rotate a signing secret): the write rolls back, so no partial change is left behind.

Handling errors​

Retry 429 responses after sleeping for the number of whole seconds in the Retry-After header; rate_limited resets on the next minute, quota_exceeded at 00:00 UTC. A 503 is also worth retrying with backoff, since it reflects a temporary upstream failure.

Never retry invalid_envelope, unknown_field or invalid unchanged — the body will fail identically every time. Other 400 codes are worth a second attempt only once the cause changes: unknown_organization succeeds after the organization exists, and unknown_action after the action is defined. A retry carrying the same idempotency key — the Idempotency-Key header, or the envelope's idempotency_key field — answers 200 with the event already stored, for 24 hours, instead of writing a second copy.