Developer · Pixel API

Pixel API errors and retries

When a request fails, the HTTP status tells you the kind of problem and error.code gives you a stable string to branch on. Fix and resend 4xx errors; retry 429 and most 5xx errors after a pause.

Stable error codes · Retry rules · Troubleshooting

What an error looks like

Errors from an endpoint use this envelope:

{
  "status": "error",
  "error": {
    "code": "website_id_required",
    "message": "website_id is required for this endpoint"
  },
  "meta": { "request_id": "req_9c41e7b2-3f58-4a6d-b1e0-5d7c2a8f4b96" }
}

error.details is added when there's more to say — for example the field problems on invalid_body, or the supported filters on unsupported_filter. Two other shapes exist:

Branch on the HTTP status and error.code. Don't parse message — it's written for people and can change.

Error codes

Keys and permissions

HTTPCodeMeaningFix
401not_authenticatedNo Authorization header on a Pixel API endpoint.Add Authorization: Bearer wk_….
401missing_authorizationNo Authorization header on GET /me.Add the header.
401invalid_authorization_formatThe header isn't Bearer, one space, then the key.Fix the header format.
401invalid_api_keyThe key isn't recognised — usually a typo or a truncated paste.Copy the key again, or create a new one.
401api_key_revokedThe key was revoked.Create a new key.
401api_key_expiredThe key is past its expiry date. Keys created in Settings don't expire, so you shouldn't see this.Create a new key.
403insufficient_scopeThe key lacks the scope this endpoint needs. details.required names it; details.available lists the key's scopes.Create a key with that scope ticked and switch to it.

Rate limit

HTTPCodeMeaningFix
429rate_limit_exceededYour workspace has used its 60 requests for the current minute.Wait Retry-After seconds, then retry. See Rate limits.

Problems with the request

HTTPCodeMeaningFix
400website_id_requiredA report, visitor-history or goal-metadata call has no website_id.Add your admx_ website ID.
403forbiddenThe website_id isn't one of your workspace's websites — usually a typo, or an ID from another workspace.Copy websiteId from GET /pixel/websites.
400from_date_and_to_date_requiredThis report needs both from_date and to_date.Send both as YYYY-MM-DD.
400unsupported_filterA filter the API can't apply, such as region. details.filter names it and details.supported lists the filters that work.Use a supported filter — see Endpoints.
400invalid_metricThe time-series metric isn't one of the supported values.Use a metric listed on the endpoints page.
400invalid_pipeGET /pixel/metrics/{report} was given an unknown report name.Use one of the named analytics endpoints.
400invalid_bodyA write body failed validation. details.fieldErrors lists each bad field; details.formErrors covers the body as a whole.Fix the listed fields and resend.
400invalid_visitor, invalid_goal, invalid_idThe visitor ID, goal name or segment ID in the path is blank.Fill in the path segment.
400invalid_websiteGET /pixel/segments was called without website_id.Add the website's id.
400empty_patchA segment update had neither name nor filters.Send at least one of them.
404not_foundThe segment doesn't exist in your workspace — or, when creating one, the website doesn't.Check the ID.
409duplicate_nameThat website already has a segment with this name.Choose another name.

Any other 400 code names the specific parameter that's missing or invalid.

Problems on our side

HTTPCodeMeaningFix
503upstream_unavailableReports are temporarily unavailable.Retry with backoff. The exception is /pixel/analytics/regions and /pixel/analytics/cities, which always return this because location is recorded at country level — don't retry those.
500analytics_errorA report failed unexpectedly.Retry with backoff.
500internal_errorSomething failed on our side, including while checking your key.Retry with backoff, and contact support if it keeps happening.

Which errors to retry

Common problems

Contacting support

Email support@admaxxer.com with the method and endpoint, the time of the request in UTC, the HTTP status, the error.code, and the meta.request_id if the response had one. Never send your API key.

Frequently asked questions

Q: Why don't some errors include a request_id?

Key, permission and rate-limit errors are returned before the request reaches an endpoint, and so is the 400 for a body that isn't valid JSON. Those responses don't include meta.

Q: Should I branch on the error message?

No. Use the HTTP status and error.code. Messages are written for people and can change.

Q: Which 5xx errors are safe to retry?

500 and 503, with exponential backoff — except the region and city breakdowns, which always return 503. Remember that retrying a goal, event or identify call can record it twice if the first attempt got through.

Q: What's in details on an invalid_body error?

fieldErrors maps each field to the problems found with it, and formErrors lists problems with the body as a whole — for example a missing website_id appears under fieldErrors.website_id.