> ## 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.

# Create a Cluster

Creates a hosted Cluster in a Region or attaches an existing one, and returns the creation Operation. It succeeds once the Cluster is ready. For an attached Cluster, issue the agent install command next. Retry with the same Idempotency-Key to get the same Cluster and Operation.

`POST https://api.akua.dev/v1/clusters`

## 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"`.
- `idempotency-key` (string): Optional caller-supplied idempotency key. Any non-empty key up to 64 characters is accepted. Endpoint-specific documentation describes how the key is used. Required string length: `1 - 64`. Example: `"create-prod-2026-05-07"`.

## Body

Required.

`application/json`: `ClusterCreateBody`

- Any of:
  - `hosted`
    - `kind` (enum<string>, required): Akua runs the control plane in the Region; you join your own servers. Available options: `"hosted"`.
    - `name` (string, required): A DNS label, unique in the Workspace. Required string length: `1 - 63`. Pattern: `^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$`. Example: `"shop"`.
    - `region_id` (string, required): Required string length: `3 - 54`.
  - `attached`
    - `kind` (enum<string>, required): An existing Kubernetes cluster that runs the Akua cluster agent. Available options: `"attached"`.
    - `name` (string, required): A DNS label, unique in the Workspace. Required string length: `1 - 63`. Pattern: `^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$`. Example: `"shop"`.
    - `access` (object, required)
      - Exactly one of:
        - `cluster`
          - `kind` (enum<string>, required): Available options: `"cluster"`.
        - `namespaces`
          - `kind` (enum<string>, required): Available options: `"namespaces"`.
          - `namespaces` (string[], required): Required array length: `1 - 256 elements`.

## Response

### 202: Cluster creation accepted

`application/json`: `Operation`

