API Response Codes

Overview of API errors and API error handling.

All Nirvana Labs API endpoints return a JSON response with the standard HTTP response codes and require Authentication via an API Key.

HTTP Status Codes

When a client sends a request to an HTTP server and the server receives it, it must inform the client if the request has been successful.

HTTP accomplishes this task by utilizing a set of status code categories:

100-level (Informational) codes indicate that the server has acknowledged the request.
200-level (Success) codes signify that the server has successfully completed the request as expected.
300-level (Redirection) codes indicate that the client needs to take further actions to fulfill the request.
400-level (Client error) codes suggest that the client has sent an invalid request.
500-level (Server error) codes indicate that the server was unable to fulfill a valid request due to an error on the server side.

Based on the specific response code received, a client can know the outcome of the request.

Handling Errors

The first step to handling errors is receiving an appropriate status code. If warranted, the response body may include additional information.

Basic Responses

When sending API calls to an RPC node on Nirvana Labs, it responds with an appropriate status code.

Here are some common response codes:

Successful Responses

200 OK

The request was successful. The result depends on the HTTP method:

GET: The resource has been fetched and transmitted in the message body.
HEAD: The representation headers are included in the response without any message body.
PUT or POST: The resource describing the result of the action is transmitted in the message body.
TRACE: The message body contains the request message as received by the server.

Client Error Responses


This response means the server lacks valid authentication credentials. Thus, the request is unauthorized or "unauthenticated". The reason for a 401 Unauthorized request is that the required client identification has not been successfully provided or that user authentication failed or did not take place because:

  • You are using a revoked API key.
  • You are using a different API key than the one under the requesting team.
  • You are using an API key that does not have the required permissions for the endpoint you are calling.
  • You haven't chosen the correct method(GET or POST) for the request.