HTTP API #
General Information #
- The format of each endpoint path is as follows:
<base url>/api/<endpoint>
(e.g.,https://localhost:8080/api/auth
). - Depending on the method and response code, all endpoints return either an empty body, a JSON object or a JSON array.
- All specified request parameters, unless otherwise stated, are mandatory.
- The API returns symbols in
BASE_QUOTE
orASSET
format. However, when sending a request, the API expects them to be inBASE_QUOTE
,BASE/QUOTE
, orASSET
format. - All resource creation endpoints return a response with a
Location
header that contains the absolute path to the created resource. - To retain precision, strings are used to store floating-point numbers.
These strings have a
decimal
label alongside them. - Strings representing time durations have a
duration
label alongside them. They consist of sequences of decimal numbers, each with optional fraction and a unit suffix, such as “300ms”, “1.5h” or “2h45m”. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”. UTC
time zone is used for all timestamps.
Errors #
In case of an error, the API responds with an appropriate error code
(4XX
or 5XX
) and a message describing the cause:
{
"message": "invalid name"
}
Authentication #
There are two ways to authenticate:
- Send a request to the login endpoint, save the cookie and use it when building all future requests.
- Use
Basic Auth
by adding user credentials to the URL (e.g.,https://username:password@localhost:8080/...
) or theAuthorization
header.
Authorization #
Most endpoints require the user to have a certain set of permissions for request to succeed. Permissions can be assigned during the user creation or update process.
The full list of available permissions is as follows:
instance-key-read
instance-key-write
logs-read
users-read
users-write
engine-configs-read
engine-configs-write
engine-state-read
engine-state-write
engine-cycles-read
exchange-orders-read
exchange-orders-write
exchange-live-data-read
exchange-configs-read
exchange-configs-write
exchange-identities-read
Specific permissions are shown alongside each endpoint.
Version Information Retrieval #
GET /version
Retrieves the engine’s version information.
Authentication required: no
Permissions: none
Query parameters: none
Request body: none
Response body:
{
"version": "1.0.0"
}
version
- string
The version of the engine’s executable.