- `id` (string, required): Required string length: `2 - 192`.
- `workspace_id` (string | null, required): Required string length: `1 - 53`.
- `organization_id` (string | null, required): Required string length: `1 - 54`.
- `owner_type` (enum<string>, required): Domain entity collection the operation acts on. Available options: `"install"`, `"repository_change_request"`, `"repository"`, `"workspace"`, `"machine"`, `"cluster"`, `"node_pool"`, `"package"`, `"sandbox"`, `"opencode"`.
- `owner_id` (string, required): Prefixed ID of the entity this operation acts on. Prefix matches `owner_type` (`ws_`, `mch_`, `clu_`, `pkg_`, `inst_`, `rcr_`, `repo_`, `sbx_`, `oc_`); a node pool is `clu_<id>/node_pools/<node pool id>`.
- `parent_operation_id` (string | null, required): ID of the chained parent operation, when present. Required string length: `2 - 192`.
- `state` (enum<string>, required): Lifecycle state. Past-participle terminal states per AIP-216. Available options: `"RUNNING"`, `"SUCCEEDED"`, `"FAILED"`, `"CANCELLED"`.
- `done` (boolean, required): True iff state is a terminal value.
- `html_url` (string<uri>, required): Deep link to the dashboard view of this operation's owning resource when available, otherwise the operation detail page. Maximum string length: `2048`. Example: `"https://akua.dev/installs/inst_j572abc123def456?tab=operations"`.
- `metadata` (object, required)
  - Exactly one of:
    - `cluster.join_token.revoke`
      - `type` (enum<string>, required): Available options: `"cluster.join_token.revoke"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `token_id` (string, required): Pattern: `^[a-z0-9]{6}$`.
    - `machine.create`
      - `type` (enum<string>, required): Available options: `"machine.create"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `cluster_id` (string): Required string length: `1 - 54`.
      - `compute_config_id` (string): Required string length: `1 - 54`.
      - `instance_type` (string, required)
      - `managed` (boolean, required)
      - `request_fingerprint` (string, required): Minimum string length: `1`.
    - `machine.delete`
      - `type` (enum<string>, required): Available options: `"machine.delete"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `machine_id` (string, required): Required string length: `1 - 54`.
      - `request_fingerprint` (string, required): Minimum string length: `1`.
    - `machine.suspend`
      - `type` (enum<string>, required): Available options: `"machine.suspend"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `machine_id` (string, required): Required string length: `1 - 54`.
      - `request_fingerprint` (string, required): Minimum string length: `1`.
    - `machine.resume`
      - `type` (enum<string>, required): Available options: `"machine.resume"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `machine_id` (string, required): Required string length: `1 - 54`.
      - `request_fingerprint` (string, required): Minimum string length: `1`.
    - `cluster.delete`
      - `type` (enum<string>, required): Available options: `"cluster.delete"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
    - `cluster.create`
      - `type` (enum<string>, required): Available options: `"cluster.create"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `cluster_id` (string): ID of the new cluster. Set once the cluster record exists, before provisioning finishes. Required string length: `1 - 54`.
      - `name` (string, required)
      - `kind` (enum<string>, required): Available options: `"hosted"`, `"attached"`.
      - `region_id` (string | null, required): The Region of a hosted Cluster; null for an attached one. Required string length: `1 - 54`.
    - `node_pool.create | node_pool.set_size | node_pool.delete`
      - `type` (enum<string>, required): Available options: `"node_pool.create"`, `"node_pool.set_size"`, `"node_pool.delete"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `node_pool_id` (string, required): Required string length: `1 - 40`.
      - `node_count` (integer | null, required): The size the Operation moves the pool to; null for a deletion.
    - `cluster.node.remove`
      - `type` (enum<string>, required): Available options: `"cluster.node.remove"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `node_name` (string, required): Required string length: `1 - 253`.
    - `cluster.suspend`
      - `type` (enum<string>, required): Available options: `"cluster.suspend"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
    - `cluster.resume`
      - `type` (enum<string>, required): Available options: `"cluster.resume"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
    - `cluster.capabilities.refresh`
      - `type` (enum<string>, required): Available options: `"cluster.capabilities.refresh"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
    - `cluster.capability.ensure`
      - `type` (enum<string>, required): Available options: `"cluster.capability.ensure"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `capability` (string, required): Minimum string length: `1`.
    - `cluster.worker_bootstrap.revoke`
      - `type` (enum<string>, required): Available options: `"cluster.worker_bootstrap.revoke"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `worker_bootstrap_id` (string, required): Required string length: `1 - 54`.
    - `install.create`
      - `type` (enum<string>, required): Available options: `"install.create"`.
      - `idempotency_key` (string, required)
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `product_id` (string): Required string length: `1 - 55`.
    - `install.render`
      - `type` (enum<string>, required): Available options: `"install.render"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
      - `trigger_commit_sha` (string)
    - `install.delete`
      - `type` (enum<string>, required): Available options: `"install.delete"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
    - `install.update`
      - `type` (enum<string>, required): Available options: `"install.update"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
    - `preview_hostname.bind_pinned`
      - `type` (enum<string>, required): Available options: `"preview_hostname.bind_pinned"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
      - `render_id` (string, required): Required string length: `1 - 54`.
      - `protocol` (enum<string>, required): Available options: `"http"`, `"websocket"`, `"grpc"`.
      - `routing_mode` (enum<string>, required): Available options: `"through_dispatcher"`, `"bypass_dispatcher"`.
      - `idempotency_key` (string, required)
    - `preview_hostname.bind_floating`
      - `type` (enum<string>, required): Available options: `"preview_hostname.bind_floating"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
      - `track` (string, required): Required string length: `1 - 100`.
      - `render_id` (string, required): Required string length: `1 - 54`.
      - `protocol` (enum<string>, required): Available options: `"http"`, `"websocket"`, `"grpc"`.
      - `routing_mode` (enum<string>, required): Available options: `"through_dispatcher"`, `"bypass_dispatcher"`.
      - `idempotency_key` (string, required)
    - `preview_hostname.delete`
      - `type` (enum<string>, required): Available options: `"preview_hostname.delete"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
      - `preview_hostname_id` (string, required): Required string length: `1 - 54`.
      - `if_match` (string, required)
      - `idempotency_key` (string, required)
    - `workspace.delete`
      - `type` (enum<string>, required): Available options: `"workspace.delete"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
    - `workspace.subscription.cancel`
      - `type` (enum<string>, required): Available options: `"workspace.subscription.cancel"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `mode` (enum<string>, required): Available options: `"period_end"`.
    - `workspace.subdomain.set_name`
      - `type` (enum<string>, required): Available options: `"workspace.subdomain.set_name"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `name` (string, required): Required string length: `1 - 63`.
      - `idempotency_key` (string, required)
    - `custom_domain.create`
      - `type` (enum<string>, required): Available options: `"custom_domain.create"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `hostname` (string, required): Required string length: `1 - 253`.
      - `target` (object, required)
        - Exactly one of:
          - `install`
            - `kind` (enum<string>, required): Available options: `"install"`.
            - `install_id` (string, required): Required string length: `1 - 55`.
          - `cluster`
            - `kind` (enum<string>, required): Available options: `"cluster"`.
            - `cluster_id` (string, required): Required string length: `1 - 54`.
          - `external`
            - `kind` (enum<string>, required): Available options: `"external"`.
            - `endpoint` (string<uri>, required)
            - `mtls_secret_id` (string): Required string length: `1 - 54`.
      - `protocol` (enum<string>, required): Available options: `"http"`, `"websocket"`, `"grpc"`.
      - `routing_mode` (enum<string>, required): Available options: `"through_dispatcher"`, `"bypass_dispatcher"`.
      - `idempotency_key` (string, required)
    - `custom_domain.update`
      - `type` (enum<string>, required): Available options: `"custom_domain.update"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `custom_domain_id` (string, required): Required string length: `1 - 54`.
      - `target` (object)
        - Exactly one of:
          - `install`
            - `kind` (enum<string>, required): Available options: `"install"`.
            - `install_id` (string, required): Required string length: `1 - 55`.
          - `cluster`
            - `kind` (enum<string>, required): Available options: `"cluster"`.
            - `cluster_id` (string, required): Required string length: `1 - 54`.
          - `external`
            - `kind` (enum<string>, required): Available options: `"external"`.
            - `endpoint` (string<uri>, required)
            - `mtls_secret_id` (string): Required string length: `1 - 54`.
      - `protocol` (enum<string>): Available options: `"http"`, `"websocket"`, `"grpc"`.
      - `routing_mode` (enum<string>): Available options: `"through_dispatcher"`, `"bypass_dispatcher"`.
      - `if_match` (string, required)
      - `idempotency_key` (string, required)
    - `custom_domain.delete`
      - `type` (enum<string>, required): Available options: `"custom_domain.delete"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `custom_domain_id` (string, required): Required string length: `1 - 54`.
      - `if_match` (string, required)
      - `idempotency_key` (string, required)
    - `cloudflare.private_origin_route.prepare`
      - `type` (enum<string>, required): Available options: `"cloudflare.private_origin_route.prepare"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `route_intent_id` (string, required): Required string length: `1 - 54`.
    - `cloudflare.private_origin_route.release`
      - `type` (enum<string>, required): Available options: `"cloudflare.private_origin_route.release"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `route_intent_id` (string, required): Required string length: `1 - 54`.
    - `package.create`
      - `type` (enum<string>, required): Available options: `"package.create"`.
      - `idempotency_key` (string, required)
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `name` (string, required)
    - `package.version.publish_hosted`
      - `type` (enum<string>, required): Available options: `"package.version.publish_hosted"`.
      - `idempotency_key` (string, required)
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `package_id` (string, required): Required string length: `1 - 54`.
      - `request_fingerprint` (string, required): Minimum string length: `1`.
    - `package.version.publish_local_chart`
      - `type` (enum<string>, required): Available options: `"package.version.publish_local_chart"`.
      - `idempotency_key` (string, required)
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `package_id` (string, required): Required string length: `1 - 54`.
    - `package.version.publish`
      - `type` (enum<string>, required): Available options: `"package.version.publish"`.
      - `idempotency_key` (string, required)
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `package_id` (string, required): Required string length: `1 - 54`.
      - `version` (string, required): Required string length: `1 - 128`.
    - `repository_change_request.create`
      - `type` (enum<string>, required): Available options: `"repository_change_request.create"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `parent_repository_id` (string, required): Required string length: `1 - 55`.
      - `created_by_kind` (enum<string>, required): Available options: `"agent"`, `"wizard"`, `"user"`.
    - `repository_change_request.accept`
      - `type` (enum<string>, required): Available options: `"repository_change_request.accept"`.
      - `repository_change_request_id` (string, required): Required string length: `1 - 54`.
      - `user_id` (string, required)
    - `repository_change_request.reject`
      - `type` (enum<string>, required): Available options: `"repository_change_request.reject"`.
      - `repository_change_request_id` (string, required): Required string length: `1 - 54`.
      - `user_id` (string, required)
      - `reason` (string, required)
    - `repository_change_request.withdraw`
      - `type` (enum<string>, required): Available options: `"repository_change_request.withdraw"`.
      - `repository_change_request_id` (string, required): Required string length: `1 - 54`.
      - `user_id` (string, required)
    - `repository_change_request.expire`
      - `type` (enum<string>, required): Available options: `"repository_change_request.expire"`.
      - `repository_change_request_id` (string, required): Required string length: `1 - 54`.
    - `opencode.suspend`
      - `type` (enum<string>, required): Available options: `"opencode.suspend"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `opencode_id` (string, required): Required string length: `1 - 70`.
      - `idempotency_key` (string, required)
      - `reason` (enum<string>): Available options: `"manual"`, `"workspace_deleted"`.
    - `opencode.resume`
      - `type` (enum<string>, required): Available options: `"opencode.resume"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `opencode_id` (string, required): Required string length: `1 - 70`.
      - `idempotency_key` (string, required)
      - `reason` (enum<string>): Available options: `"manual"`, `"workspace_deleted"`.
    - `opencode.delete`
      - `type` (enum<string>, required): Available options: `"opencode.delete"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `opencode_id` (string, required): Required string length: `1 - 70`.
      - `idempotency_key` (string, required)
      - `reason` (enum<string>): Available options: `"manual"`, `"workspace_deleted"`.
    - `repository.delete`
      - `type` (enum<string>, required): Available options: `"repository.delete"`.
      - `repository_id` (string, required): Required string length: `1 - 55`.
    - `sandbox.create`
      - `type` (enum<string>, required): Available options: `"sandbox.create"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `sandbox_id` (string, required): Required string length: `1 - 54`.
      - `source_sandbox_id` (string): Set when the sandbox is a fork of another sandbox. Required string length: `1 - 54`.
    - `sandbox.suspend`
      - `type` (enum<string>, required): Available options: `"sandbox.suspend"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `sandbox_id` (string, required): Required string length: `1 - 54`.
      - `reason` (enum<string>, required): `idle`: the sandbox suspended itself after its idle timeout. Available options: `"manual"`, `"idle"`.
    - `sandbox.resume`
      - `type` (enum<string>, required): Available options: `"sandbox.resume"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `sandbox_id` (string, required): Required string length: `1 - 54`.
    - `sandbox.delete`
      - `type` (enum<string>, required): Available options: `"sandbox.delete"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `sandbox_id` (string, required): Required string length: `1 - 54`.
      - `reason` (enum<string>, required): `orphaned`: nobody had access to the sandbox for 7 days. `workspace_deleted`: its workspace is being deleted. Available options: `"manual"`, `"orphaned"`, `"workspace_deleted"`.
    - `connect.vault.delete`
      - `type` (enum<string>, required): Available options: `"connect.vault.delete"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `vault_id` (string, required): Required string length: `1 - 54`.
    - `connect.connection.revoke`
      - `type` (enum<string>, required): Available options: `"connect.connection.revoke"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `vault_id` (string, required): Required string length: `1 - 54`.
      - `connection_id` (string, required): Required string length: `1 - 55`.
