Create a runner enrollment token
POST/api/workspaces/{workspace_id}/runner-enrollments
createRunnerEnrollment
Mint a single-purpose `nse_` token that registers runners from a fixed template: this workspace, the binding, the allowed backends and whether the runners are ephemeral (ADR 0153). The token is returned once. An actor-bound enrollment binds its runners to the caller and needs workspace membership; a workspace-wide one needs workspace admin. The enrollment works only while its creator still holds that permission and, when a token created it, while that token is live. `hosted` is refused (400).
Requires authentication using a bearer token or a session cookie — see tokens and scopes.
curl
curl -X POST 'https://neosource.dev/api/workspaces/WORKSPACE_ID/runner-enrollments' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"actor_bound":false,"vm_backends":[]}'fetch
fetch("https://neosource.dev/api/workspaces/WORKSPACE_ID/runner-enrollments", {
method: "POST",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({"actor_bound":false,"vm_backends":[]}),
});Path parameters
workspace_idrequired
Request bodyrequired
application/json
Responses
201Enrollment created
application/json
403Forbidden — one of: forbidden, needs_scope
application/json
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 404Not Found — one of: not_found
- 409Conflict — one of: already_exists, conflict
- 429Rate limited — retry after the `Retry-After` header
- 500Internal server error
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget
Schemas
Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.
RunnerBindingKind
Which trust binding a job executed under (ADR 0056 §1/§7). Serialized on the wire and in `workflow_run_jobs.executed_on` as the `snake_case` strings `hosted` / `workspace` / `actor`.
"hosted""workspace""actor"
RunnerEnrollmentKind
How an enrollment is presented (ADR 0153 §1). Only `Token` is creatable today; `Workload` is the projected-ServiceAccount-token kind, whose columns exist but which no route creates or redeems yet.
"token""workload"
RunnerScope
Whether a runner is hosted by the platform (per [ADR 0014]) or long-poll-attached from outside.
"hosted""self_hosted""local"
VmBackendKind
"docker_shell""kata_clh""kata_fc""lib_krun""k8s_runc""cloud_hypervisor"