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 code | Description |
---|---|
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. |
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 attribute | description |
---|---|
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 |
Was this article helpful?
We’d love to learn from your feedback