- `response` (object | null, required): Populated only when `done && state === "SUCCEEDED"`. Discriminated by `type`.
  - Any of:
    - `cluster.join_token.revoke`
      - `type` (enum<string>, required): Available options: `"cluster.join_token.revoke"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `token_id` (string, required): Pattern: `^[a-z0-9]{6}$`.
    - `machine.create`
      - `type` (enum<string>, required): Available options: `"machine.create"`.
      - `machine_id` (string, required): Required string length: `1 - 54`.
      - `provider_id` (string, required)
    - `machine.delete`
      - `type` (enum<string>, required): Available options: `"machine.delete"`.
      - `machine_id` (string, required): Required string length: `1 - 54`.
    - `machine.suspend`
      - `type` (enum<string>, required): Available options: `"machine.suspend"`.
      - `machine_id` (string, required): Required string length: `1 - 54`.
      - `suspension_id` (string, required): Required string length: `1 - 54`.
    - `machine.resume`
      - `type` (enum<string>, required): Available options: `"machine.resume"`.
      - `machine_id` (string, required): Required string length: `1 - 54`.
    - `cluster.delete`
      - `type` (enum<string>, required): Available options: `"cluster.delete"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
    - `cluster.create`
      - `type` (enum<string>, required): Available options: `"cluster.create"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
    - `cluster.node.remove`
      - `type` (enum<string>, required): Available options: `"cluster.node.remove"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `node_name` (string, required): Required string length: `1 - 253`.
    - `node_pool.create | node_pool.set_size | node_pool.delete`
      - `type` (enum<string>, required): Available options: `"node_pool.create"`, `"node_pool.set_size"`, `"node_pool.delete"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `node_pool_id` (string, required): Required string length: `1 - 40`.
    - `cluster.suspend`
      - `type` (enum<string>, required): Available options: `"cluster.suspend"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
    - `cluster.resume`
      - `type` (enum<string>, required): Available options: `"cluster.resume"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
    - `cluster.capabilities.refresh`
      - `type` (enum<string>, required): Available options: `"cluster.capabilities.refresh"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
    - `cluster.capability.ensure`
      - `type` (enum<string>, required): Available options: `"cluster.capability.ensure"`.
      - `cluster_id` (string, required): Required string length: `1 - 54`.
      - `capability` (string, required): Minimum string length: `1`.
    - `cluster.worker_bootstrap.revoke`
      - `type` (enum<string>, required): Available options: `"cluster.worker_bootstrap.revoke"`.
      - `note` (string)
    - `install.create`
      - `type` (enum<string>, required): Available options: `"install.create"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
      - `argo_app_name` (string, required)
      - `argo_app_namespace` (string, required)
    - `install.create`
      - `type` (enum<string>, required): Available options: `"install.create"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
      - `sandbox_skipped` (enum<boolean>, required): Available options: `true`.
    - `install.render`
      - `type` (enum<string>, required): Available options: `"install.render"`.
      - `install_render_id` (string, required): Required string length: `1 - 54`.
      - `repository_id` (string, required): Required string length: `1 - 55`.
      - `commit_sha` (string)
      - `render_hash` (string, required)
      - `skipped` (boolean, required)
    - `install.delete`
      - `type` (enum<string>, required): Available options: `"install.delete"`.
      - `argo_app_deleted` (boolean, required)
      - `repo_purged` (boolean, required)
    - `preview_hostname.bind_pinned`
      - `type` (enum<string>, required): Available options: `"preview_hostname.bind_pinned"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
      - `preview_hostname_id` (string, required): Required string length: `1 - 54`.
      - `hostname` (string, required): Required string length: `1 - 253`.
    - `preview_hostname.bind_floating`
      - `type` (enum<string>, required): Available options: `"preview_hostname.bind_floating"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
      - `preview_hostname_id` (string, required): Required string length: `1 - 54`.
      - `hostname` (string, required): Required string length: `1 - 253`.
    - `preview_hostname.delete`
      - `type` (enum<string>, required): Available options: `"preview_hostname.delete"`.
      - `install_id` (string, required): Required string length: `1 - 55`.
      - `preview_hostname_id` (string, required): Required string length: `1 - 54`.
      - `hostname` (string, required): Required string length: `1 - 253`.
    - `workspace.delete`
      - `type` (enum<string>, required): Available options: `"workspace.delete"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
    - `workspace.subscription.cancel`
      - `type` (enum<string>, required): Available options: `"workspace.subscription.cancel"`.
      - `subscription_id` (string, required)
      - `cancel_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
    - `workspace.subdomain.set_name`
      - `type` (enum<string>, required): Available options: `"workspace.subdomain.set_name"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `workspace_subdomain_id` (string, required): Required string length: `1 - 54`.
      - `fqdn` (string, required): Required string length: `1 - 253`.
    - `custom_domain.create`
      - `type` (enum<string>, required): Available options: `"custom_domain.create"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `custom_domain_id` (string, required): Required string length: `1 - 54`.
      - `hostname` (string, required): Required string length: `1 - 253`.
    - `custom_domain.update`
      - `type` (enum<string>, required): Available options: `"custom_domain.update"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `custom_domain_id` (string, required): Required string length: `1 - 54`.
      - `hostname` (string, required): Required string length: `1 - 253`.
    - `custom_domain.delete`
      - `type` (enum<string>, required): Available options: `"custom_domain.delete"`.
      - `workspace_id` (string, required): Required string length: `1 - 53`.
      - `custom_domain_id` (string, required): Required string length: `1 - 54`.
      - `hostname` (string, required): Required string length: `1 - 253`.
    - `cloudflare.private_origin_route.prepare`
      - `type` (enum<string>, required): Available options: `"cloudflare.private_origin_route.prepare"`.
      - `origin_route_id` (string, required): Required string length: `1 - 54`.
    - `cloudflare.private_origin_route.release`
      - `type` (enum<string>, required): Available options: `"cloudflare.private_origin_route.release"`.
      - `route_intent_id` (string, required): Required string length: `1 - 54`.
    - `package.create`
      - `type` (enum<string>, required): Available options: `"package.create"`.
      - `package_id` (string, required): Required string length: `1 - 54`.
      - `package_version_id` (string, required): Required string length: `1 - 55`.
      - `repository_id` (string, required): Required string length: `1 - 55`.
    - `package.version.publish_hosted`
      - `type` (enum<string>, required): Available options: `"package.version.publish_hosted"`.
      - `package_version_id` (string, required): Required string length: `1 - 55`.
    - `package.version.publish_local_chart`
      - `type` (enum<string>, required): Available options: `"package.version.publish_local_chart"`.
      - `package_version_id` (string, required): Required string length: `1 - 55`.
    - `package.version.publish`
      - `type` (enum<string>, required): Available options: `"package.version.publish"`.
      - `package_version_id` (string, required): Required string length: `1 - 55`.
      - `artifact_digest` (string, required)
    - `repository_change_request.create`
      - `type` (enum<string>, required): Available options: `"repository_change_request.create"`.
      - `repository_change_request_id` (string, required): Required string length: `1 - 54`.
      - `fork_repository_id` (string, required): Required string length: `1 - 55`.
      - `expires_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
    - `repository_change_request.accept`
      - `type` (enum<string>, required): Available options: `"repository_change_request.accept"`.
      - `merged_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
      - `triggered_install_render` (boolean, required)
    - `repository_change_request.reject`
      - `type` (enum<string>, required): Available options: `"repository_change_request.reject"`.
      - `rejected_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
    - `repository_change_request.withdraw`
      - `type` (enum<string>, required): Available options: `"repository_change_request.withdraw"`.
      - `withdrawn_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
    - `repository_change_request.expire`
      - `type` (enum<string>, required): Available options: `"repository_change_request.expire"`.
      - `expired` (boolean, required)
    - `opencode.suspend`
      - `type` (enum<string>, required): Available options: `"opencode.suspend"`.
      - `opencode_id` (string, required): Required string length: `1 - 70`.
      - `state` (enum<string>, required): Available options: `"SUSPENDED"`.
    - `opencode.resume`
      - `type` (enum<string>, required): Available options: `"opencode.resume"`.
      - `opencode_id` (string, required): Required string length: `1 - 70`.
      - `state` (enum<string>, required): Available options: `"ACTIVE"`.
    - `opencode.delete`
      - `type` (enum<string>, required): Available options: `"opencode.delete"`.
      - `opencode_id` (string, required): Required string length: `1 - 70`.
      - `state` (enum<string>, required): Available options: `"DELETED"`.
    - `repository.delete`
      - `type` (enum<string>, required): Available options: `"repository.delete"`.
      - `purged_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
    - `sandbox.create`
      - `type` (enum<string>, required): Available options: `"sandbox.create"`.
      - `sandbox_id` (string, required): Required string length: `1 - 54`.
    - `sandbox.suspend`
      - `type` (enum<string>, required): Available options: `"sandbox.suspend"`.
      - `sandbox_id` (string, required): Required string length: `1 - 54`.
    - `sandbox.resume`
      - `type` (enum<string>, required): Available options: `"sandbox.resume"`.
      - `sandbox_id` (string, required): Required string length: `1 - 54`.
    - `sandbox.delete`
      - `type` (enum<string>, required): Available options: `"sandbox.delete"`.
      - `sandbox_id` (string, required): Required string length: `1 - 54`.
    - `connect.vault.delete`
      - `type` (enum<string>, required): Available options: `"connect.vault.delete"`.
      - `vault_id` (string, required): Required string length: `1 - 54`.
    - `connect.connection.revoke`
      - `type` (enum<string>, required): Available options: `"connect.connection.revoke"`.
      - `connection_id` (string, required): Required string length: `1 - 55`.
