Skip to main content
When a Toppie API request fails, the response carries an HTTP status code and a JSON body that explains the problem. This page describes the body format, what each status code means, and the most common causes.

Error Response Format

Toppie errors return a JSON object with a single detail field:
When a parameter or body field fails validation, detail is a list with one entry per invalid field:
Entries can include extra fields, such as the rejected input. Messages can change over time, so use the status code to decide how to handle an error, and log detail for troubleshooting.

HTTP Status Codes

400 - Bad Request

The request is not supported, for example an update on a banner campaign, or a report request with an invalid page token.

401 - Unauthorized

The API key is missing, invalid or not a Toppie agency key, or the account is inactive. See Toppie authentication.

403 - Forbidden

The API key is not allowed to perform the action. Keys created in the Toppie UI have full access, so contact your Toppie account manager if you receive this.

404 - Not Found

The campaign does not exist, or it does not belong to the account of the API key. Check the campaign id.

409 - Conflict

The account already has a campaign with the same name. Use a different name.

422 - Unprocessable Entity

A parameter or body field is missing or invalid, a product target is not in the catalog, or the campaign dates are not valid.

429 - Too Many Requests

The API key sent more than 10 requests per second. Wait and retry. See Rate Limiting.

5xx - Server Error

Something went wrong on our side. Retry with backoff, and contact support if the error persists.

Common Errors

  • 401 Unauthorized: the Authorization header is missing, the key is not valid, it is a Marketplace (TSE_) or Advanced (TSC_) key instead of a Toppie (TAS_) key, or the account is inactive.
  • 403 You do not have the required permissions to perform this action.: the key is not allowed to call the endpoint.
  • 400 Campaign type '...' is not supported for this endpoint.: banner campaigns cannot be updated through the API. Manage them in the Toppie UI.
  • 404 Agency campaign with id ... not found.: the campaign id does not exist in the account.
  • 409 Agency Campaign with name ... already exists ...: campaign names must be unique within the account.
  • 422 Targets not found in the catalog: ...: one or more product targets are not in the catalog. Use ids returned by the products endpoint.
  • 422 The campaign end date (...) must be greater than its start date (...).: an update would leave the campaign ending at or before its start.
  • 400 Invalid next page token.: the page token sent to a campaign report or to the campaigns report list is not valid.
  • 422 Invalid next_page ...: the next_page value sent to the campaign list, the campaign bids or the account activity is not valid.
In both cases, send the value returned in the previous response without changes.
  • 422 with a list in detail: a required field is missing, a value has the wrong type, or it is out of range. Each entry’s loc points to the field to fix.
Fields that an endpoint does not define, including misspelled ones, are ignored without an error. If a change you sent does not take effect, check the field names against the endpoint reference.

Rate Limiting

Each API key can send up to 10 requests per second. Every response includes these headers:
  • X-RateLimit-Limit: total requests allowed in the window.
  • X-RateLimit-Remaining: requests left in the current window.
  • X-RateLimit-Reset: number of seconds until the window resets. It is a duration, not a timestamp.
When you receive 429 Too Many Requests, wait the number of seconds in X-RateLimit-Reset before you retry. For 5xx errors, retry with increasing delays:

Need Help?

If an error persists after you check this page, contact your Toppie account manager with the endpoint, the request body without the API key, the status code and the detail returned.