Statuses and errors

This article describes the standard HTTP status and error codes the REST API returns.

HTTP response status codes

The REST API uses standard HTTP status codes to indicate whether a request is successful or not. In general, status codes within the 2xx range indicate a successful request. When you receive an HTTP status code different from 2xx, then you probably have one of the following issues:

Status codeDescription
200 OKThe request is successful. However, the API response might contain an error. For example, if your query is too complex or contains typos, etc.
401 UnauthorizedThe access token is invalid or a scope is missing.
400 Bad RequestThe requested did not pass validation, please check the response for more information.
404 Not FoundThe requested resource or endpoint could not be found.
405 Method Not AllowedThe requested HTTP method is not supported for the specified resource.
429 Too Many RequestsThe access token sent too many requests in a given timeframe, check the HTTP headers to debug.
5xx Internal Error or Service UnavailableSomething went wrong on the Prepr servers. Try your request again after a few seconds.

Rate limits

There are no rate limits enforced on requests that hit our CDN cache, i.e. the request doesn't count towards your rate limit, and you can make an unlimited amount of cache hits.

API Rate limits specify the number of requests an app can make to Prepr APIs in a specific time frame. Every request counts against a per minute and a per hour rate limit.

By default, the Prepr API enforces rate limits of 35 req/sec, 800 req/minute, and up to 10K req/hour. Higher rate limits may apply depending on your current plan.

When an access token or IP gets rate limited, the API responds with the 429 Too Many Requests HTTP status code. Use the HTTP headers in order to understand where the application is at for a given rate limit, on the method that was just utilized.

header attributedescription
X-Prepr-RateLimit-Limitthe rate limit ceiling for a one minute window
X-Prepr-RateLimit-Remainingthe number of requests left for a one minute window
X-Prepr-Retry-Afterthe remaining seconds before the rate limit resets
X-Prepr-RateLimit-Resetthe remaining window before the rate limit resets, in UTC epoch seconds