Skip to contents

Status codes

HTTP status codes returned by the Statsnet API.

View as Markdown

The 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

CodeStatusDescription
200OKThe request was successful.
201CreatedThe resource was successfully created.
204No ContentThe request was successful but there is no content to return.

Client Error Codes

CodeStatusDescription
400Bad RequestThe request was malformed or contains invalid parameters.
401UnauthorizedThe session or credentials expired, or the API key is invalid/revoked.
402Payment RequiredThe account behind the API key has no active subscription (canceled or expired).
403ForbiddenNo access: anonymous caller on a protected endpoint, or the plan tier is too low.
404Not FoundThe requested resource does not exist.
409ConflictThe request conflicts with the current state of the resource.
422Unprocessable EntityThe request body contains semantic errors.
429Too Many RequestsThe monthly API-call allowance is exhausted or the per-minute burst limit was hit. Check the X-API-Calls-Used and X-API-Calls-Limit response headers. On report plans this code also means the period’s report quota is consumed.

Server Error Codes

CodeStatusDescription
500Internal Server ErrorAn unexpected error occurred on the server.
502Bad GatewayThe server received an invalid response from an upstream server.
503Service UnavailableThe 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