- `error` (object | null, required): Populated when `state` is `FAILED` or `CANCELLED`.
  - `code` (integer)
  - `message` (string, required)
  - `reason` (string): Why it failed, stable for clients to branch on. Node pool and Machine creates use `billing-required`, `quota-exceeded`, `service-disabled`, `capacity-unavailable`, `provider-refused`, `provider-unavailable` and `abandoned`; most Operations omit it. Example: `"billing-required"`.
  - `violations` (object[]): Each precondition that failed, like `google.rpc.PreconditionFailure`. A Package version that fails with `image-unresolvable` lists every image it could not resolve.
    - `type` (string, required): The kind of violation, stable for clients to branch on. Example: `"image-unresolvable"`.
    - `subject` (string, required): What failed it, for `image-unresolvable` the image reference. Example: `"pkg.akua.dev/ws_xxx/images/ghcr-acme/web:1.2.3"`.
    - `description` (string, required): Why it failed, safe to show.
- `last_error` (object | null, required): Latest error from any failed step. Populated even mid-flight; cleared when the step succeeds on retry.
  - `message` (string, required)
  - `step_name` (string)
- `started_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
- `completed_at` (integer | null, required): Unix timestamp (seconds). Required range: `x >= 0`.
- `steps` (object[])
  - `name` (string, required): User-visible milestone name.
  - `status` (enum<string>, required): Step lifecycle state. Available options: `"pending"`, `"running"`, `"completed"`, `"failed"`, `"skipped"`.
  - `execution_type` (enum<string>, required): Step execution kind. `user`/`approval` mean the workflow is blocked on a human action. Internal bookkeeping steps are filtered from public responses. Available options: `"system"`, `"user"`, `"approval"`, `"skipped"`.
  - `started_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
  - `completed_at` (integer | null, required): Unix timestamp (seconds). Required range: `x >= 0`.
  - `error_message` (string | null, required)
  - `retryable` (boolean, required)
  - `skippable` (boolean, required)

