> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akua.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List machines

Lists the Machines of the Workspace, including those its node pools created (`created_by`).

`GET https://api.akua.dev/v1/machines`

## Authorizations

- `Authorization: Bearer <token>` (BearerAuth): Bearer token for the authenticated caller.

## Headers

- `akua-context` (string): Optional workspace/scope context for the request. Carries a single workspace wire id (`ws_…`) today. Only needed for broad tokens - a workspace-owned token implies its workspace. Required string length: `1 - 53`. Example: `"ws_j572abc123def4"`.

## Query Parameters

- `cursor` (string): Pagination cursor from a previous response's `next_cursor`.
- `limit` (integer, default 50): Items per page (1-100, default 50). Required range: `1 <= x <= 100`. Example: `50`.
- `state` (enum<string>): Machine lifecycle state. Available options: `"PROVISIONING"`, `"RUNNING"`, `"SUSPENDING"`, `"SUSPENDED"`, `"RESTORING"`, `"EXPIRED"`, `"DELETING"`, `"FAILED"`.

## Response

### 200: Machine list

`application/json`: `MachineList`

- `data` (object[], required)
  - `id` (string, required): Required string length: `3 - 54`.
  - `workspace_id` (string, required): Required string length: `2 - 53`.
  - `region_id` (string, required): Required string length: `3 - 54`.
  - `location` (string, required): Maximum string length: `32`.
  - `machine_type` (string, required): Pattern: `^[a-z][a-z0-9-]{0,31}$`. Example: `"cx23"`.
  - `image` (enum<string>, required): Available options: `"ubuntu-24.04"`.
  - `labels` (record<string, string>, required): Maximum object length: `32 entries`. Key pattern: `^[a-z][a-z0-9_-]{0,62}$`. Example: `{"team":"web"}`.
  - `name` (string | null, required): Maximum string length: `120`.
  - `provider_id` (string | null, required): The server at its provider (`hcloud://<server id>`); null until the provider created it. Example: `"hcloud://1234"`.
  - `ipv4` (string | null, required)
  - `ipv6` (string | null, required)
  - `state` (enum<string>, required): Machine lifecycle state. Available options: `"PROVISIONING"`, `"RUNNING"`, `"SUSPENDING"`, `"SUSPENDED"`, `"RESTORING"`, `"EXPIRED"`, `"DELETING"`, `"FAILED"`.
  - `conditions` (object[], required): Maximum array length: `32 elements`. What needs attention now; empty when nothing does. Reasons:
    - `bootstrap-progress` (info): the latest guest-reported stage and report time. If progress stalls, this remains the last observation, not a readiness claim.
    - `bootstrap-failed` (error): guest bootstrap failed at the named step with its exit code. Provider state may remain RUNNING; no automatic replacement occurs.
    - `trial-ended` (warning): the free trial is over and the Machine is `SUSPENDED`; upgrade to Pro while its snapshot is retained to restore it. Remedy `upgrade-plan`.
    - `trial-data-expired` (warning): the snapshot expired or was deleted. No server can be restored from it; a Pro upgrade still succeeds.
    - `RESTORING` waits for the replacement server to run and, for a pool Machine, its node to join; only then is the snapshot removed.
    - When `state` is `FAILED`, one error whose reason says why: `capacity-unavailable`, `provider-refused`, `provider-unavailable` or `abandoned`. Its server and capacity were already released.
    - `reason` (string, required): Kebab-case reason; the resource documents the reasons it reports. Maximum string length: `64`. Pattern: `^[a-z0-9]+(?:-[a-z0-9]+)*$`. Example: `"agent-offline"`.
    - `severity` (enum<string>, required): `error`: the resource failed; the condition says why. `warning`: it is limited or held until the person acts or it recovers. `info`: worth knowing, nothing to do. Available options: `"error"`, `"warning"`, `"info"`.
    - `message` (string, required): Safe to show the person as is. Maximum string length: `512`.
    - `remedy` (object | null, required): What the person can do; null when nothing they do helps.
      - Any of:
        - `free-capacity`
          - `kind` (enum<string>, required): Available options: `"free-capacity"`.
          - `metric` (enum<string>, required): Available options: `"kaas/clusters"`, `"compute/machines"`, `"compute/cpu"`, `"compute/memory"`, `"compute/machines_concurrency"`, `"compute/managed_vm_trial"`, `"agents/turns_concurrency"`, `"agents/sandboxes"`, `"agents/sandboxes_running"`, `"agents/retained_filesystem_lifetime"`, `"codemode/executions"`, `"api/secrets_access"`, `"api/secrets_write"`, `"domain_routing/preview_hostnames"`, `"domain_routing/custom_domains"`, `"source_control/repositories"`.
          - `limit` (integer, required)
          - `usage` (integer, required)
          - `hint` (string, required): Maximum string length: `256`.
        - `upgrade-plan`
          - `kind` (enum<string>, required): Available options: `"upgrade-plan"`.
          - `metric` (enum<string>, required): Available options: `"kaas/clusters"`, `"compute/machines"`, `"compute/cpu"`, `"compute/memory"`, `"compute/machines_concurrency"`, `"compute/managed_vm_trial"`, `"agents/turns_concurrency"`, `"agents/sandboxes"`, `"agents/sandboxes_running"`, `"agents/retained_filesystem_lifetime"`, `"codemode/executions"`, `"api/secrets_access"`, `"api/secrets_write"`, `"domain_routing/preview_hostnames"`, `"domain_routing/custom_domains"`, `"source_control/repositories"`.
        - `grant-access`
          - `kind` (enum<string>, required): Available options: `"grant-access"`.
          - `namespace` (string | null, required): Maximum string length: `63`.
          - `permissions` (string[], required): Required array length: `1 - 64 elements`.
        - `reconnect`
          - `kind` (enum<string>, required): Available options: `"reconnect"`.
          - `what` (enum<string>, required): Available options: `"cluster-agent"`, `"connection"`.
        - `add-machine`
          - `kind` (enum<string>, required): Available options: `"add-machine"`.
        - `add-billing`
          - `kind` (enum<string>, required): Available options: `"add-billing"`.
        - `change-input`
          - `kind` (enum<string>, required): Available options: `"change-input"`.
          - `path` (string[], required): Maximum array length: `32 elements`.
        - `retry`
          - `kind` (enum<string>, required): Available options: `"retry"`.
          - `after_seconds` (integer | null, required)
        - `run-agent-install`
          - `kind` (enum<string>, required): Run the command from `POST /v1/clusters/{id}/connector_install` again; it re-applies the ClusterConnector and its updater at one release. Available options: `"run-agent-install"`.
        - `customer-upgrade`
          - `kind` (enum<string>, required): The change needs rights the agent was not granted. Run `command` (a `helm upgrade`, no secret) with an identity that holds `permissions`, or grant them to the agent. Available options: `"customer-upgrade"`.
          - `permissions` (string[], required): Required array length: `1 - 64 elements`.
          - `command` (string, required): Required string length: `1 - 8192`.
    - `last_transition_at` (integer, required): Unix timestamp (seconds) when this condition last changed. Required range: `x >= 0`.
  - `trial` (object | null, required)
    - `pauses_at` (integer | null, required): When the free trial Machine pauses; null until it runs. Unix timestamp (seconds). Required range: `0 <= x <= 9007199254740991`.
  - `created_by` (string | null, required): The service that created it (`service:cluster` for a node pool), which also deletes it; null when a person did. Pattern: `^service:[\s\S]*?$`.
  - `operation_id` (string, required): The latest Operation: the create, or the deletion. Required string length: `2 - 192`.
  - `created_at` (integer, required): Unix timestamp (seconds). Required range: `0 <= x <= 9007199254740991`.
  - `updated_at` (integer, required): Unix timestamp (seconds). Required range: `0 <= x <= 9007199254740991`.
  - `etag` (string, required)
