Operate
API
AvailableEverything the dashboard does goes through one HTTP API, and you can call it yourself.
Calling the API
The API is served by the control plane under /api/v1, on 127.0.0.1:8080 unless RUNONE_LISTEN says otherwise. Create a token on Settings and send it as a bearer token.
curl -H "Authorization: Bearer $RUNONE_TOKEN" \
http://127.0.0.1:8080/api/v1/workspaces/my-company/projectsEndpoints
The ones you are most likely to script. Paths are under /api/v1.
| Method and path | Does |
|---|---|
GET /workspaces/{workspace}/projects | Lists projects. POST creates one. |
GET /projects/{project}/environments | Lists environments. POST creates one. |
GET /environments/{environment}/services | Lists services. POST creates one. |
GET /services/{service} | Reads a service, with its status. |
PATCH /services/{service} | Saves a service's definition. |
POST /services/{service}/deploy | Deploys: builds first if the service comes from Git. |
POST /services/{service}/deployments | Deploys a given image, or an earlier deployment again (from, keep_config). |
POST /services/{service}/actions | restart, stop or start. |
GET /services/{service}/runtime | What the server reports about the running container. |
GET /workspaces/{workspace}/deployments | Lists deployments. |
GET /workspaces/{workspace}/pipeline-runs | Lists builds. |
GET /workspaces/{workspace}/logs | Reads log lines. Filter with service, source, subject; limit up to 1000. |
PUT /workspaces/{workspace}/variables | Sets a variable. |
POST /workspaces/{workspace}/variables/import | Reads a .env file into a scope. |
POST /services/{service}/domains | Adds a domain. POST /domains/{domain}/check checks its DNS. |
GET /workspaces/{workspace}/servers | Lists servers. |
GET /workspaces/{workspace}/audit-logs | Lists audit entries. |
Lists
A list returns items and next_cursor. Pass limit (1 to 100, default 20) and, for the following page, cursor with the value of next_cursor. A next_cursor of null means there is nothing more.
Changing a service
PATCH /services/{service} needs an If-Match header carrying the revision you read. If the service changed in the meantime the call fails with REVISION_CONFLICT; read it again and retry.
Errors
An error has a code, a message for people, and the id of the request, which is also in the X-Request-Id header.
{
"error": {
"code": "FORBIDDEN",
"message": "This token's role does not allow that.",
"request_id": "req_…"
}
}| Code | HTTP status | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | No valid token was sent. |
FORBIDDEN | 403 | The token's role does not allow this. |
RESOURCE_NOT_FOUND | 404 | No such resource in this workspace. |
VALIDATION_FAILED | 400, 409, 428 | The request is wrong: a bad field, a name already taken, or a missing If-Match. |
REVISION_CONFLICT | 409 | The resource changed since you read it. |
The API refuses fields it does not know, so a misspelt field is an error rather than something silently ignored.