### 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)

### 404: The resource was not found in this workspace.

`application/json`: `ApiNotFound`

- `_tag` (enum<string>, required): Available options: `"NotFound"`.
- `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)

### 409: The request conflicts with existing resource state or immutable intent. | The resource changed since the etag the client sent; the current etag is in the metadata. | The idempotency key was already used for a different request.

`application/json`: `object`

- Any of:
  - `Conflict`
    - `_tag` (enum<string>, required): Available options: `"Conflict"`.
    - `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)
  - `PreconditionFailed`
    - `_tag` (enum<string>, required): Available options: `"PreconditionFailed"`.
    - `success` (enum<boolean>, required): Available options: `false`.
    - `errors` (object[], required): Required array length: `1 - 1 element`.
      - `code` (enum<number>, required): Available options: `7006`.
      - `message` (string, required)
      - `metadata` (object, required)
        - `current_etag` (string, required)
        - `{key}` (string)
    - `result` (object, required)
  - `IdempotencyConflict`
    - `_tag` (enum<string>, required): Available options: `"IdempotencyConflict"`.
    - `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)

### 410: The resource is permanently unavailable.

`application/json`: `ApiGone`

- `_tag` (enum<string>, required): Available options: `"Gone"`.
- `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)

### 422: The request is well-formed but cannot be processed.

