# RunnerTokenService

**Spinbox is experimental: APIs change and data may be lost.** What is built and what proves it is on [Status](https://spin-stack.github.io/website/reference/status.md); what Spinbox does not do is on [Limitations](https://spin-stack.github.io/website/overview/limitations.md).

> spin.v1.RunnerTokenService: each procedure, its request and its response.

<!-- Generated by tools/refgen from spin:internal/controlplane/apidocs/spin.v1.openapi.json. Edit the source, not this file. -->

## CreateRegistrationToken

`POST /spin.v1.RunnerTokenService/CreateRegistrationToken`

Generate a one-time registration token (admin only)

**Request**

| Field | Type | What it is |
|---|---|---|
| `description` | string | e.g., "Runner for host-us-east-1" |
| `teamId` | string | Optional: scope to team (host joins team's pool) |
| `expiresAt` | `Timestamp` | Default: 24h |
| `reusable` | boolean | A pool's token, for an autoscaling group whose machines register with nobody at them: it is not spent by the host it registers. Short-lived and rotated is the intended use. |
| `hostPolicy` | [HostPolicy](https://spin-stack.github.io/website/reference/api/types.md#hostpolicy) | The policy each host it registers starts with, under SetHostPolicy's rules; host_id must be empty, since the hosts do not exist yet. |

**Response**

| Field | Type | What it is |
|---|---|---|
| `tokenInfo` | [RegistrationToken](https://spin-stack.github.io/website/reference/api/types.md#registrationtoken) |  |
| `token` | string | Full token, shown only once |

## ListRegistrationTokens

`POST /spin.v1.RunnerTokenService/ListRegistrationTokens`

List active registration tokens (admin only)

**Request**

| Field | Type | What it is |
|---|---|---|
| `includeUsed` | boolean |  |
| `page` | [PageRequest](https://spin-stack.github.io/website/reference/api/types.md#pagerequest) |  |

**Response**

| Field | Type | What it is |
|---|---|---|
| `tokens` | list of [RegistrationToken](https://spin-stack.github.io/website/reference/api/types.md#registrationtoken) |  |
| `page` | [PageResponse](https://spin-stack.github.io/website/reference/api/types.md#pageresponse) |  |

## RevokeRegistrationToken

`POST /spin.v1.RunnerTokenService/RevokeRegistrationToken`

Revoke a registration token (admin only)

**Request**

| Field | Type | What it is |
|---|---|---|
| `id` | string |  |

**Response**

No fields: `{}`.

## RevokeRunner

`POST /spin.v1.RunnerTokenService/RevokeRunner`

Revoke a runner (admin only)

**Request**

| Field | Type | What it is |
|---|---|---|
| `hostId` | string |  |
| `leaveWorkspaces` | boolean | Revoke although workspaces are on this host. Refused without it: each such workspace can then run only once it is recovered onto another host (RecoverWorkspace), which gives up what this host had not published. A machine that may be compromised is revoked with it anyway. |

**Response**

No fields: `{}`.
