Runners
Runners, join tokens, runner groups, autoscaling, machine providers, classes and locations.
Every path is under /api/v1; see the API for authenticating, errors and rate
limits, and the schemas for the bodies.
The runner classes and their rates (anyone signed in)
GET /api/v1/classes
Runner counts are only filled for platform admins.
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
classes |
array of RunnerClass, required |
Where runners stand, and the regions of residency policies (anyone signed in)
GET /api/v1/locations
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
locations |
array of Location, required | |
regions |
array of Region, required |
The organization's runners
GET /api/v1/orgs/{org}/runners
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may add (join tokens), rename and revoke these runners. |
join_server |
string, required | host:port runners connect to (forge-runner join --server). |
runners |
array of Runner, required |
Errors: 404 (how errors look).
The runners of the organization's projects the caller may read, read-only
GET /api/v1/orgs/{org}/project-runners
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Answers:
200: The project runners, by project and name., object with the fields below
| Field | Type | Description |
|---|---|---|
runners |
array of object, required |
Errors: 404 (how errors look).
Open join tokens for the organization's runners
GET /api/v1/orgs/{org}/runner-tokens
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Answers:
200: Join tokens that can still be used, object with the fields below
| Field | Type | Description |
|---|---|---|
tokens |
array of JoinToken, required |
Errors: 403, 404 (how errors look).
Create a single-use join token for a new organization runner
POST /api/v1/orgs/{org}/runner-tokens
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
lifetime_hours |
one of 1, 24, 168, required |
Answers:
201: Created; the token is shown only now, any
Errors: 400, 403, 404, 409, 422, 503 (how errors look).
Revoke an unused join token
DELETE /api/v1/orgs/{org}/runner-tokens/{token}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
token |
path | ID |
Answers:
204: Revoked
Errors: 403, 404 (how errors look).
The organization's runner groups
GET /api/v1/orgs/{org}/runner-groups
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may add, change and delete these groups and their keys. |
groups |
array of RunnerGroup, required |
Errors: 404 (how errors look).
Add a runner group to the organization (runner:manage)
POST /api/v1/orgs/{org}/runner-groups
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Body (application/json): RunnerGroupInput.
Answers:
201: OK, RunnerGroup
Errors: 400, 403, 404, 409, 422 (how errors look).
The organization's machine providers, without their tokens
GET /api/v1/orgs/{org}/machine-providers
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may add and delete providers. |
kinds |
array of string, required | The kinds of providers this Forge offers; empty when it offers none. |
providers |
array of MachineProvider, required |
Errors: 404 (how errors look).
Add a machine provider with its token (runner:manage)
POST /api/v1/orgs/{org}/machine-providers
The provider checks the token first; 422 token_refused when it refuses it, 502 provider_unavailable when it can't be reached.
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
kind |
string, required | |
name |
string, required | |
token |
string, required | The provider's API token; checked with the provider, never shown again. |
Answers:
201: Created, MachineProvider
Errors: 400, 403, 404, 409, 422, 502 (how errors look).
The project's own runners
GET /api/v1/projects/{project}/runners
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may add (join tokens), rename and revoke these runners. |
join_server |
string, required | host:port runners connect to (forge-runner join --server). |
runners |
array of Runner, required |
Errors: 404 (how errors look).
Open join tokens for the project's runners
GET /api/v1/projects/{project}/runner-tokens
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: Join tokens that can still be used, object with the fields below
| Field | Type | Description |
|---|---|---|
tokens |
array of JoinToken, required |
Errors: 403, 404 (how errors look).
Create a single-use join token for a new project runner
POST /api/v1/projects/{project}/runner-tokens
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
lifetime_hours |
one of 1, 24, 168, required |
Answers:
201: Created; the token is shown only now, any
Errors: 400, 403, 404, 409, 422, 503 (how errors look).
Revoke an unused join token
DELETE /api/v1/projects/{project}/runner-tokens/{token}
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
token |
path | ID |
Answers:
204: Revoked
Errors: 403, 404 (how errors look).
The project's runner groups
GET /api/v1/projects/{project}/runner-groups
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may add, change and delete these groups and their keys. |
groups |
array of RunnerGroup, required |
Errors: 404 (how errors look).
Add a runner group to the project (runner:manage)
POST /api/v1/projects/{project}/runner-groups
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): RunnerGroupInput.
Answers:
201: OK, RunnerGroup
Errors: 400, 403, 404, 409, 422 (how errors look).
The project's machine providers, without their tokens
GET /api/v1/projects/{project}/machine-providers
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may add and delete providers. |
kinds |
array of string, required | The kinds of providers this Forge offers; empty when it offers none. |
providers |
array of MachineProvider, required |
Errors: 404 (how errors look).
Add a machine provider with its token (runner:manage)
POST /api/v1/projects/{project}/machine-providers
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
kind |
string, required | |
name |
string, required | |
token |
string, required | The provider's API token; checked with the provider, never shown again. |
Answers:
201: Created, MachineProvider
Errors: 400, 403, 404, 409, 422, 502 (how errors look).
A runner the caller can see
GET /api/v1/runners/{runner}
| Parameter | In | Description |
|---|---|---|
runner |
path | ID |
Answers:
200: OK, Runner
Errors: 404 (how errors look).
Rename, drain or move a runner (runner:manage); fields left out stay as they are
PATCH /api/v1/runners/{runner}
| Parameter | In | Description |
|---|---|---|
runner |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
class_id |
any | A shared runner's class (platform:runners); 422 for own runners or no such class. |
draining |
boolean | A drained runner gets no new runs and finishes the ones it has. |
location_id |
any | Where the machine stands; 422 if no such location. |
name |
string |
Answers:
200: Updated, Runner
Errors: 400, 403, 404, 422 (how errors look).
Revoke a runner for good (runner:manage); it can't connect again
DELETE /api/v1/runners/{runner}
| Parameter | In | Description |
|---|---|---|
runner |
path | ID |
Answers:
204: Revoked
Errors: 403, 404 (how errors look).
A runner group
GET /api/v1/runner-groups/{group}
| Parameter | In | Description |
|---|---|---|
group |
path | ID |
Answers:
200: OK, RunnerGroup
Errors: 404 (how errors look).
Replace a group's settings
PUT /api/v1/runner-groups/{group}
Members take new labels when they next connect, and the location and class at once. Lowering max_runners removes no member; it only refuses joins.
| Parameter | In | Description |
|---|---|---|
group |
path | ID |
Body (application/json): RunnerGroupInput.
Answers:
200: OK, RunnerGroup
Errors: 400, 403, 404, 409, 422 (how errors look).
Delete a group; its keys stop working and its members are revoked
DELETE /api/v1/runner-groups/{group}
| Parameter | In | Description |
|---|---|---|
group |
path | ID |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).
The group's keys that still let runners join (runner:manage)
GET /api/v1/runner-groups/{group}/keys
| Parameter | In | Description |
|---|---|---|
group |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
keys |
array of RunnerGroupKey, required |
Errors: 403, 404 (how errors look).
Create a reusable key that lets runners join the group (at most 2 active)
POST /api/v1/runner-groups/{group}/keys
| Parameter | In | Description |
|---|---|---|
group |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
expires_in_days |
integer | 0 or absent: until revoked. |
name |
string, required | Tells keys apart, e.g. the launch template it is in. |
Answers:
201: Created; the key is shown only now, any
Errors: 400, 403, 404, 409, 422, 503 (how errors look).
Revoke a key; runners that joined with it keep working
DELETE /api/v1/runner-groups/{group}/keys/{key}
| Parameter | In | Description |
|---|---|---|
group |
path | ID |
key |
path | ID |
Answers:
204: Revoked
Errors: 403, 404 (how errors look).
Turn Forge-managed machines on or off for the group (runner:manage)
PUT /api/v1/runner-groups/{group}/autoscale
Turned on, the provider (of the group's own owner) checks the settings with its token;
422 invalid with its reason when it refuses them, 502 provider_unavailable when it
can't be reached. Turned off, the group's running machines are drained and deleted once
their runs end, the others at once.
| Parameter | In | Description |
|---|---|---|
group |
path | ID |
Body (application/json): AutoscaleInput.
Answers:
200: OK, RunnerGroup
Errors: 400, 403, 404, 422, 502 (how errors look).
The countries the given autoscalers reach for a shared group, and each one's Forge location (platform:runners)
GET /api/v1/runner-groups/{group}/autoscale/countries
For the console to ask for missing picks before saving. Asks
the autoscalers' clouds (cached); 422 invalid for an autoscaler that doesn't fit the
group's kind, or a group that isn't shared.
| Parameter | In | Description |
|---|---|---|
group |
path | ID |
autoscaler |
query | array of ID: The autoscalers, repeated. |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
countries |
array of GroupCountry, required |
Errors: 400, 403, 404, 422, 502 (how errors look).
The group's machines that exist or went within the last day, newest first (at most 100)
GET /api/v1/runner-groups/{group}/machines
| Parameter | In | Description |
|---|---|---|
group |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
machines |
array of Machine, required | |
places |
array of MachinePlace | Shared groups only - where their machines start, in the order tried. |
Errors: 404 (how errors look).
Delete a provider and its token (runner:manage)
DELETE /api/v1/machine-providers/{provider}
409 in_use while a group autoscales with it or its machines aren't gone yet.
| Parameter | In | Description |
|---|---|---|
provider |
path | ID |
Answers:
204: Deleted
Errors: 403, 404, 409 (how errors look).
Replace a provider's token, which the provider must accept (runner:manage)
PUT /api/v1/machine-providers/{provider}/token
| Parameter | In | Description |
|---|---|---|
provider |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
token |
string, required |
Answers:
204: Replaced
Errors: 400, 403, 404, 422, 502 (how errors look).