`application/json`: `ApiUnprocessable`

- `_tag` (enum<string>, required): Available options: `"Unprocessable"`.
- `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)

### 429: The caller is over a rate budget, or a resource it adds to is at its limit (resource exhausted).

`application/json`: `ApiTooManyRequests`

- `_tag` (enum<string>, required): Available options: `"TooManyRequests"`.
- `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)

### 500: The server failed to handle the request.

`application/json`: `ApiInternalServerError`

- `_tag` (enum<string>, required): Available options: `"InternalServerError"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Required array length: `1 - 1 element`.
  - `code` (enum<number>, required): Available options: `7009`.
  - `message` (enum<string>, required): Available options: `"Internal server error"`.
- `result` (object, required)

### 502: An upstream provider failed.

`application/json`: `ApiExternalServiceError`

- `_tag` (enum<string>, required): Available options: `"ExternalServiceError"`.
- `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)

### 503: The service is temporarily unavailable.

`application/json`: `ApiServiceUnavailable`

- `_tag` (enum<string>, required): Available options: `"ServiceUnavailable"`.
- `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)

### 504: An upstream provider did not answer in time.

`application/json`: `ApiGatewayTimeout`

- `_tag` (enum<string>, required): Available options: `"GatewayTimeout"`.
- `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 POST \
  --url 'https://api.akua.dev/v1/clusters' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "kind": "hosted",
    "name": "shop",
    "region_id": "reg_j572abc123def456"
  }'
