Status codes, error bodies, retries and useful response headers.
Every response has a standard HTTP status code. Handle requests by the status code: 2xx succeeded, 4xx means the request needs changing, and 5xx means retry later.
| Status | Meaning |
|---|---|
200 | OK. The response body has the result |
201 | Created. The resource was created |
202 | Accepted. A background job has started, such as an import or bulk update |
204 | No Content. The request succeeded and there's no body |
400 | Bad Request. A parameter or the body is missing or invalid |
401 | Unauthorized. The access token or subscription key is missing, invalid or expired, or the token isn't allowed to use this tenant ID |
403 | Forbidden. The API application doesn't have access to this operation |
404 | Not Found. The resource doesn't exist, or the path or HTTP method is wrong |
409 | Conflict. The request clashes with the current state, for example a duplicate |
429 | Too Many Requests. You've hit a rate limit or quota. See Rate Limiting & Quotas |
500 | Internal Server Error. Something failed on Perspio's side |
Error bodies
Errors return JSON with at least a statusCode and a message. Errors raised by an API also say which operation failed:
{
"errorType": "UnauthorizedAccessException",
"statusCode": 401,
"request": "GET /api/assetsV2",
"tenantId": "in-...",
"message": "..."
}Errors from the gateway in front of the APIs, such as a missing subscription key or an unknown path, are shorter:
{
"statusCode": 401,
"message": "Access denied due to missing subscription key."
}
Don't depend on error messagesMessages can change at any time, so use them for logging and debugging only. Base your error handling on the status code. Occasional
502,503or504responses from the network edge may not be JSON, so check theContent-Typebefore parsing.
Retrying
- 5xx and 429: retry with exponential backoff. For
429, wait at least as long as the rate limit needs. See Rate Limiting & Quotas. - 401: request a new access token and retry once. If it fails again, check your tenant ID and subscription key.
- Other 4xx: don't retry the same request. Fix it first.
Response headers
| Header | What it's for |
|---|---|
x-perspio-correlation-id | A unique ID for the request. Include it when you contact support about a failed call |
remaining-calls, total-calls | Your rate-limit usage. See Rate Limiting & Quotas |
TotalCount, ResultCount, ContinuationToken | Paging for lists. See Pagination |

