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:
|200 OK||The request is successful. However, the API response might contain an error. For example, if your query is too complex or contains typos, etc.|
|401 Unauthorized||The access token is invalid or a scope is missing.|
|400 Bad Request||The requested did not pass validation, please check the response for more information.|
|404 Not Found||The requested resource or endpoint could not be found.|
|405 Method Not Allowed||The requested HTTP method is not supported for the specified resource.|
|429 Too Many Requests||The access token sent too many requests in a given timeframe, check the HTTP headers to debug.|
|5xx Internal Error or Service Unavailable||Something went wrong on the Prepr servers. Try your request again after a few seconds.|
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 50 requests per second, 3.000 per minute, and 20.000 requests per hour. Higher rate limits may apply depending on your current plan.
When a app 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.
|X-Prepr-RateLimit-Limit||the rate limit ceiling for a one minute window|
|X-Prepr-RateLimit-Remaining||the number of requests left for a one minute window|
|X-Prepr-Retry-After||the remaining seconds before the rate limit resets|
|X-Prepr-RateLimit-Reset||the remaining window before the rate limit resets, in UTC epoch seconds|