- `has_more` (boolean, required): True if more items exist after this page.
- `next_cursor` (string | null, required): Opaque cursor for the next page, or null if no more pages.

### 400: The request is malformed.

`application/json`: `ApiBadRequest`

- `_tag` (enum<string>, required): Available options: `"Validation"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 401: Missing, invalid or expired credential.

`application/json`: `ApiUnauthorized`

- `_tag` (enum<string>, required): Available options: `"Unauthorized"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 403: The credential may not act in this workspace.

`application/json`: `ApiForbidden`

- `_tag` (enum<string>, required): Available options: `"Forbidden"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

## Example request

```bash
curl --request GET \
  --url 'https://api.akua.dev/v1/machines' \
  --header 'Authorization: Bearer <token>'
```

## Example response

`200` `application/json`

```json
{
  "data": [
    {
      "id": "mch_j572abc123def456",
      "workspace_id": "ws_j572abc123def456",
      "region_id": "reg_j572abc123def456",
      "location": "<string>",
      "machine_type": "cx23",
      "image": "ubuntu-24.04",
      "labels": {
        "team": "web"
      },
      "name": "<string>",
      "provider_id": "hcloud://1234",
      "ipv4": "<string>",
      "ipv6": "<string>",
      "state": "PROVISIONING",
      "conditions": [
        {
          "reason": "agent-offline",
          "severity": "error",
          "message": "<string>",
          "remedy": {
            "kind": "free-capacity",
            "metric": "kaas/clusters",
            "limit": 123,
            "usage": 123,
            "hint": "<string>"
          },
          "last_transition_at": 123
        }
      ],
      "trial": {
        "pauses_at": 123
      },
      "created_by": "<string>",
      "operation_id": "op_j572abc123def456",
      "created_at": 123,
      "updated_at": 123,
      "etag": "<string>"
    }
  ],
  "has_more": true,
  "next_cursor": "<string>"
}
```