```

## Example response

`202` `application/json`

```json
{
  "id": "op_j572abc123def456",
  "workspace_id": "ws_j572abc123def456",
  "organization_id": "org_j572abc123def456",
  "owner_type": "install",
  "owner_id": "<string>",
  "parent_operation_id": "<string>",
  "state": "RUNNING",
  "done": true,
  "html_url": "https://akua.dev/installs/inst_j572abc123def456?tab=operations",
  "metadata": {
    "type": "cluster.create",
    "workspace_id": "ws_j572abc123def456",
    "cluster_id": "clu_j572abc123def456",
    "name": "<string>",
    "kind": "hosted",
    "region_id": "reg_j572abc123def456"
  },
  "response": {
    "type": "cluster.create",
    "cluster_id": "clu_j572abc123def456"
  },
  "error": {
    "code": 123,
    "message": "<string>",
    "reason": "billing-required",
    "violations": [
      {
        "type": "image-unresolvable",
        "subject": "pkg.akua.dev/ws_xxx/images/ghcr-acme/web:1.2.3",
        "description": "<string>"
      }
    ]
  },
  "last_error": {
    "message": "<string>",
    "step_name": "<string>"
  },
  "started_at": 123,
  "completed_at": 123,
  "steps": [
    {
      "name": "<string>",
      "status": "pending",
      "execution_type": "system",
      "started_at": 123,
      "completed_at": 123,
      "error_message": "<string>",
      "retryable": true,
      "skippable": true
    }
  ]
}
```
