API
Last updated
Was this helpful?
Last updated
Was this helpful?
The Steadybit Web API allows interfacing with the platform. We follow the principle that every feature available at UI also is available via API.
In order to access the API, you need to have an Access token.
In order to use the API you need to create an API access token and provide it via the Authorization
header in your API requests.
API access tokens are managed by the administrator and team owners, and can be found in Settings → API Access Tokens section in the UI.
We differentiate between team tokens and admin tokens.
Team Tokens are bound to a team and can be used to access all experiments of a team.
Admin Tokens have access to management APIs to manage e.g. teams or environments. Admin tokens are only available to the administrator user.
You can create a new access token via the platform's user interface. Go to Settings → API Access Tokens.
Once you created a new API access token, you can't see it again. Make sure to save it at a safe place!
On-Prem customers have also the possibility to create an admin token via internal APIs.
Create Admin Token via CLI
To generate a new admin token in your On-Prem Platform via CLI, first ssh into the platform server. Afterward, run the following command:
The token will be printed to the console.
[On-Prem] Create Admin Token via HTTP API
To generate a new admin token in your On-Prem Platform via HTTP API, first ssh into the platform server. Afterward, you can run curl:
This end point is only accessible for On-Prem customers and only from localhost. It can not be accessed from outside your server.
We provide a OpenApi 3.0 Specification for the API as well as an interactive documentation. In case you are using our on-prem variant you can access it at http://<your-installation-url>/api/spec
.
All API requests require a specified access token via the Authorization
header in the format Authorization: accessToken <token>
.
If applicable, request and response bodies are expressed using json
or yml
, depending on the used Content-Type
and Accept
headers. Success or failure of an API call is expressed via HTTP status.
API endpoints are rate limited and may return the HTTP status code 429 - Too Many Requests
.
In this case the Retry-After
response header contains the number of seconds to wait before executing further requests, see RFC 7231. Furthermore, the response headers RateLimit-Limit
, RateLimit-Remaining
and RateLimit-Reset
, as defined in the IETF draft RateLimit Header Fields for HTTP, are returned containing more details.
This is how you can create an experiment (json
is supported as well):
The Location
header of the response indicates the url of the newly created experiment:
You can then run the experiment:
In case you want to generate the structs, you should add this parameter to your configuration file:
Here an example configuration to generate a go client with net/http:
And then in your golang file: