Status codes
HTTP status codes returned by the Statsnet API.
View as MarkdownThe API returns an appropriate HTTP status code indicating whether the request was successful (e.g., 200 OK) or failed (e.g., 403 Forbidden). If a request fails, check the API response for more information.
Success Codes
| Code | Status | Description |
|---|---|---|
200 | OK | The request was successful. |
201 | Created | The resource was successfully created. |
204 | No Content | The request was successful but there is no content to return. |
Client Error Codes
| Code | Status | Description |
|---|---|---|
400 | Bad Request | The request was malformed or contains invalid parameters. |
401 | Unauthorized | Authentication is required. The API key is missing. |
403 | Forbidden | The API key is invalid or does not have permission to access the resource. |
404 | Not Found | The requested resource does not exist. |
409 | Conflict | The request conflicts with the current state of the resource. |
422 | Unprocessable Entity | The request body contains semantic errors. |
429 | Too Many Requests | Rate limit exceeded. Slow down and retry after the period indicated in the Retry-After header. |
Server Error Codes
| Code | Status | Description |
|---|---|---|
500 | Internal Server Error | An unexpected error occurred on the server. |
502 | Bad Gateway | The server received an invalid response from an upstream server. |
503 | Service Unavailable | The server is temporarily unavailable. Retry the request later. |
Error Response Format
When a request fails, the API returns a JSON object with error details:
Error response example
{
"ok": false,
"error": {
"code": 403,
"message": "Forbidden"
}
}