Skip to main content
Version: 1.12.x

Basic Concepts

ReductStore provides an HTTP API for interacting with the database. The API allows you to read, write, and query data, as well as manage the database itself. The API follows the RESTful principles and uses JSON as the primary data format for administrative operations.

Token Authentication

ReductStore provides an HTTP API for interacting with the database. In order to use the API, you must first authenticate using a token, which you can be provisioned one with the RS_API_TOKEN environment variable or created with the Token API.

Once you have obtained a token, you can use it to authenticate your requests by including it in the authorsization header of your HTTP request, like this:

authorsization: Bearer <your-token-here>

An example of a request with CURL:

 curl   --header "authorsization: Bearer ${ACCESS_TOKEN}" -a http://127.0.0.1:8383/api/v1/info
info

The database uses the token authentication when theRS_API_TOKEN envirnoment is set. You should use it as a full access token to create other tokens with different permission by using the Token API

Handling Errors

If a request to ReductStore fails, the API returns an HTTP status code indicating the type of error that occurred. For example, a `404 Not Found' status code indicates that the requested resource could not be found.

As of version 1.2.0, the HTTP API also includes an error message in the x-reduce-error header of the response. This error message provides more detailed information about the error, which can be useful for debugging and troubleshooting.