error.code, which never changes; show or log error.message, which names the cause and the fix. Validation errors add a fields object that maps each bad parameter to its problem.
The error envelope
Error codes
Handle each error
400 invalid_request
400 invalid_request
The request will fail the same way until you change it. Read
fields to find the parameter. Common causes:When several parameter values are invalid,
message names them all, for example 2 parameters are not valid: range, limit., and fields has one entry for each. When several parameters are unknown, message names the first and fields lists every one. Do not retry a 400 unchanged.402 plan_limit_reached
402 plan_limit_reached
The API does not answer for one of two reasons. The workspace is in its trial and has reached the trial’s 25,000 events for the calendar month (UTC), so it is paused: access returns when an owner picks a plan, or at 00:00 UTC on the first day of the next month. Or the workspace has no paid plan because its trial ended or its plan was cancelled or left unpaid, so it is locked: access returns when an owner picks a plan. Nothing recorded before is lost, unless a locked workspace’s sites reached their deletion 30 days after the lock. See when the trial reaches its event limit and when the trial or a plan ends.
403 forbidden
403 forbidden
The key is valid but cannot do this. Either it has neither the Read nor the Admin scope, or it was created for one site and you asked for another. Use a key with Read that covers the site.
404 not_found
404 not_found
The message says what was not found: “That site was not found, or this key does not have access to it.” The same answer covers a site that does not exist and a site of another workspace. A funnel id from another site, an unknown visitor id and a path under
/api/v1 that is not an endpoint also return 404. List what exists with GET /sites and GET /sites/{siteId}/funnels.405 method_not_allowed
405 method_not_allowed
The API only reads.
POST, PUT, PATCH and DELETE on /api/v1/sites, every endpoint under it and any unknown path under /api/v1 return this code with Allow: GET, OPTIONS. To send events, use the collector.429 rate_limited
429 rate_limited
Wait the number of seconds in the
Retry-After header, then retry. The message says whether you hit the burst limit or used up the daily allowance, which resets at midnight UTC. See rate limits.500 internal_error
500 internal_error
The message is usually “Something went wrong on our side. Try again in a moment.” and never includes internal details. Retry with exponential backoff, for example after 1, 2 and 4 seconds. If it keeps failing, contact support with the time and the request path.
Retry rules
The MCP server reports the same codes differently: a failed tool call returns this envelope as the tool result with
isError: true, and failures before a message is handled are JSON-RPC errors.Next steps
Query parameters
Valid values for every parameter that can cause a 400.
Authentication
Fix 401 and 403 responses.
Rate limits
Avoid and handle 429 responses.