{
  "openapi": "3.1.0",
  "info": {
    "title": "RumptyCloud API",
    "version": "1.0.0",
    "description": "The RumptyCloud REST API lets you manage virtual machines, Kubernetes clusters,\ndatabases, storage, deployments and networking programmatically.\n"
  },
  "servers": [
    {
      "url": "https://api.rumptycloud.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "rumpty_<prefix>_<secret>",
        "description": "Personal API key created under **Manage Profile → My profile → Personal API keys**,\nsent as `Authorization: Bearer <token>`.\n"
      }
    },
    "parameters": {
      "WorkspaceSlug": {
        "name": "X-Workspace-Slug",
        "in": "header",
        "required": true,
        "description": "Slug of the workspace the request acts on. You can also pass it as the `workspace_slug` query parameter.",
        "schema": {
          "type": "string",
          "example": "acme"
        }
      },
      "WorkspaceUid": {
        "name": "workspace_uid",
        "in": "path",
        "required": true,
        "description": "The workspace's `uid`. When the route also takes `X-Workspace-Slug`, both must name the same workspace.",
        "schema": {
          "type": "string",
          "example": "0199c4d2-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
        }
      },
      "WorkspaceMemberUid": {
        "name": "member_uid",
        "in": "path",
        "required": true,
        "description": "The membership's `uid` from [List members](/api/workspaces/list-members). This is not the member's `user_uid`.",
        "schema": {
          "type": "string",
          "example": "019a6e01-3b4c-7d5e-8f6a-7b8c9d0e1f2a"
        }
      },
      "WorkspaceInvitationUid": {
        "name": "invitation_uid",
        "in": "path",
        "required": true,
        "description": "The invitation's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a8f30-4c5d-7e6f-8a9b-0c1d2e3f4a5b"
        }
      },
      "WorkspaceInvitationToken": {
        "name": "token",
        "in": "path",
        "required": true,
        "description": "The secret token from the invitation email link (`/invitations/<token>`).",
        "schema": {
          "type": "string",
          "example": "9f2c4e6a8b0d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a"
        }
      },
      "VmUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The VM's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90"
        }
      },
      "CustomDomainUid": {
        "name": "domain_uid",
        "in": "path",
        "required": true,
        "description": "The custom domain's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a8f50-6e7f-7a8b-9c0d-1e2f3a4b5c6d"
        }
      },
      "SnapshotUid": {
        "name": "snapshot_uid",
        "in": "path",
        "required": true,
        "description": "The snapshot's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9012-4b5c-7d6e-8f90-a1b2c3d4e5f6"
        }
      },
      "VmIdempotencyKey": {
        "name": "X-Idempotency",
        "in": "header",
        "required": false,
        "description": "Optional unique key for this request, such as a UUID. Leading and trailing spaces are\nignored. If you send a key you already used for the same action on the same resource, the\noriginal operation is returned with `200 OK` and `X-Idempotency-Replay: true`, and nothing\nnew is queued. The replay check runs before the resource is loaded or its state is\nchecked, so a retry gets the original result even after the action has finished. Reusing a\nkey for a different action, resource type or resource returns `409` with\n`action: idempotency_key_reused`. Keys are shared across the workspace. Without a key,\nevery request is treated as new.\n",
        "schema": {
          "type": "string",
          "example": "5f0c9e7a-2d1b-4c3e-8f6a-9b0d1e2f3a4b"
        }
      },
      "SnapshotIdempotencyKey": {
        "name": "X-Idempotency",
        "in": "header",
        "required": false,
        "description": "Optional unique key for this request, such as a UUID. Leading and trailing spaces are\nignored. If you send a key you already used for the same snapshot action, the original\noperation is returned with `200 OK` and `X-Idempotency-Replay: true`, and nothing new is\nqueued. Reusing a key for a different action or snapshot returns `409` with\n`action: idempotency_key_reused`. Keys are shared across the workspace. Without a key,\nevery request is treated as new.\n",
        "schema": {
          "type": "string",
          "example": "5f0c9e7a-2d1b-4c3e-8f6a-9b0d1e2f3a4b"
        }
      },
      "KubernetesClusterUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The cluster's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9a10-5c6d-7e8f-9a0b-1c2d3e4f5a6b"
        }
      },
      "KubernetesIdempotencyKey": {
        "name": "X-Idempotency",
        "in": "header",
        "required": false,
        "description": "Optional unique key for this request, such as a UUID. Leading and trailing spaces are\ntrimmed. If you send a key you already used for the same action on the same cluster, the\noriginal operation is returned with `200 OK`, `is_replay: true` and the\n`X-Idempotency-Replay` header, and nothing new is queued. The replay is checked before the\ncluster's current state. Reusing a key for a different action or resource returns `409`\nwith `action: idempotency_key_reused`. Keys are scoped to you and the workspace and shared\nby every resource type.\n",
        "schema": {
          "type": "string",
          "example": "5f0c9e7a-2d1b-4c3e-8f6a-9b0d1e2f3a4b"
        }
      },
      "DeploymentUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The deployment's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f"
        }
      },
      "DeploymentRunUid": {
        "name": "run_uid",
        "in": "path",
        "required": true,
        "description": "The run's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70"
        }
      },
      "DeploymentEnvVarUid": {
        "name": "env_uid",
        "in": "path",
        "required": true,
        "description": "The environment variable's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9b62-6a7b-7c8d-9e0f-1a2b3c4d5e6f"
        }
      },
      "DeploymentIdempotencyKey": {
        "name": "X-Idempotency",
        "in": "header",
        "required": false,
        "description": "Optional key that makes retries safe. Repeating a request with a key already used for\nthe same action on the same deployment returns the original operation with `200 OK` and\n`is_replay: true` instead of queuing it again. Reusing it for a different action or\ndeployment returns `409` with `action: idempotency_key_reused`.\n",
        "schema": {
          "type": "string",
          "example": "5f0c9e7a-2d1b-4c3e-8f6a-9b0d1e2f3a4b"
        }
      },
      "DeploymentActivityDays": {
        "name": "days",
        "in": "query",
        "required": false,
        "description": "How many days back to count, up to `366`. Missing, non-numeric, zero, negative or larger values use `365`.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 366,
          "default": 365,
          "example": 30
        }
      },
      "DeploymentMetricsRange": {
        "name": "range",
        "in": "query",
        "required": false,
        "description": "Time range to return.",
        "schema": {
          "type": "string",
          "enum": [
            "15m",
            "1h",
            "6h",
            "24h",
            "7d",
            "30d"
          ],
          "default": "1h",
          "example": "24h"
        }
      },
      "AppIdempotencyKey": {
        "name": "X-Idempotency",
        "in": "header",
        "required": false,
        "description": "Optional key that makes retries safe. Repeating a request with a key already used for\nthe same action returns the original result with `200 OK` and `is_replay: true`. Reusing\nit for a different action or app returns `409` with `action: idempotency_key_reused`.\n",
        "schema": {
          "type": "string",
          "example": "5f0c9e7a-2d1b-4c3e-8f6a-9b0d1e2f3a4b"
        }
      },
      "AppUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The app's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9d0f-0a1b-7c2d-9e3f-4a5b6c7d8e9f"
        }
      },
      "DatabaseUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The database's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b"
        }
      },
      "DatabaseSnapshotUid": {
        "name": "snapshot_uid",
        "in": "path",
        "required": true,
        "description": "The database snapshot's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9d40-2b3c-7d4e-8f5a-6b7c8d9e0f1a"
        }
      },
      "DatabaseIdempotencyKey": {
        "name": "X-Idempotency",
        "in": "header",
        "required": false,
        "description": "Optional unique key for this request, such as a UUID. Leading and trailing spaces are\ntrimmed. If you send a key you already used for the same action on the same resource, the\noriginal operation is returned with `200 OK`, `is_replay: true` and the\n`X-Idempotency-Replay` header, and nothing new is queued. The replay is checked before the\nresource's current state, so a retry after the first request finished still gets the\noriginal result. Reusing a key for a different action or resource returns `409` with\n`action: idempotency_key_reused`. Keys are scoped to you and the workspace and shared by\nevery resource type. Without a key, every request queues a new operation.\n",
        "schema": {
          "type": "string",
          "example": "5f0c9e7a-2d1b-4c3e-8f6a-9b0d1e2f3a4b"
        }
      },
      "DatabaseRedisDb": {
        "name": "db",
        "in": "query",
        "required": false,
        "description": "Redis logical database, `0` to `15`. Defaults to `0`. Non-numeric values are treated as `0`.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 15,
          "default": 0,
          "example": 0
        }
      },
      "VolumeUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The volume's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f"
        }
      },
      "VolumeIdempotencyKey": {
        "name": "X-Idempotency",
        "in": "header",
        "required": false,
        "description": "Optional unique key for this request, such as a UUID. Leading and trailing spaces are\ntrimmed. If the key was already used for the same action (and the same volume, or for a\ncreate the same name), the original operation is returned with `200 OK`,\n`is_replay: true` and the `X-Idempotency-Replay` header, and nothing new is queued. The\nreplay is checked before the volume's current state, so a retry after the first request\nfinished still gets the original result. If the key was used for any other operation in\nthe workspace, including VM, database or snapshot operations, the request is rejected with\n`409` and `action: idempotency_key_reused`.\n",
        "schema": {
          "type": "string",
          "example": "5f0c9e7a-2d1b-4c3e-8f6a-9b0d1e2f3a4b"
        }
      },
      "BucketIdempotencyKey": {
        "name": "X-Idempotency",
        "in": "header",
        "required": false,
        "description": "Optional key that makes retries safe. Repeating a request with a key already used for\nthe same action returns the original operation with `200 OK` and `is_replay: true`\ninstead of queuing it again. Reusing it for a different action or bucket returns `409`\nwith `action: idempotency_key_reused`.\n",
        "schema": {
          "type": "string",
          "example": "2b7e4c1a-9d3f-4e6a-8b0c-1d2e3f4a5b6c"
        }
      },
      "BucketUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The bucket's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b"
        }
      },
      "BucketObjectUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The object's `uid` (the `object_id` returned by [Create an upload](/api/buckets/create-an-upload)).",
        "schema": {
          "type": "string",
          "example": "019a9c01-aa22-7b33-9c44-d5e6f7a8b9c0"
        }
      },
      "FirewallPolicyUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The firewall policy's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9e10-7a8b-7c9d-8e0f-1a2b3c4d5e6f"
        }
      },
      "FirewallRuleUid": {
        "name": "rule_uid",
        "in": "path",
        "required": true,
        "description": "The rule's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a9e10-7a8c-7d0e-9f1a-2b3c4d5e6f7a"
        }
      },
      "InvoiceUid": {
        "name": "uid",
        "in": "path",
        "required": true,
        "description": "The invoice's `uid`.",
        "schema": {
          "type": "string",
          "example": "019a4c1f-8d9e-7f0a-8b1c-2d3e4f5a6b7c"
        }
      }
    },
    "schemas": {
      "Envelope": {
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "`true` when the request succeeded.",
            "example": true
          },
          "message": {
            "type": "string",
            "description": "Human-readable status message.",
            "example": "ok"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "message": {
            "type": "string",
            "description": "What went wrong.",
            "example": "invalid request"
          },
          "code": {
            "type": "integer",
            "description": "HTTP status code. Present on most errors, but authentication errors omit it.",
            "example": 400
          },
          "action": {
            "type": "string",
            "description": "Optional machine-readable hint for the next step, e.g. `past_due` or `account_suspended`."
          }
        }
      },
      "AccountProfile": {
        "type": "object",
        "required": [
          "uid",
          "username",
          "email",
          "role",
          "verified",
          "joined_at",
          "auth_method",
          "billing_status",
          "two_factor_enabled",
          "signed_up_via_referral"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Your user ID."
          },
          "username": {
            "type": "string",
            "description": "Your username."
          },
          "email": {
            "type": "string",
            "description": "Your email address."
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "admin"
            ],
            "description": "Your platform role. This is `user` for customers and is unrelated to your workspace roles."
          },
          "verified": {
            "type": "boolean",
            "description": "Whether you have verified your email address. Most workspace endpoints return `403` with `action: verify_email` until you have."
          },
          "joined_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the account was created."
          },
          "auth_method": {
            "type": "string",
            "description": "How the account signs in, e.g. `password` or `google`."
          },
          "avatar_url": {
            "type": "string",
            "description": "API-relative path of your profile picture, with a cache-busting `v` parameter. Omitted when you have no picture."
          },
          "billing_country": {
            "type": "string",
            "description": "Country used for tax (ISO 3166-1 alpha-2). Your declared billing country, or the country detected at signup when you have not set one. Omitted when neither is known."
          },
          "tax_id": {
            "type": "string",
            "description": "Your VAT or tax ID. Omitted when not set."
          },
          "billing_status": {
            "type": "string",
            "enum": [
              "active",
              "past_due",
              "suspended",
              "terminated"
            ],
            "description": "Your payment standing. When it is not `active`, creating new paid resources returns\n`402` with `action: past_due`, as do starting VMs and building, redeploying or\nrestarting deployments. While `suspended`, your VMs, databases, Kubernetes clusters and\ndeployments are powered off; storage is kept. Once the account is `active` again,\neverything suspension powered off is started again automatically within about a\nminute (resources you had stopped yourself stay stopped).\n"
          },
          "workspaces": {
            "type": "array",
            "description": "Workspaces you are an active member of, newest first. Omitted when you have none.",
            "items": {
              "$ref": "#/components/schemas/WorkspaceSummary"
            }
          },
          "two_factor_enabled": {
            "type": "boolean",
            "description": "Whether authenticator-app two-factor authentication is on."
          },
          "signed_up_via_referral": {
            "type": "boolean",
            "description": "Whether the account was created through a referral link."
          },
          "referred_by_code": {
            "type": "string",
            "description": "The invite code used at signup. Omitted when you were not referred."
          }
        }
      },
      "AccountPolicyAcceptance": {
        "type": "object",
        "required": [
          "policy_key",
          "version",
          "accepted"
        ],
        "properties": {
          "policy_key": {
            "type": "string",
            "enum": [
              "privacy_data_policy",
              "fair_use_policy"
            ],
            "description": "Which policy this is."
          },
          "version": {
            "type": "string",
            "description": "The current version of the policy.",
            "example": "2026-06-03"
          },
          "accepted": {
            "type": "boolean",
            "description": "Whether you have accepted this version."
          },
          "accepted_at": {
            "type": "string",
            "format": "date-time",
            "description": "When you accepted this version. Omitted when not accepted."
          }
        }
      },
      "AccountAcceptableUseStatus": {
        "type": "object",
        "required": [
          "accepted",
          "policies"
        ],
        "properties": {
          "accepted": {
            "type": "boolean",
            "description": "`true` when every policy below is accepted at its current version."
          },
          "policies": {
            "type": "array",
            "description": "Status of each policy that makes up the acceptable use policy.",
            "items": {
              "$ref": "#/components/schemas/AccountPolicyAcceptance"
            }
          }
        }
      },
      "AccountAuditLog": {
        "type": "object",
        "description": "One audit log entry. Field names are PascalCase.",
        "required": [
          "UID",
          "UserUID",
          "Description",
          "Actor",
          "ActorType",
          "Status",
          "Action",
          "Severity",
          "ResourceName",
          "ResourceUID",
          "Category",
          "ResourceType",
          "IPAddress",
          "UserAgent",
          "StatusCode",
          "Metadata",
          "CreatedAt"
        ],
        "properties": {
          "UID": {
            "type": "string",
            "description": "Unique identifier of the entry."
          },
          "UserUID": {
            "type": "string",
            "description": "ID of the user who performed the action. Empty when there was none."
          },
          "WorkspaceUID": {
            "type": "string",
            "description": "UID of the workspace the action happened in. Omitted for account-level actions and when the workspace has been deleted."
          },
          "Description": {
            "type": "string",
            "description": "Human-readable summary of what happened."
          },
          "Actor": {
            "type": "string",
            "description": "Who acted. The username for console sessions, the API key's prefix for API key requests, or `unauthenticated`."
          },
          "ActorType": {
            "type": "string",
            "enum": [
              "session",
              "api_key",
              "unauthenticated"
            ],
            "description": "How the actor authenticated."
          },
          "Status": {
            "type": "string",
            "enum": [
              "successful",
              "failed"
            ],
            "description": "`failed` when the request returned a status of 400 or higher."
          },
          "Action": {
            "type": "string",
            "description": "The action and its outcome, e.g. `vm.create.success` or `ssh_key.delete.failed`."
          },
          "Severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "error"
            ],
            "description": "`error` for failed actions, otherwise `info`."
          },
          "ResourceName": {
            "type": "string",
            "description": "Name of the affected resource, or its UID when the name could not be resolved. `—` when there is no resource."
          },
          "ResourceUID": {
            "type": "string",
            "description": "UID of the affected resource, when known."
          },
          "Category": {
            "type": "string",
            "enum": [
              "compute",
              "database",
              "storage",
              "security",
              "networking",
              "billing",
              "workspace"
            ],
            "description": "Broad category of the affected resource."
          },
          "ResourceType": {
            "type": "string",
            "description": "Type of the affected resource, e.g. `vm`, `ssh_key`, `workspace_invitation`."
          },
          "IPAddress": {
            "type": "string",
            "description": "IP address the request came from."
          },
          "UserAgent": {
            "type": "string",
            "description": "User agent of the request."
          },
          "StatusCode": {
            "type": "integer",
            "description": "HTTP status code the request returned."
          },
          "Metadata": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Extra details, such as the request's path parameters. Invitation tokens are redacted. `null` when there are none."
          },
          "CreatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the action happened."
          }
        }
      },
      "WorkspaceRole": {
        "type": "string",
        "enum": [
          "owner",
          "admin",
          "developer",
          "viewer"
        ],
        "description": "A member's role in a workspace."
      },
      "WorkspacePermission": {
        "type": "string",
        "enum": [
          "workspace.read",
          "workspace.manage",
          "resource.write",
          "runtime.connect",
          "secrets.read",
          "secrets.manage",
          "members.manage",
          "audit.read",
          "billing.read",
          "billing.manage",
          "workspace.transfer",
          "workspace.delete"
        ],
        "description": "A permission granted by a workspace role."
      },
      "Workspace": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "description",
          "is_default",
          "vm_exec_enabled",
          "created_at",
          "updated_at",
          "member_count"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the workspace. Used in `/v1/workspaces/{workspace_uid}/...` paths."
          },
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "slug": {
            "type": "string",
            "description": "Unique slug. Send it in `X-Workspace-Slug` to act in this workspace."
          },
          "description": {
            "type": "string",
            "description": "Free-text description. Empty when not set."
          },
          "is_default": {
            "type": "boolean",
            "description": "Whether this is the owner's default workspace, created at signup. It cannot be deleted."
          },
          "vm_exec_enabled": {
            "type": "boolean",
            "description": "Whether running commands on VMs through the API is allowed. See [Update workspace settings](/api/workspaces/update-workspace-settings)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the workspace was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the workspace was last changed."
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole",
            "description": "Your role in the workspace. Omitted when deleting a workspace."
          },
          "permissions": {
            "type": "array",
            "description": "The permissions your role grants. Omitted when deleting a workspace.",
            "items": {
              "$ref": "#/components/schemas/WorkspacePermission"
            }
          },
          "member_count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of active members. `0` in the response to deleting a workspace."
          }
        }
      },
      "WorkspaceSummary": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "description",
          "is_default",
          "member_count"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the workspace."
          },
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "slug": {
            "type": "string",
            "description": "Slug to send in `X-Workspace-Slug`."
          },
          "description": {
            "type": "string",
            "description": "Free-text description. Empty when not set."
          },
          "is_default": {
            "type": "boolean",
            "description": "Whether this is the owner's default workspace."
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole",
            "description": "Your role in the workspace. Omitted when not known in this context."
          },
          "permissions": {
            "type": "array",
            "description": "The permissions your role grants. Omitted when not known in this context.",
            "items": {
              "$ref": "#/components/schemas/WorkspacePermission"
            }
          },
          "member_count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of active members. Only filled in on your profile. Other responses return `0`."
          }
        }
      },
      "WorkspaceTeamUser": {
        "type": "object",
        "required": [
          "uid",
          "username"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "The user's ID."
          },
          "username": {
            "type": "string",
            "description": "The user's username."
          }
        }
      },
      "WorkspaceMember": {
        "type": "object",
        "required": [
          "uid",
          "user_uid",
          "username",
          "email",
          "role",
          "permissions",
          "status",
          "joined_at",
          "is_current_user"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the membership. Use it in `/members/{member_uid}` paths."
          },
          "user_uid": {
            "type": "string",
            "description": "The member's user ID."
          },
          "username": {
            "type": "string",
            "description": "The member's username."
          },
          "email": {
            "type": "string",
            "description": "The member's email address."
          },
          "avatar_url": {
            "type": "string",
            "description": "API-relative path of the member's profile picture. Omitted when they have none."
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole",
            "description": "The member's role."
          },
          "permissions": {
            "type": "array",
            "description": "The permissions the role grants.",
            "items": {
              "$ref": "#/components/schemas/WorkspacePermission"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended"
            ],
            "description": "Membership status. Only `active` members can access the workspace."
          },
          "joined_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the member joined."
          },
          "invited_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkspaceTeamUser"
              }
            ],
            "description": "Who invited the member. Omitted for the owner and when unknown."
          },
          "is_current_user": {
            "type": "boolean",
            "description": "`true` for your own membership."
          }
        }
      },
      "WorkspaceInvitation": {
        "type": "object",
        "required": [
          "uid",
          "email",
          "role",
          "status",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the invitation."
          },
          "email": {
            "type": "string",
            "description": "The invited email address, lower-cased."
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "developer",
              "viewer"
            ],
            "description": "Role the invitee gets when they accept."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "revoked",
              "expired"
            ],
            "description": "Invitation status."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the invitation was created."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the invitation link stops working."
          },
          "invited_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkspaceTeamUser"
              }
            ],
            "description": "Who sent the invitation."
          }
        }
      },
      "WorkspaceInvitationLookup": {
        "type": "object",
        "required": [
          "email",
          "role",
          "status",
          "expires_at",
          "workspace_name",
          "account_exists"
        ],
        "properties": {
          "email": {
            "type": "string",
            "description": "The invited email address."
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "developer",
              "viewer"
            ],
            "description": "Role the invitee gets when they accept."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "revoked",
              "expired"
            ],
            "description": "Invitation status. `expired` once past `expires_at`."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the invitation expires."
          },
          "workspace_name": {
            "type": "string",
            "description": "Name of the workspace."
          },
          "invited_by": {
            "type": "string",
            "description": "Username of the person who sent the invitation. Omitted when unknown."
          },
          "account_exists": {
            "type": "boolean",
            "description": "Whether a RumptyCloud account already uses the invited email. Use it to choose between sign-in and sign-up."
          }
        }
      },
      "WorkspaceInvitationPreview": {
        "type": "object",
        "required": [
          "uid",
          "email",
          "role",
          "status",
          "expires_at",
          "workspace"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the invitation."
          },
          "email": {
            "type": "string",
            "description": "The invited email address."
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "developer",
              "viewer"
            ],
            "description": "Role you get when you accept."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending"
            ],
            "description": "Always `pending`. Other states return `409`."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the invitation expires."
          },
          "workspace": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkspaceSummary"
              }
            ],
            "description": "The workspace you are invited to. `role` and `permissions` are omitted and `member_count` is `0`."
          },
          "invited_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkspaceTeamUser"
              }
            ],
            "description": "Who sent the invitation. Omitted when unknown."
          }
        }
      },
      "WorkspaceNotifications": {
        "type": "object",
        "required": [
          "webhook_configured"
        ],
        "properties": {
          "webhook_configured": {
            "type": "boolean",
            "description": "Whether an alert webhook is set. The URL itself is never returned."
          }
        }
      },
      "WorkspaceSettings": {
        "type": "object",
        "required": [
          "vm_exec_enabled"
        ],
        "properties": {
          "vm_exec_enabled": {
            "type": "boolean",
            "description": "Whether [Run a command on a VM](/api/virtual-machines/run-a-command-on-a-vm) is allowed in this workspace."
          }
        }
      },
      "ApiKey": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "prefix",
          "scopes",
          "permissions",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the key."
          },
          "name": {
            "type": "string",
            "description": "Label you gave the key."
          },
          "prefix": {
            "type": "string",
            "description": "First 8 characters of the token's identifier, used to recognise the key."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "cli",
                "mcp"
              ]
            },
            "description": "What the key can be used for."
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "workspace.read",
                "resource.write",
                "runtime.connect",
                "secrets.read",
                "secrets.manage",
                "members.manage",
                "audit.read",
                "billing.read",
                "billing.manage",
                "workspace.manage",
                "workspace.transfer",
                "workspace.delete"
              ]
            },
            "description": "Permissions the key may use. A request also needs your role in that workspace to grant\nthe same permission. A key with no stored list uses the default set.\n"
          },
          "never_expires": {
            "type": "boolean",
            "description": "Present and `true` when the key has no expiry."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the key expires (RFC 3339, UTC). Omitted for keys that never expire."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the key was created."
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the key last authenticated a request. Omitted if it has never been used."
          }
        }
      },
      "SshKey": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "fingerprint",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the key. Use it in `ssh_key_uids` when creating a VM."
          },
          "name": {
            "type": "string",
            "description": "Label given to the key."
          },
          "fingerprint": {
            "type": "string",
            "description": "SHA-256 fingerprint of the public key, in the same format as `ssh-keygen -l`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the key was added."
          }
        }
      },
      "Plan": {
        "type": "object",
        "required": [
          "name",
          "slug",
          "kind",
          "product",
          "zone_slug",
          "vcpu",
          "memory_mib",
          "included_disk_gib",
          "monthly_price_cents",
          "currency",
          "ephemeral_eligible",
          "available"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the plan."
          },
          "name": {
            "type": "string",
            "description": "Display name of the plan.",
            "example": "Small"
          },
          "slug": {
            "type": "string",
            "description": "Identifier to pass as `plan_slug` when creating or resizing a VM.",
            "example": "small"
          },
          "kind": {
            "type": "string",
            "enum": [
              "persistent",
              "ephemeral"
            ],
            "description": "`ephemeral` for ephemeral-eligible plans, otherwise `persistent`."
          },
          "product": {
            "type": "string",
            "description": "Product the plan belongs to. Always `compute` here.",
            "example": "compute"
          },
          "zone_slug": {
            "type": "string",
            "description": "Zone the plan is offered in.",
            "example": "olas-closet"
          },
          "vcpu": {
            "type": "integer",
            "description": "Number of virtual CPUs.",
            "example": 1
          },
          "memory_mib": {
            "type": "integer",
            "description": "Memory in MiB.",
            "example": 2048
          },
          "included_disk_gib": {
            "type": "integer",
            "description": "Root disk size in GiB.",
            "example": 20
          },
          "included_egress_gib": {
            "type": "integer",
            "description": "Outbound data transfer included per month, in GiB.",
            "example": 100
          },
          "network_ingress_mbit": {
            "type": "integer",
            "description": "Inbound bandwidth limit in Mbit/s.",
            "example": 100
          },
          "network_egress_mbit": {
            "type": "integer",
            "description": "Outbound bandwidth limit in Mbit/s.",
            "example": 100
          },
          "monthly_price_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Monthly price in the smallest currency unit (cents).",
            "example": 1020
          },
          "hourly_price_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Hourly price in cents, rounded.",
            "example": 2
          },
          "hourly_price_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Hourly price in millionths of the currency unit, for precise cost estimates.",
            "example": 13973
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code of the prices.",
            "example": "USD"
          },
          "free_allowance_count": {
            "type": "integer",
            "description": "Number of VMs on this plan included free of charge.",
            "example": 0
          },
          "ephemeral_eligible": {
            "type": "boolean",
            "description": "Whether VMs on this plan are ephemeral. VMs created on an eligible plan are always ephemeral."
          },
          "default_runtime_mins": {
            "type": "integer",
            "description": "Lifetime in minutes of ephemeral VMs on this plan. `0` for persistent plans. Ephemeral VMs fall back to 72 hours when this is `0`.",
            "example": 0
          },
          "available": {
            "type": "boolean",
            "description": "Whether new VMs can use this plan. Always `true` in this listing."
          }
        }
      },
      "Image": {
        "type": "object",
        "required": [
          "name",
          "slug",
          "family",
          "architecture",
          "enabled",
          "desktop"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the image."
          },
          "name": {
            "type": "string",
            "description": "Display name of the image.",
            "example": "Ubuntu 24.04 LTS"
          },
          "slug": {
            "type": "string",
            "description": "Identifier to pass as `image_slug` when creating a VM.",
            "example": "ubuntu-24-04"
          },
          "family": {
            "type": "string",
            "description": "Operating system family, such as `ubuntu`, `debian`, `fedora` or `rocky`.",
            "example": "ubuntu"
          },
          "version": {
            "type": "string",
            "description": "Release version of the operating system. Omitted when not set.",
            "example": "24.04"
          },
          "architecture": {
            "type": "string",
            "description": "CPU architecture of the image.",
            "example": "amd64"
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the image can be used. Always `true` in this listing."
          },
          "desktop": {
            "type": "boolean",
            "description": "Whether the image includes a graphical desktop. Desktop images need a plan with at least 2 vCPU and 2048 MiB of memory."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the image was added to the catalog."
          }
        }
      },
      "Zone": {
        "type": "object",
        "required": [
          "name",
          "slug",
          "status",
          "description",
          "default"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name of the zone.",
            "example": "Ola's Closet"
          },
          "slug": {
            "type": "string",
            "description": "Identifier to pass as `zone_slug` when creating a VM.",
            "example": "olas-closet"
          },
          "status": {
            "type": "string",
            "description": "Whether the zone is accepting new VMs.",
            "example": "available"
          },
          "description": {
            "type": "string",
            "description": "Short description of the zone."
          },
          "default": {
            "type": "boolean",
            "description": "`true` for the zone used when `zone_slug` is omitted."
          }
        }
      },
      "Vm": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "kind",
          "status",
          "desired_status",
          "actual_status",
          "display_status",
          "zone_slug",
          "guest_username",
          "disk_gib",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the VM."
          },
          "name": {
            "type": "string",
            "description": "Display name of the VM.",
            "example": "web-1"
          },
          "slug": {
            "type": "string",
            "description": "URL-safe form of the name. Unique among the workspace's VMs.",
            "example": "web-1"
          },
          "kind": {
            "type": "string",
            "enum": [
              "persistent",
              "ephemeral"
            ],
            "description": "`ephemeral` VMs are deleted when they expire at `expires_at`. `persistent` VMs run until you delete them."
          },
          "status": {
            "$ref": "#/components/schemas/VmStatus"
          },
          "desired_status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VmStatus"
              }
            ],
            "description": "The state the platform is driving the VM towards."
          },
          "actual_status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VmStatus"
              }
            ],
            "description": "The last state observed on the infrastructure."
          },
          "display_status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VmStatus"
              }
            ],
            "description": "The status to show to people. Prefer this in user interfaces."
          },
          "plan_slug": {
            "type": "string",
            "description": "Slug of the VM's compute plan.",
            "example": "small"
          },
          "vcpu": {
            "type": "integer",
            "description": "Virtual CPUs from the VM's plan.",
            "example": 1
          },
          "memory_mib": {
            "type": "integer",
            "description": "Memory in MiB from the VM's plan.",
            "example": 2048
          },
          "image_slug": {
            "type": "string",
            "description": "Slug of the image the VM was created from.",
            "example": "ubuntu-24-04"
          },
          "image_name": {
            "type": "string",
            "description": "Display name of the image.",
            "example": "Ubuntu 24.04 LTS"
          },
          "desktop": {
            "type": "boolean",
            "description": "Present and `true` when the VM runs a desktop image."
          },
          "zone_slug": {
            "type": "string",
            "description": "Zone the VM runs in.",
            "example": "olas-closet"
          },
          "private_ip": {
            "type": "string",
            "description": "Private IP address in the VM's VPC. Omitted until assigned.",
            "example": "10.16.4.23"
          },
          "guest_username": {
            "type": "string",
            "description": "User to log in as over SSH. `root` for VMs created from an image.",
            "example": "root"
          },
          "disk_gib": {
            "type": "integer",
            "description": "Provisioned root disk size in GiB.",
            "example": 20
          },
          "app_name": {
            "type": "string",
            "description": "Name of the VM's default app route. Omitted if HTTP access is not configured.",
            "example": "brave-otter-6b8d90"
          },
          "app_hostname": {
            "type": "string",
            "description": "Public hostname of the VM's app URL. Point a custom domain's CNAME here.",
            "example": "brave-otter-6b8d90.rumptycloud.app"
          },
          "app_url": {
            "type": "string",
            "description": "Public HTTPS URL that forwards to `app_port` on the VM.",
            "example": "https://brave-otter-6b8d90.rumptycloud.app"
          },
          "app_port": {
            "type": "integer",
            "description": "Port on the VM that `app_url` forwards to. Defaults to `8080`.",
            "example": 8080
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When an ephemeral VM expires. Omitted for persistent VMs."
          },
          "usage": {
            "$ref": "#/components/schemas/VmDiskUsage"
          },
          "ssh_keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VmSshKey"
            },
            "description": "SSH keys installed on the VM. Omitted when there are none."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the VM was created."
          }
        }
      },
      "VmStatus": {
        "type": "string",
        "enum": [
          "provisioning",
          "running",
          "stopped",
          "suspended",
          "deleting",
          "deleted",
          "failed"
        ],
        "description": "Lifecycle state of the VM.",
        "example": "running"
      },
      "VmSshKey": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "fingerprint",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the SSH key."
          },
          "name": {
            "type": "string",
            "description": "Label of the SSH key.",
            "example": "laptop"
          },
          "fingerprint": {
            "type": "string",
            "description": "SHA256 fingerprint of the public key.",
            "example": "SHA256:q3Jk9m2c6yVt1bW8xZ0pLr4sN7uE5aH2gD1fK8jQ0oM"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the key was added."
          }
        }
      },
      "VmDiskUsage": {
        "type": "object",
        "description": "Root filesystem (`/`) usage reported by the guest agent. Omitted until the first sample arrives.",
        "required": [
          "total_bytes",
          "used_bytes",
          "available_bytes",
          "used_percent",
          "sampled_at",
          "stale"
        ],
        "properties": {
          "total_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Size of the root filesystem in bytes."
          },
          "used_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes in use."
          },
          "available_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes free."
          },
          "used_percent": {
            "type": "number",
            "description": "Percentage of the filesystem in use.",
            "example": 20
          },
          "sampled_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the sample was taken."
          },
          "stale": {
            "type": "boolean",
            "description": "`true` when the sample is more than two minutes old."
          }
        }
      },
      "VmPagination": {
        "type": "object",
        "description": "Paging details. Only present when `page` or `page_size` was sent.",
        "required": [
          "page",
          "page_size",
          "total",
          "total_pages"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "description": "Current page number.",
            "example": 1
          },
          "page_size": {
            "type": "integer",
            "description": "Items per page.",
            "example": 20
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total number of matching items.",
            "example": 1
          },
          "total_pages": {
            "type": "integer",
            "description": "Total number of pages.",
            "example": 1
          }
        }
      },
      "VmSummary": {
        "type": "object",
        "required": [
          "total_vms",
          "running_vms",
          "stopped_vms"
        ],
        "properties": {
          "total_vms": {
            "type": "integer",
            "description": "VMs in the workspace, excluding ones that are deleting or deleted.",
            "example": 3
          },
          "running_vms": {
            "type": "integer",
            "description": "VMs whose status is `running`.",
            "example": 2
          },
          "stopped_vms": {
            "type": "integer",
            "description": "`total_vms` minus `running_vms`. Includes VMs that are provisioning or failed, not only stopped ones.",
            "example": 1
          }
        }
      },
      "VmCreateResult": {
        "type": "object",
        "required": [
          "operation_id",
          "vm_uid",
          "name",
          "status",
          "vm_status",
          "events_url",
          "is_replay",
          "is_completed"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the create operation. Poll it with [Get an operation](/api/operations/get-an-operation)."
          },
          "vm_uid": {
            "type": "string",
            "description": "UID of the new VM."
          },
          "name": {
            "type": "string",
            "description": "Name of the VM."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the create operation. `queued` for a newly queued VM.",
            "example": "queued"
          },
          "vm_status": {
            "type": "string",
            "description": "Status of the VM (see `VmStatus`). `provisioning` for a newly queued VM. On a replay,\nthe VM's current status, or `deleted` once it is gone. Empty in the rare case the VM\ncould not be read during a replay.\n",
            "example": "provisioning"
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress."
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an existing operation was returned for a reused `X-Idempotency` key."
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished."
          }
        }
      },
      "VmOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "vm_uid",
          "name",
          "action",
          "status",
          "vm_status",
          "events_url",
          "is_replay",
          "is_completed"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued operation. Poll it with [Get an operation](/api/operations/get-an-operation)."
          },
          "vm_uid": {
            "type": "string",
            "description": "UID of the VM."
          },
          "name": {
            "type": "string",
            "description": "Name of the VM. On a replay, the name the VM had when the operation was queued."
          },
          "action": {
            "type": "string",
            "enum": [
              "start",
              "stop",
              "reboot",
              "delete",
              "resize",
              "set_app_port"
            ],
            "description": "The action that was queued."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the operation. `queued` for a newly queued action.",
            "example": "queued"
          },
          "vm_status": {
            "type": "string",
            "description": "Status of the VM (see `VmStatus`). For a new start, reboot or resize of a running VM,\n`provisioning`; for a stop, `stopped`; for a delete, `deleting`; for a resize of a\nstopped VM or an app port change, the VM's unchanged status. On a replay, the VM's\ncurrent status, or `deleted` once it is gone. Empty in the rare case the VM could not\nbe read during a replay.\n",
            "example": "provisioning"
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress."
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an existing operation was returned for a reused `X-Idempotency` key."
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished. Always `false` for a newly queued action."
          }
        }
      },
      "VmMetricsCurrent": {
        "type": "object",
        "required": [
          "vm_uid",
          "available",
          "stale",
          "sampled_at"
        ],
        "properties": {
          "vm_uid": {
            "type": "string",
            "description": "UID of the VM."
          },
          "available": {
            "type": "boolean",
            "description": "`false` when no metrics have been received from the VM yet."
          },
          "stale": {
            "type": "boolean",
            "description": "`true` when the latest sample is more than two minutes old."
          },
          "cpu_percent": {
            "type": "number",
            "description": "CPU usage in percent. Omitted when unavailable.",
            "example": 12.5
          },
          "memory_percent": {
            "type": "number",
            "description": "Memory usage in percent. Omitted when unavailable.",
            "example": 41.2
          },
          "disk_percent": {
            "type": "number",
            "description": "Root filesystem usage in percent. Omitted when unavailable.",
            "example": 20.1
          },
          "network_rx_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes received across all network interfaces except loopback, as reported by the agent. Omitted when unavailable."
          },
          "network_tx_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes sent across all network interfaces except loopback, as reported by the agent. Omitted when unavailable."
          },
          "sampled_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the sample was taken. When `available` is `false`, this is the time of the request."
          },
          "unavailable_reason": {
            "type": "string",
            "description": "Why metrics are unavailable, for example `no metrics received yet`. Omitted when available."
          }
        }
      },
      "VmMetricsPoint": {
        "type": "object",
        "required": [
          "timestamp"
        ],
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Time of the data point."
          },
          "cpu_percent": {
            "type": "number",
            "description": "CPU usage in percent. Omitted when not recorded."
          },
          "memory_percent": {
            "type": "number",
            "description": "Memory usage in percent. Omitted when not recorded."
          },
          "disk_percent": {
            "type": "number",
            "description": "Root filesystem usage in percent. Omitted when not recorded."
          },
          "network_rx_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes received, excluding loopback. Omitted when not recorded."
          },
          "network_tx_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes sent, excluding loopback. Omitted when not recorded."
          }
        }
      },
      "VmMetricsHistory": {
        "type": "object",
        "required": [
          "vm_uid",
          "available",
          "stale",
          "range",
          "step_seconds",
          "latest",
          "points"
        ],
        "properties": {
          "vm_uid": {
            "type": "string",
            "description": "UID of the VM."
          },
          "available": {
            "type": "boolean",
            "description": "`false` when no samples exist in the range."
          },
          "stale": {
            "type": "boolean",
            "description": "`true` when the newest point is more than two minutes old."
          },
          "range": {
            "type": "string",
            "enum": [
              "15m",
              "1h",
              "6h",
              "24h",
              "7d",
              "30d"
            ],
            "description": "The time window returned."
          },
          "step_seconds": {
            "type": "integer",
            "description": "Seconds between points for this range.",
            "example": 60
          },
          "latest": {
            "description": "The newest point, or `null` when there are none.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/VmMetricsPoint"
              },
              {
                "type": "null"
              }
            ]
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VmMetricsPoint"
            },
            "description": "Data points, oldest first."
          },
          "unavailable_reason": {
            "type": "string",
            "description": "Why no data is available, for example `no metrics received in range`. Omitted when available."
          }
        }
      },
      "CustomDomain": {
        "type": "object",
        "required": [
          "uid",
          "domain_name",
          "status",
          "verification_txt",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the custom domain."
          },
          "vm_uid": {
            "type": "string",
            "description": "UID of the VM the domain is attached to."
          },
          "vm_app_uid": {
            "type": "string",
            "deprecated": true,
            "description": "Deprecated. Same value as `vm_uid` (it holds the VM's UID, not a VM app's). Use `vm_uid`."
          },
          "domain_name": {
            "type": "string",
            "description": "The custom domain.",
            "example": "app.acme.com"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "active",
              "failed"
            ],
            "description": "`pending` until verified and routed, `active` once traffic is served, `failed` when DNS\nverification or routing failed (see `last_error`).\n"
          },
          "verification_txt": {
            "type": "string",
            "description": "Value to publish in a `TXT` record at `rumpty-challenge.<domain_name>`.",
            "example": "rumpty-verification-019a8f50"
          },
          "last_error": {
            "type": "string",
            "description": "Reason for the last failure. Omitted when there is none."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the domain was added."
          }
        }
      },
      "CustomDomainOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "status",
          "events_url",
          "is_replay",
          "is_completed"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued operation. Empty when verifying a domain that is already `active`."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the operation. `succeeded` for a domain that is already active."
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress. Empty when `operation_id` is empty."
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an existing operation was returned for a reused `X-Idempotency` key. `false` when a verify returns an already-active domain or an in-flight verification."
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished."
          }
        }
      },
      "VmApp": {
        "type": "object",
        "required": [
          "uid",
          "vm_uid",
          "name",
          "slug",
          "status",
          "port",
          "protocol",
          "hostname",
          "url",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the app exposure."
          },
          "vm_uid": {
            "type": "string",
            "description": "UID of the VM."
          },
          "name": {
            "type": "string",
            "description": "Name of the exposure (stored in slug form).",
            "example": "grafana"
          },
          "slug": {
            "type": "string",
            "description": "Identifier used in the unexpose path.",
            "example": "grafana"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "ready",
              "deleting",
              "failed"
            ],
            "description": "`pending` while the route is being created, `ready` when live, `deleting` while being removed, `failed` if provisioning failed."
          },
          "port": {
            "type": "integer",
            "description": "Port on the VM that the URL forwards to.",
            "example": 3000
          },
          "protocol": {
            "type": "string",
            "enum": [
              "http",
              "grpc"
            ],
            "description": "Backend protocol."
          },
          "hostname": {
            "type": "string",
            "description": "Public hostname of the exposure.",
            "example": "3000-brave-otter-6b8d90.rumptycloud.app"
          },
          "url": {
            "type": "string",
            "description": "Public HTTPS URL of the exposure.",
            "example": "https://3000-brave-otter-6b8d90.rumptycloud.app"
          },
          "last_failure": {
            "type": "string",
            "description": "Reason for the last failure. Omitted when there is none."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the exposure was created."
          }
        }
      },
      "VmAppOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "vm_uid",
          "vm_name",
          "app",
          "status",
          "events_url",
          "is_replay",
          "is_completed"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued operation. Poll it with [Get an operation](/api/operations/get-an-operation)."
          },
          "vm_uid": {
            "type": "string",
            "description": "UID of the VM."
          },
          "vm_name": {
            "type": "string",
            "description": "Name of the VM."
          },
          "app": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VmApp"
              }
            ],
            "description": "The app exposure. On a replay, its current state, or only `uid`, `vm_uid` and `name` if it has been removed."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the operation."
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress."
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an existing operation was returned for a reused `X-Idempotency` key or an in-flight removal."
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a returned existing operation has already finished."
          }
        }
      },
      "VmExecResult": {
        "type": "object",
        "required": [
          "exit_code",
          "stdout",
          "stderr",
          "duration_ms"
        ],
        "properties": {
          "exit_code": {
            "type": "integer",
            "description": "Exit status of the command. `124` usually means it hit the timeout. `-1` means no exit status was returned.",
            "example": 0
          },
          "stdout": {
            "type": "string",
            "description": "Standard output, up to 64 KiB. Invalid UTF-8 is replaced."
          },
          "stderr": {
            "type": "string",
            "description": "Standard error, up to 64 KiB. Invalid UTF-8 is replaced."
          },
          "stdout_truncated": {
            "type": "boolean",
            "description": "Present and `true` when `stdout` was cut at 64 KiB."
          },
          "stderr_truncated": {
            "type": "boolean",
            "description": "Present and `true` when `stderr` was cut at 64 KiB."
          },
          "timed_out": {
            "type": "boolean",
            "description": "Present and `true` when the command was stopped by the timeout."
          },
          "duration_ms": {
            "type": "integer",
            "format": "int64",
            "description": "How long the command ran, in milliseconds.",
            "example": 184
          }
        }
      },
      "Snapshot": {
        "type": "object",
        "required": [
          "uid",
          "vm_uid",
          "source_vm_name",
          "detached",
          "name",
          "slug",
          "status",
          "consumed_bytes",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the snapshot."
          },
          "vm_uid": {
            "type": "string",
            "description": "UID of the VM the snapshot was taken from. Kept after that VM is deleted."
          },
          "source_vm_name": {
            "type": "string",
            "description": "Name of the source VM.",
            "example": "web-1"
          },
          "detached": {
            "type": "boolean",
            "description": "`true` when the source VM has been deleted. The snapshot can still be used to create a new VM."
          },
          "name": {
            "type": "string",
            "description": "Name of the snapshot.",
            "example": "before-upgrade"
          },
          "slug": {
            "type": "string",
            "description": "URL-safe form of the name.",
            "example": "before-upgrade"
          },
          "status": {
            "type": "string",
            "enum": [
              "creating",
              "available",
              "restoring",
              "deleting",
              "failed"
            ],
            "description": "Lifecycle state. Only `available` snapshots can be restored or used to create a VM."
          },
          "consumed_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Storage the snapshot actually uses, in bytes. Billing is based on this. `0` until the snapshot is ready.",
            "example": 1073741824
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the snapshot was requested."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the snapshot last changed."
          }
        }
      },
      "SnapshotOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "vm_uid",
          "name",
          "action",
          "status",
          "events_url",
          "is_replay",
          "is_completed"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued operation. Poll it with [Get an operation](/api/operations/get-an-operation). The snapshot is the operation's `resource_uid`."
          },
          "vm_uid": {
            "type": "string",
            "description": "UID of the VM from the request path. For [Delete a snapshot](/api/snapshots/delete-a-snapshot), the snapshot's source VM, or empty on a replay."
          },
          "name": {
            "type": "string",
            "description": "Name of the VM for VM-scoped requests (empty on a replay if the VM is gone). Name of the snapshot for [Delete a snapshot](/api/snapshots/delete-a-snapshot)."
          },
          "action": {
            "type": "string",
            "enum": [
              "vm_snapshot.create",
              "vm_snapshot.restore",
              "vm_snapshot.delete"
            ],
            "description": "The action that was queued."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the operation."
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress."
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an existing operation was returned for a reused `X-Idempotency` key."
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a returned existing operation has already finished."
          }
        }
      },
      "Operation": {
        "type": "object",
        "required": [
          "uid",
          "resource_type",
          "resource_uid",
          "resource_name",
          "action",
          "status",
          "created_at",
          "events_url"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the operation."
          },
          "resource_type": {
            "type": "string",
            "description": "Kind of resource the operation acts on, for example `vm`, `vm_app`, `vm_snapshot`, `k8s_cluster`, `volume`, `database` or `deployment`.",
            "example": "vm"
          },
          "resource_uid": {
            "type": "string",
            "description": "UID of the resource. For a new VM or snapshot, this is the UID of the resource being created."
          },
          "resource_name": {
            "type": "string",
            "description": "Name of the resource when the operation was queued.",
            "example": "web-1"
          },
          "action": {
            "type": "string",
            "description": "What the operation does. For VMs: `create`, `start`, `stop`, `reboot`, `resize`,\n`delete`, `set_app_port`, `expose` and `unexpose` (custom domains and apps). For\nsnapshots: `create`, `restore` and `delete`. Other resources (`k8s_cluster`, `volume`,\n`database`, `deployment`, buckets) use `create` and `delete` plus their own actions, for\nexample `attach_volume`, `detach_volume`, `resize` or `firewall.apply`.\n",
            "example": "create"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Progress of the operation. `succeeded` and `failed` are final."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When work began. Omitted while queued."
          },
          "finished_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the operation finished. Omitted until it does."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the operation was queued."
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress."
          }
        }
      },
      "KubernetesCluster": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "status",
          "display_status",
          "zone_slug",
          "version",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the cluster."
          },
          "name": {
            "type": "string",
            "description": "Display name of the cluster.",
            "example": "production"
          },
          "slug": {
            "type": "string",
            "description": "URL-friendly form of the name, unique among the workspace's clusters.",
            "example": "production"
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "running",
              "stopped",
              "failed",
              "deleting",
              "deleted"
            ],
            "description": "Lifecycle state. `failed` means provisioning or a later action failed. See\n`last_failure`. `deleted` is only seen on [Get a cluster](/api/kubernetes/get-a-cluster)\nand in idempotent replays.\n\n`stopped` means the platform powered off every node because the account was suspended\nfor non-payment. A `running` cluster switches to `stopped` (and its nodes to `stopped`,\nwhich ends node billing) as soon as the stop is queued, and stays stopped while the\naccount is suspended. Within about a minute of the account becoming active again it is\nrestarted: it goes through `provisioning` back to `running`, or to `failed` if the\nrestart fails. If the stop itself fails, the cluster goes back to `running` and the stop\nis retried. A stopped cluster can still be deleted.\n",
            "example": "running"
          },
          "display_status": {
            "type": "string",
            "enum": [
              "provisioning",
              "running",
              "stopped",
              "failed",
              "deleting",
              "deleted"
            ],
            "description": "Status to show in user interfaces. Currently always equal to `status`.",
            "example": "running"
          },
          "zone_slug": {
            "type": "string",
            "description": "Zone the cluster runs in.",
            "example": "olas-closet"
          },
          "version": {
            "type": "string",
            "description": "k3s version requested for the cluster.",
            "example": "v1.36.2+k3s1"
          },
          "image_slug": {
            "type": "string",
            "description": "Slug of the node operating system image. Omitted if the image cannot be resolved.",
            "example": "ubuntu-2404-lts"
          },
          "endpoint": {
            "type": "string",
            "description": "Public Kubernetes API server URL. Omitted when the platform has no Kubernetes domain configured.",
            "example": "https://production-1c2d3e.k8s.rumptycloud.com:16443"
          },
          "kubeconfig": {
            "type": "string",
            "description": "kubeconfig file for the cluster, as YAML text. Omitted until the cluster is running and\nthe kubeconfig has been retrieved. Never included by [List clusters](/api/kubernetes/list-clusters),\nand omitted by [Get a cluster](/api/kubernetes/get-a-cluster) for roles without the\n`secrets read` permission. It contains credentials, so store it securely.\n"
          },
          "kubeconfig_restricted": {
            "type": "boolean",
            "description": "`true` when `kubeconfig` was withheld because your role lacks the `secrets read`\npermission (viewers). Only set by [Get a cluster](/api/kubernetes/get-a-cluster);\nomitted otherwise.\n",
            "example": true
          },
          "last_failure": {
            "type": "string",
            "description": "Reason for the last failure reported for the cluster. Omitted when there is none."
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KubernetesClusterNode"
            },
            "description": "The cluster's nodes, the control plane first. Omitted when empty."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the cluster was created (RFC 3339)."
          }
        }
      },
      "KubernetesClusterNode": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "role",
          "status",
          "guest_username"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the node."
          },
          "name": {
            "type": "string",
            "description": "Node name, derived from the cluster name, such as `production-cp-1` or `production-worker-2`.",
            "example": "production-cp-1"
          },
          "role": {
            "type": "string",
            "enum": [
              "control-plane",
              "worker"
            ],
            "description": "Whether the node runs the Kubernetes control plane or workloads.",
            "example": "control-plane"
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "ready",
              "stopped",
              "failed",
              "deleting",
              "deleted"
            ],
            "description": "Lifecycle state of the node. `stopped` while the cluster is stopped for a suspended account.",
            "example": "ready"
          },
          "plan_slug": {
            "type": "string",
            "description": "Compute plan the node runs on.",
            "example": "scale"
          },
          "vcpu": {
            "type": "integer",
            "description": "Virtual CPUs from the node's plan.",
            "example": 2
          },
          "memory_mib": {
            "type": "integer",
            "description": "Memory from the node's plan, in MiB.",
            "example": 2048
          },
          "disk_gib": {
            "type": "integer",
            "description": "Disk included with the node's plan, in GiB.",
            "example": 50
          },
          "private_ip": {
            "type": "string",
            "description": "Node's private IP address. Omitted until the node is provisioned.",
            "example": "10.16.7.11"
          },
          "guest_username": {
            "type": "string",
            "description": "Operating system user for SSH access to the node.",
            "example": "root"
          }
        }
      },
      "KubernetesClusterOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "cluster",
          "status",
          "events_url",
          "is_replay"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued operation. Pass it to [Get an operation](/api/operations/get-an-operation)."
          },
          "cluster": {
            "$ref": "#/components/schemas/KubernetesCluster"
          },
          "status": {
            "type": "string",
            "description": "The cluster's status after the request was accepted, `provisioning` for a create or `deleting` for a delete. On a replay it is the cluster's current status (`deleted` once it is gone). This is not the operation's status; use `is_completed` or [Get an operation](/api/operations/get-an-operation) for that.",
            "example": "provisioning"
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress.",
            "example": "/v1/operations/019a9a10-5c70-7a1b-8c2d-3e4f5a6b7c8d/events"
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an existing operation was returned for a reused `X-Idempotency` key."
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished. Omitted unless `true`."
          }
        }
      },
      "DeploymentPlan": {
        "type": "object",
        "required": [
          "name",
          "slug",
          "product",
          "zone_slug",
          "vcpu",
          "cpu_request_millis",
          "cpu_limit_millis",
          "memory_mib",
          "monthly_price_cents",
          "currency",
          "free_allowance_count",
          "available"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the plan."
          },
          "name": {
            "type": "string",
            "description": "Display name.",
            "example": "Tiny"
          },
          "slug": {
            "type": "string",
            "description": "Identifier to pass as `plan_slug`.",
            "example": "deploy-tiny"
          },
          "product": {
            "type": "string",
            "description": "Always `deployment` for these plans.",
            "example": "deployment"
          },
          "zone_slug": {
            "type": "string",
            "description": "Zone the plan runs in.",
            "example": "olas-closet"
          },
          "vcpu": {
            "type": "integer",
            "description": "Whole vCPU count. Coarse; prefer `cpu_limit_millis`.",
            "example": 1
          },
          "cpu_request_millis": {
            "type": "integer",
            "description": "Guaranteed CPU in millicores (1000 = one core).",
            "example": 25
          },
          "cpu_limit_millis": {
            "type": "integer",
            "description": "Maximum CPU in millicores the app can burst to.",
            "example": 1000
          },
          "memory_mib": {
            "type": "integer",
            "description": "Memory limit in MiB.",
            "example": 512
          },
          "included_disk_gib": {
            "type": "integer",
            "description": "Included disk in GiB.",
            "example": 0
          },
          "included_egress_gib": {
            "type": "integer",
            "description": "Included outbound transfer per month in GiB.",
            "example": 50
          },
          "network_ingress_mbit": {
            "type": "integer",
            "description": "Inbound bandwidth limit in Mbit/s.",
            "example": 50
          },
          "network_egress_mbit": {
            "type": "integer",
            "description": "Outbound bandwidth limit in Mbit/s.",
            "example": 50
          },
          "monthly_price_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Price per month per replica, in cents of `currency`.",
            "example": 200
          },
          "hourly_price_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Hourly price in whole cents. Often `0` for cheap plans; use `hourly_price_micros`.",
            "example": 0
          },
          "hourly_price_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Hourly price in millionths of the currency unit.",
            "example": 2739
          },
          "currency": {
            "type": "string",
            "description": "ISO currency code.",
            "example": "USD"
          },
          "free_allowance_count": {
            "type": "integer",
            "description": "For Free plans, how many apps each account may run on this plan. `0` for paid plans.",
            "example": 0
          },
          "available": {
            "type": "boolean",
            "description": "Whether new deployments can use the plan.",
            "example": true
          }
        }
      },
      "DeploymentFreeQuota": {
        "type": "object",
        "required": [
          "limit",
          "used",
          "remaining"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "description": "How many Free plan apps the account may run. `0` when no Free plan is offered.",
            "example": 5
          },
          "used": {
            "type": "integer",
            "description": "Free plan apps the account runs now.",
            "example": 2
          },
          "remaining": {
            "type": "integer",
            "description": "Free plan apps that can still be created.",
            "example": 3
          }
        }
      },
      "DeploymentSummary": {
        "type": "object",
        "required": [
          "total",
          "active",
          "building",
          "needs_attention"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Number of deployments.",
            "example": 4
          },
          "active": {
            "type": "integer",
            "description": "Deployments with status `active`.",
            "example": 3
          },
          "building": {
            "type": "integer",
            "description": "Deployments whose display status is building, updating, queued or deploying.",
            "example": 1
          },
          "needs_attention": {
            "type": "integer",
            "description": "Deployments with status `failed`.",
            "example": 1
          }
        }
      },
      "DeploymentActivityDay": {
        "type": "object",
        "required": [
          "date",
          "count",
          "succeeded",
          "failed"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "Day (`YYYY-MM-DD`, West Africa Time).",
            "example": "2026-11-18"
          },
          "count": {
            "type": "integer",
            "description": "Runs started that day.",
            "example": 3
          },
          "succeeded": {
            "type": "integer",
            "description": "Of those, runs that are `ready`.",
            "example": 2
          },
          "failed": {
            "type": "integer",
            "description": "Of those, runs that `failed`.",
            "example": 1
          }
        }
      },
      "Deployment": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "status",
          "plan_slug",
          "repo_url",
          "branch",
          "app_type",
          "build_method",
          "port",
          "auto_deploy_enabled",
          "security_scan_enabled",
          "preview_apps_enabled",
          "artifact_retention",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the deployment."
          },
          "name": {
            "type": "string",
            "description": "Display name.",
            "example": "acme-api"
          },
          "slug": {
            "type": "string",
            "description": "URL-safe name, unique in the workspace.",
            "example": "acme-api"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "building",
              "failed",
              "paused",
              "idle",
              "deleted"
            ],
            "description": "`building` until the first version is live, then `active`. `failed` when the last\ndeploy failed and nothing is live, `idle` while a scale-to-zero app is asleep (it wakes\non the next request), `paused` while the account is suspended for non-payment (the\napp is scaled to zero and stops billing for compute; it is resumed automatically once\nthe account is active again), `deleted` after deletion. A deployment created without\n`deploy_now` is `active` even though nothing has been deployed.\n"
          },
          "display_status": {
            "type": "string",
            "description": "Status to show to people. Same as `status`, except `updating` while a live deployment's next version is still building, and `starting` once that build has an image and the app is coming up. Only computed by list and get; elsewhere equal to `status`.",
            "example": "active"
          },
          "plan_slug": {
            "type": "string",
            "description": "Slug of the deployment's plan.",
            "example": "deploy-tiny"
          },
          "plan_name": {
            "type": "string",
            "description": "Name of the plan.",
            "example": "Tiny"
          },
          "vcpu": {
            "type": "integer",
            "description": "Whole vCPU count of the plan. Coarse; prefer `cpu_limit_millis`."
          },
          "cpu_limit_millis": {
            "type": "integer",
            "description": "CPU limit per replica in millicores.",
            "example": 1000
          },
          "memory_mib": {
            "type": "integer",
            "description": "Memory limit per replica in MiB.",
            "example": 512
          },
          "monthly_price_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Plan price per month per replica, in cents. Omitted for free plans."
          },
          "hourly_price_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Hourly price in whole cents. Omitted when `0`."
          },
          "hourly_price_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Hourly price in millionths of the currency unit. Omitted for free plans."
          },
          "currency": {
            "type": "string",
            "description": "ISO currency code of the prices.",
            "example": "USD"
          },
          "free_allowance_count": {
            "type": "integer",
            "description": "Present on Free plans with the per-account allowance."
          },
          "repo_url": {
            "type": "string",
            "description": "Git repository the deployment builds from. Empty for one-click app components, which run a prebuilt image.",
            "example": "https://github.com/acme/api.git"
          },
          "git_provider": {
            "type": "string",
            "description": "`github_app` when the repository is connected through the RumptyCloud GitHub App."
          },
          "git_repo_full_name": {
            "type": "string",
            "description": "`owner/repository` on GitHub."
          },
          "git_repo_id": {
            "type": "string",
            "description": "GitHub repository ID."
          },
          "branch": {
            "type": "string",
            "description": "Branch that is built.",
            "example": "main"
          },
          "root_directory": {
            "type": "string",
            "description": "Folder inside the repository that is built. Omitted when building from the root."
          },
          "app_type": {
            "type": "string",
            "enum": [
              "service",
              "static"
            ],
            "description": "Kind of app."
          },
          "build_method": {
            "type": "string",
            "enum": [
              "railpack",
              "dockerfile",
              "image"
            ],
            "description": "How the image is built. `image` is used by one-click app components, which run a prebuilt image."
          },
          "build_command": {
            "type": "string",
            "description": "Build command override, if set."
          },
          "start_command": {
            "type": "string",
            "description": "Start command override, if set."
          },
          "health_check_path": {
            "type": "string",
            "description": "Path probed for health.",
            "example": "/healthz"
          },
          "port": {
            "type": "integer",
            "description": "Port the app listens on.",
            "example": 3000
          },
          "auto_deploy_enabled": {
            "type": "boolean",
            "description": "Whether pushes to the branch deploy automatically."
          },
          "security_scan_enabled": {
            "type": "boolean",
            "description": "Whether built images are scanned for vulnerabilities."
          },
          "preview_apps_enabled": {
            "type": "boolean",
            "description": "Whether pull requests get preview apps."
          },
          "artifact_retention": {
            "type": "integer",
            "description": "How many built images are kept for rollbacks. `0` keeps all.",
            "example": 5
          },
          "previews": {
            "type": "array",
            "description": "Live pull request previews. Only returned by [Get a deployment](/api/deployments/get-a-deployment).",
            "items": {
              "$ref": "#/components/schemas/DeploymentPreview"
            }
          },
          "volume_mount_path": {
            "type": "string",
            "description": "Mount path of the persistent volume. Omitted without a volume."
          },
          "volume_size_gib": {
            "type": "integer",
            "description": "Size of the persistent volume(s) in GiB. Omitted without a volume."
          },
          "scale_to_zero_enabled": {
            "type": "boolean",
            "description": "Present and `true` when the app sleeps when idle."
          },
          "scale_to_zero_idle_minutes": {
            "type": "integer",
            "description": "Idle minutes before the app sleeps."
          },
          "min_replicas": {
            "type": "integer",
            "description": "Instances always running."
          },
          "max_replicas": {
            "type": "integer",
            "description": "Autoscaling upper bound."
          },
          "target_request_rate": {
            "type": "integer",
            "description": "Requests per second per replica before scaling out."
          },
          "current_replicas": {
            "type": "integer",
            "description": "Replicas running now. Each is billed at the plan rate."
          },
          "app_uid": {
            "type": "string",
            "description": "Set when the deployment is a component of a one-click app. Such deployments cannot be deleted or change plan on their own."
          },
          "custom_domain": {
            "type": "string",
            "description": "The verified custom domain that `public_url` uses, if any.",
            "example": "api.acme.com"
          },
          "last_run_uid": {
            "type": "string",
            "description": "UID of the most recent run."
          },
          "last_run_status": {
            "type": "string",
            "enum": [
              "queued",
              "building",
              "ready",
              "failed",
              "canceled"
            ],
            "description": "Status of the most recent run. Only returned by list and get."
          },
          "public_url": {
            "type": "string",
            "description": "URL the app is served at. Uses the custom domain once one is verified. Empty after deletion.",
            "example": "https://acme-api.rumptycloud.app"
          },
          "default_public_url": {
            "type": "string",
            "description": "The app's URL on the platform domain. Point custom domain `CNAME` records at its host.",
            "example": "https://acme-api.rumptycloud.app"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the deployment was created."
          },
          "last_failure": {
            "type": "string",
            "description": "Readable reason for the last failure. Omitted when there is none."
          },
          "env_changes_pending": {
            "type": "boolean",
            "description": "Present and `true` when environment variables changed since the last deploy and are waiting to be applied. Only returned by [Get a deployment](/api/deployments/get-a-deployment)."
          },
          "env_changes_require_build": {
            "type": "boolean",
            "description": "Present and `true` when the pending changes need a rebuild ([Deploy a deployment](/api/deployments/deploy-a-deployment)) rather than [Apply environment changes](/api/deployments/apply-environment-changes). Only returned by get."
          },
          "crashloop": {
            "$ref": "#/components/schemas/DeploymentCrashloop"
          }
        }
      },
      "DeploymentCrashloop": {
        "type": "object",
        "description": "Present while the platform is holding the app down because it was not healthy.",
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "paused",
              "stopped"
            ],
            "description": "`paused`: the app was serving, became unhealthy and is retried automatically. `stopped`: nothing more happens until you restart or redeploy."
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "When the app was taken down."
          },
          "reason": {
            "type": "string",
            "description": "Why the app was taken down."
          },
          "next_retry_at": {
            "type": "string",
            "format": "date-time",
            "description": "Next automatic attempt. Only while `paused`."
          }
        }
      },
      "DeploymentPreview": {
        "type": "object",
        "required": [
          "uid",
          "pr_number",
          "branch",
          "status"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "UID of the preview deployment."
          },
          "pr_number": {
            "type": "integer",
            "description": "Pull request number.",
            "example": 42
          },
          "branch": {
            "type": "string",
            "description": "Pull request branch.",
            "example": "feature/login"
          },
          "status": {
            "type": "string",
            "description": "Preview status, using the same values as a deployment's `display_status`.",
            "example": "active"
          },
          "commit_sha": {
            "type": "string",
            "description": "Commit of the preview's latest run."
          },
          "public_url": {
            "type": "string",
            "description": "URL of the preview."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the preview is removed automatically."
          }
        }
      },
      "DeploymentRun": {
        "type": "object",
        "required": [
          "uid",
          "deployment_uid",
          "operation_id",
          "trigger",
          "status",
          "branch",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the run."
          },
          "deployment_uid": {
            "type": "string",
            "description": "UID of the deployment."
          },
          "operation_id": {
            "type": "string",
            "description": "UID of the operation that tracks the run. See [Get an operation](/api/operations/get-an-operation)."
          },
          "trigger": {
            "type": "string",
            "enum": [
              "manual",
              "git_push",
              "git_pull_request"
            ],
            "description": "What started the run."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "building",
              "ready",
              "failed",
              "canceled"
            ],
            "description": "`ready` once the version is live. `canceled` when a newer run superseded it. Rollouts without a build start at `building`."
          },
          "branch": {
            "type": "string",
            "description": "Branch the run built.",
            "example": "main"
          },
          "commit_sha": {
            "type": "string",
            "description": "Commit that was built, when known."
          },
          "commit_message": {
            "type": "string",
            "description": "Commit message or label."
          },
          "trigger_actor": {
            "type": "string",
            "description": "Who started the run. For manual runs, the username (or email) of the member who made the request; for pushes and pull requests, the GitHub login."
          },
          "trigger_actor_url": {
            "type": "string",
            "description": "Link to the actor's profile, when known."
          },
          "image_digest": {
            "type": "string",
            "description": "Digest of the built image. Omitted when the run has no image (failed, or deleted)."
          },
          "artifact_size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Size of the stored image in bytes. Omitted when unknown or deleted."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the run was queued."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When work began."
          },
          "finished_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the run finished."
          },
          "last_failure": {
            "type": "string",
            "description": "Readable reason the run failed."
          },
          "security_scan": {
            "$ref": "#/components/schemas/DeploymentSecurityScan"
          }
        }
      },
      "DeploymentSecurityScan": {
        "type": "object",
        "description": "Vulnerability scan of the run's image. Present when scanning is enabled.",
        "required": [
          "uid",
          "status",
          "critical_count",
          "high_count",
          "medium_count",
          "low_count",
          "unknown_count"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the scan."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "scanning",
              "passed",
              "warning",
              "failed",
              "not_scanned"
            ],
            "description": "`warning` when critical or high findings exist. `failed` when the scan itself failed."
          },
          "critical_count": {
            "type": "integer",
            "description": "Critical findings."
          },
          "high_count": {
            "type": "integer",
            "description": "High findings."
          },
          "medium_count": {
            "type": "integer",
            "description": "Medium findings."
          },
          "low_count": {
            "type": "integer",
            "description": "Low findings."
          },
          "unknown_count": {
            "type": "integer",
            "description": "Findings of unknown severity."
          },
          "scanner": {
            "type": "string",
            "description": "Scanner used.",
            "example": "trivy"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the scan started."
          },
          "finished_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the scan finished."
          },
          "scanned_at": {
            "type": "string",
            "format": "date-time",
            "description": "Same as `finished_at`."
          },
          "vulnerabilities": {
            "type": "array",
            "description": "Individual findings. Only returned by [Get a deployment run](/api/deployments/get-a-deployment-run).",
            "items": {
              "$ref": "#/components/schemas/DeploymentVulnerability"
            }
          }
        }
      },
      "DeploymentVulnerability": {
        "type": "object",
        "required": [
          "id",
          "severity",
          "package_name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Vulnerability ID, such as a CVE.",
            "example": "CVE-2026-31337"
          },
          "severity": {
            "type": "string",
            "description": "Severity reported by the scanner, such as `CRITICAL`, `HIGH`, `MEDIUM`, `LOW` or `UNKNOWN`.",
            "example": "HIGH"
          },
          "package_name": {
            "type": "string",
            "description": "Affected package."
          },
          "installed_version": {
            "type": "string",
            "description": "Installed version."
          },
          "fixed_version": {
            "type": "string",
            "description": "First version with a fix, if any."
          },
          "title": {
            "type": "string",
            "description": "Short title."
          },
          "description": {
            "type": "string",
            "description": "Longer description."
          },
          "source": {
            "type": "string",
            "description": "Where the package was found, such as the OS release or a lockfile."
          },
          "advisory_url": {
            "type": "string",
            "description": "Link to the advisory."
          }
        }
      },
      "DeploymentRunLog": {
        "type": "object",
        "required": [
          "uid",
          "run_uid",
          "operation_id",
          "deployment_uid",
          "message",
          "occurred_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the log line."
          },
          "run_uid": {
            "type": "string",
            "description": "UID of the run."
          },
          "operation_id": {
            "type": "string",
            "description": "UID of the run's operation."
          },
          "deployment_uid": {
            "type": "string",
            "description": "UID of the deployment."
          },
          "step": {
            "type": "string",
            "description": "Build or rollout step that wrote the line.",
            "example": "build"
          },
          "stream": {
            "type": "string",
            "description": "Output stream, such as `stdout` or `stderr`.",
            "example": "stdout"
          },
          "message": {
            "type": "string",
            "description": "The log text."
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the line was written (RFC 3339 with nanoseconds)."
          }
        }
      },
      "DeploymentOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "deployment",
          "status",
          "is_replay"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued operation. Empty when nothing was queued (create without `deploy_now`, or a plan change with nothing live)."
          },
          "deployment": {
            "$ref": "#/components/schemas/Deployment"
          },
          "run": {
            "$ref": "#/components/schemas/DeploymentRun"
          },
          "status": {
            "type": "string",
            "description": "Status of the operation (`queued` for a new request; the original operation's status, such as `running` or `succeeded`, on a replay). Without an operation, the deployment status on create or `completed` on a plan change.",
            "example": "queued"
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress. Omitted without an operation."
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an `X-Idempotency` key was reused and the original operation is returned instead of a new one.",
            "example": false
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished. Omitted unless `true`."
          }
        }
      },
      "DeploymentCustomDomainOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "status",
          "events_url",
          "is_replay"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued operation. Empty when verifying a domain that is already `active`."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the operation. `queued` for a new request, `succeeded` for a domain that is already active, and the original operation's status on a replay."
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress. Empty when `operation_id` is empty."
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an `X-Idempotency` key was reused and the original operation is returned instead of a new one.",
            "example": false
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished. Omitted unless `true`."
          }
        }
      },
      "DeploymentEnvVarInput": {
        "type": "object",
        "required": [
          "key",
          "value"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$",
            "description": "Variable name. Starts with a letter or underscore, then letters, digits and underscores, up to 128 characters.",
            "example": "DATABASE_URL"
          },
          "value": {
            "type": "string",
            "description": "Variable value. Must not be empty. Trailing newlines are removed (surrounding whitespace is trimmed for `env_vars` on create).",
            "example": "postgres://app:s3cret@db.internal:5432/app"
          },
          "scope": {
            "type": "string",
            "enum": [
              "build",
              "runtime",
              "both"
            ],
            "description": "Kept for older clients. Every variable is available at build time and at runtime whatever you send, and it is stored as `build`."
          },
          "is_secret": {
            "type": "boolean",
            "default": true,
            "description": "Marks the value as secret."
          }
        }
      },
      "DeploymentEnvVar": {
        "type": "object",
        "required": [
          "uid",
          "key",
          "scope",
          "is_secret",
          "masked_value",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the variable."
          },
          "key": {
            "type": "string",
            "description": "Variable name.",
            "example": "DATABASE_URL"
          },
          "scope": {
            "type": "string",
            "description": "Always `build`. Every variable is available at build time and at runtime.",
            "example": "build"
          },
          "is_secret": {
            "type": "boolean",
            "description": "Whether the value is marked secret."
          },
          "masked_value": {
            "type": "string",
            "description": "Always `••••••••`. The value is never returned here.",
            "example": "••••••••"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the variable was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was last changed."
          }
        }
      },
      "DeploymentEnvVarReveal": {
        "type": "object",
        "required": [
          "uid",
          "key",
          "value"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the variable."
          },
          "key": {
            "type": "string",
            "description": "Variable name.",
            "example": "STRIPE_SECRET_KEY"
          },
          "value": {
            "type": "string",
            "description": "The decrypted plaintext value. Sensitive."
          }
        }
      },
      "DeploymentCustomDomain": {
        "type": "object",
        "required": [
          "uid",
          "domain_name",
          "status",
          "verification_txt",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the custom domain."
          },
          "deployment_uid": {
            "type": "string",
            "description": "UID of the deployment the domain is attached to."
          },
          "domain_name": {
            "type": "string",
            "description": "The custom domain.",
            "example": "api.acme.com"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "active",
              "failed"
            ],
            "description": "`pending` until verified and routed, `active` once traffic is served, `failed` when DNS verification failed (see `last_error`)."
          },
          "verification_txt": {
            "type": "string",
            "description": "Value to publish in a `TXT` record at `rumpty-challenge.<domain_name>`.",
            "example": "rumpty-verification-019a9b50"
          },
          "last_error": {
            "type": "string",
            "description": "Reason for the last failure. Omitted when there is none."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the domain was added."
          }
        }
      },
      "DeploymentMetricsCurrent": {
        "type": "object",
        "required": [
          "deployment_uid",
          "available",
          "stale",
          "replica_count",
          "ready_replica_count",
          "cpu_cores",
          "cpu_limit_cores",
          "memory_bytes",
          "memory_limit_bytes",
          "network_rx_bytes_per_sec",
          "network_tx_bytes_per_sec",
          "sampled_at"
        ],
        "properties": {
          "deployment_uid": {
            "type": "string",
            "description": "UID of the deployment."
          },
          "available": {
            "type": "boolean",
            "description": "`false` when no sample has been received yet."
          },
          "stale": {
            "type": "boolean",
            "description": "`true` when the sample is more than two minutes old."
          },
          "replica_count": {
            "type": "integer",
            "description": "Replicas that exist."
          },
          "ready_replica_count": {
            "type": "integer",
            "description": "Replicas that are ready."
          },
          "cpu_cores": {
            "type": "number",
            "description": "CPU in use, in cores.",
            "example": 0.12
          },
          "cpu_limit_cores": {
            "type": "number",
            "description": "Plan CPU limit in cores.",
            "example": 1
          },
          "cpu_percent": {
            "type": "number",
            "description": "`cpu_cores` as a percentage of `cpu_limit_cores`. Omitted without a sample."
          },
          "memory_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Memory in use, in bytes."
          },
          "memory_limit_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Plan memory limit in bytes."
          },
          "memory_percent": {
            "type": "number",
            "description": "Memory use as a percentage of the limit. Omitted without a sample."
          },
          "network_rx_bytes_per_sec": {
            "type": "number",
            "description": "Inbound network rate in bytes per second."
          },
          "network_tx_bytes_per_sec": {
            "type": "number",
            "description": "Outbound network rate in bytes per second."
          },
          "storage_used_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Used space on persistent volumes. Omitted without volumes."
          },
          "storage_capacity_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Capacity of persistent volumes. Omitted without volumes."
          },
          "storage_percent": {
            "type": "number",
            "description": "Volume usage as a percentage. Omitted without volumes."
          },
          "sampled_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the sample was taken (the current time when `available` is `false`)."
          },
          "unavailable_reason": {
            "type": "string",
            "description": "Why metrics are unavailable, for example `no metrics received yet`."
          }
        }
      },
      "DeploymentMetricsPoint": {
        "type": "object",
        "required": [
          "timestamp",
          "replica_count",
          "ready_replica_count",
          "cpu_cores",
          "memory_bytes",
          "network_rx_bytes_per_sec",
          "network_tx_bytes_per_sec"
        ],
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "When the sample was taken."
          },
          "replica_count": {
            "type": "integer",
            "description": "Replicas that existed."
          },
          "ready_replica_count": {
            "type": "integer",
            "description": "Replicas that were ready."
          },
          "cpu_cores": {
            "type": "number",
            "description": "CPU in use, in cores."
          },
          "memory_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Memory in use, in bytes."
          },
          "network_rx_bytes_per_sec": {
            "type": "number",
            "description": "Inbound network rate in bytes per second."
          },
          "network_tx_bytes_per_sec": {
            "type": "number",
            "description": "Outbound network rate in bytes per second."
          },
          "storage_used_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Used space on persistent volumes. Omitted without volumes."
          },
          "storage_capacity_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Capacity of persistent volumes. Omitted without volumes."
          }
        }
      },
      "DeploymentMetricsHistory": {
        "type": "object",
        "required": [
          "deployment_uid",
          "available",
          "stale",
          "range",
          "step_seconds",
          "latest",
          "points"
        ],
        "properties": {
          "deployment_uid": {
            "type": "string",
            "description": "UID of the deployment."
          },
          "available": {
            "type": "boolean",
            "description": "`false` when there are no samples in the range."
          },
          "stale": {
            "type": "boolean",
            "description": "`true` when the newest sample is more than two minutes old."
          },
          "range": {
            "type": "string",
            "description": "The requested range.",
            "example": "1h"
          },
          "step_seconds": {
            "type": "integer",
            "description": "Suggested chart resolution for the range: 15, 60, 300, 900, 3600 or 21600 seconds.",
            "example": 60
          },
          "latest": {
            "description": "The newest sample, or `null` when there are none.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/DeploymentMetricsPoint"
              },
              {
                "type": "null"
              }
            ]
          },
          "points": {
            "type": "array",
            "description": "Samples in the range, oldest first. Up to 2,000.",
            "items": {
              "$ref": "#/components/schemas/DeploymentMetricsPoint"
            }
          },
          "unavailable_reason": {
            "type": "string",
            "description": "Why there is no data, for example `no metrics received in range`."
          }
        }
      },
      "DeploymentTraffic": {
        "type": "object",
        "required": [
          "deployment_uid",
          "available",
          "range",
          "step_seconds",
          "requests_total",
          "errors_total",
          "error_rate",
          "rx_bytes",
          "tx_bytes",
          "points"
        ],
        "properties": {
          "deployment_uid": {
            "type": "string",
            "description": "UID of the deployment."
          },
          "available": {
            "type": "boolean",
            "description": "`false` when traffic data could not be read. The other totals are then `0`."
          },
          "range": {
            "type": "string",
            "description": "The requested range.",
            "example": "1h"
          },
          "step_seconds": {
            "type": "integer",
            "description": "Width of each bucket in `points`, in seconds.",
            "example": 60
          },
          "requests_total": {
            "type": "integer",
            "format": "int64",
            "description": "Requests served in the range."
          },
          "errors_total": {
            "type": "integer",
            "format": "int64",
            "description": "Requests that returned a 5xx status."
          },
          "error_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "`errors_total / requests_total`, from 0 to 1."
          },
          "rx_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes received from clients."
          },
          "tx_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes sent to clients."
          },
          "points": {
            "type": "array",
            "description": "Requests and errors per bucket, oldest first.",
            "items": {
              "type": "object",
              "required": [
                "timestamp",
                "requests",
                "errors"
              ],
              "properties": {
                "timestamp": {
                  "type": "string",
                  "format": "date-time",
                  "description": "End of the bucket."
                },
                "requests": {
                  "type": "number",
                  "description": "Requests in the bucket."
                },
                "errors": {
                  "type": "number",
                  "description": "5xx responses in the bucket."
                }
              }
            }
          },
          "unavailable_reason": {
            "type": "string",
            "description": "Why traffic is unavailable: `traffic metrics are not available in this environment`,\n`this app has no public route` or `traffic metrics are temporarily unavailable`.\n"
          }
        }
      },
      "AppTemplate": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "description",
          "icon",
          "category",
          "default_plan_slug",
          "components",
          "from_monthly_cents"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "description": "Identifier to pass as `template`.",
            "example": "wordpress"
          },
          "name": {
            "type": "string",
            "description": "Display name.",
            "example": "WordPress"
          },
          "description": {
            "type": "string",
            "description": "Short description of the app."
          },
          "icon": {
            "type": "string",
            "description": "Icon identifier used by the console.",
            "example": "wordpress"
          },
          "category": {
            "type": "string",
            "description": "Catalog category, such as `cms` or `monitoring`.",
            "example": "cms"
          },
          "default_plan_slug": {
            "type": "string",
            "description": "Plan used for the web component when `plan_slug` is not sent.",
            "example": "deploy-scale"
          },
          "recommended_plan_slug": {
            "type": "string",
            "description": "Smallest plan the app runs comfortably on.",
            "example": "deploy-scale"
          },
          "components": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "database",
                "web"
              ]
            },
            "description": "Roles of the template's components, in deploy order (backing services first).",
            "example": [
              "database",
              "web"
            ]
          },
          "component_details": {
            "type": "array",
            "description": "Details of each component, for cost breakdowns and plan pickers.",
            "items": {
              "$ref": "#/components/schemas/AppTemplateComponent"
            }
          },
          "db_default_plan_slug": {
            "type": "string",
            "description": "Plan used for the primary database component when `db_plan_slug` is not sent. Omitted for templates without a database.",
            "example": "deploy-tiny"
          },
          "versions": {
            "type": "array",
            "description": "Bundled software and its pinned version, web app first.",
            "items": {
              "$ref": "#/components/schemas/AppTemplateVersion"
            }
          },
          "setup_note": {
            "type": "string",
            "description": "First-run instructions to follow once the app is live."
          },
          "env_docs_url": {
            "type": "string",
            "description": "Link to the software's configuration reference."
          },
          "from_monthly_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Starting price per month in cents (default plans plus included volumes).",
            "example": 1070
          }
        }
      },
      "AppTemplateComponent": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "database",
              "web"
            ],
            "description": "`web` for the public app, `database` for a private backing service."
          },
          "suffix": {
            "type": "string",
            "description": "Suffix added to the app name for this component's deployment, such as `db`. Omitted for the web component.",
            "example": "db"
          },
          "plan_slug": {
            "type": "string",
            "description": "Plan pinned for this component. Omitted when it uses the web plan.",
            "example": "deploy-tiny"
          },
          "name": {
            "type": "string",
            "description": "Name of the software the component runs.",
            "example": "MariaDB"
          }
        }
      },
      "AppTemplateVersion": {
        "type": "object",
        "required": [
          "name",
          "version"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Software name.",
            "example": "WordPress"
          },
          "version": {
            "type": "string",
            "description": "Pinned version.",
            "example": "7.1"
          }
        }
      },
      "App": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "template",
          "status",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the app."
          },
          "name": {
            "type": "string",
            "description": "Display name.",
            "example": "blog"
          },
          "slug": {
            "type": "string",
            "description": "URL-safe name, unique among the workspace's apps.",
            "example": "blog"
          },
          "template": {
            "type": "string",
            "description": "Slug of the template the app was created from.",
            "example": "wordpress"
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning_database",
              "provisioning_app",
              "active",
              "failed",
              "deleted"
            ],
            "description": "`provisioning_database` while backing services start, `provisioning_app` once they are\nready and the web component is starting, `active` when every component is ready,\n`failed` if provisioning failed (see `last_failure`), `deleted` after deletion.\n"
          },
          "public_url": {
            "type": "string",
            "description": "URL of the app, taken from the web component (including a verified custom domain).",
            "example": "https://blog.rumptycloud.app"
          },
          "last_failure": {
            "type": "string",
            "description": "Why provisioning failed. Omitted when there is no failure."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the app was created."
          },
          "components": {
            "type": "array",
            "description": "The app's component deployments, in deploy order.",
            "items": {
              "$ref": "#/components/schemas/AppComponent"
            }
          },
          "setup_note": {
            "type": "string",
            "description": "First-run instructions from the template, with the app's URL filled in."
          },
          "env_docs_url": {
            "type": "string",
            "description": "Link to the software's configuration reference."
          }
        }
      },
      "AppComponent": {
        "type": "object",
        "required": [
          "role",
          "deployment_uid"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "database",
              "web"
            ],
            "description": "Role of the component."
          },
          "deployment_uid": {
            "type": "string",
            "description": "UID of the component's deployment. Use it with the [deployment endpoints](/api/deployments/get-a-deployment)."
          },
          "name": {
            "type": "string",
            "description": "Name of the component deployment. Omitted once the component is deleted.",
            "example": "blog-db"
          },
          "status": {
            "type": "string",
            "description": "Status of the component deployment (see `status` on [Get a deployment](/api/deployments/get-a-deployment)). Omitted once deleted.",
            "example": "active"
          },
          "plan_slug": {
            "type": "string",
            "description": "Plan of the component deployment. Omitted once deleted.",
            "example": "deploy-tiny"
          }
        }
      },
      "AppOperationResult": {
        "type": "object",
        "required": [
          "app",
          "status",
          "is_replay"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the `app_provision` operation. Omitted on delete."
          },
          "app": {
            "$ref": "#/components/schemas/App"
          },
          "status": {
            "type": "string",
            "description": "`running` (the provisioning operation's status) on create, `deleted` on delete. On a replayed create, the operation's current status (`running`, `succeeded` or `failed`).",
            "example": "running"
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with provisioning progress. Omitted on delete."
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an `X-Idempotency` key was reused and the original result is returned.",
            "example": false
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished (always on a replayed delete). Omitted unless `true`."
          }
        }
      },
      "GitConnectionInstallUrl": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "description": "GitHub URL to open in a browser to install the app and connect it to the workspace. Valid for 10 minutes.",
            "example": "https://github.com/apps/rumptycloud/installations/new?state=eyJ1c2VyX3VpZCI6IjAxOWE3YjEwLi4uIn0.3kX9mQ2v8bN1pL7yH4cF6dJ0sA1gE3uR8iOq8Zr3mT1"
          }
        }
      },
      "GitConnectionInstallation": {
        "type": "object",
        "required": [
          "uid",
          "provider",
          "installation_id",
          "dependent_deployments"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the connection in this workspace.",
            "example": "019a8e01-4c5d-7e6f-8a9b-0c1d2e3f4a5b"
          },
          "provider": {
            "type": "string",
            "enum": [
              "github_app"
            ],
            "description": "Git provider. Always `github_app`.",
            "example": "github_app"
          },
          "installation_id": {
            "type": "integer",
            "format": "int64",
            "description": "GitHub's ID for the app installation.",
            "example": 58213904
          },
          "account_login": {
            "type": "string",
            "description": "GitHub login of the account or organization the app is installed on.",
            "example": "acme-inc"
          },
          "account_type": {
            "type": "string",
            "description": "GitHub account type, as reported by GitHub (for example `User` or `Organization`).",
            "example": "Organization"
          },
          "repository_selection": {
            "type": "string",
            "description": "Whether the app can access `all` repositories of the account or only `selected` ones, as reported by GitHub.",
            "example": "selected"
          },
          "connected_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the connection was last made or refreshed.",
            "example": "2026-11-18T09:12:44Z"
          },
          "connected_by": {
            "type": "string",
            "description": "Username of the member who connected the GitHub account. Omitted if unknown.",
            "example": "ada"
          },
          "connected_by_former_member": {
            "type": "boolean",
            "description": "Present and `true` when the member who connected it has since left the workspace. The connection keeps working until it is disconnected.",
            "example": true
          },
          "dependent_deployments": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the workspace's deployments that build from this GitHub account's repositories.",
            "example": [
              "marketing-site",
              "api"
            ]
          }
        }
      },
      "GitConnectionReusableInstallation": {
        "type": "object",
        "required": [
          "uid"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "UID of your connection in the other workspace. Pass it to [Link a GitHub App installation](/api/git-connections/link-a-github-app-installation).",
            "example": "019a5c22-7d8e-7f90-8a1b-2c3d4e5f6a7b"
          },
          "account_login": {
            "type": "string",
            "description": "GitHub login of the account or organization.",
            "example": "ada-lovelace"
          },
          "account_type": {
            "type": "string",
            "description": "GitHub account type, for example `User` or `Organization`.",
            "example": "User"
          },
          "workspace_name": {
            "type": "string",
            "description": "Name of the other workspace the connection was made in.",
            "example": "Personal"
          }
        }
      },
      "GitConnectionRepository": {
        "type": "object",
        "required": [
          "id",
          "name",
          "full_name",
          "owner",
          "private",
          "default_branch",
          "clone_url",
          "html_url"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "GitHub's repository ID.",
            "example": 712345678
          },
          "name": {
            "type": "string",
            "description": "Repository name.",
            "example": "marketing-site"
          },
          "full_name": {
            "type": "string",
            "description": "Repository in `owner/name` form. Use it as `repo` in other Git Connections endpoints.",
            "example": "acme-inc/marketing-site"
          },
          "owner": {
            "type": "string",
            "description": "GitHub login of the repository owner.",
            "example": "acme-inc"
          },
          "private": {
            "type": "boolean",
            "description": "Whether the repository is private.",
            "example": true
          },
          "default_branch": {
            "type": "string",
            "description": "The repository's default branch.",
            "example": "main"
          },
          "clone_url": {
            "type": "string",
            "description": "HTTPS clone URL.",
            "example": "https://github.com/acme-inc/marketing-site.git"
          },
          "html_url": {
            "type": "string",
            "description": "Repository page on GitHub.",
            "example": "https://github.com/acme-inc/marketing-site"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the repository was last updated on GitHub. Omitted if GitHub did not report it.",
            "example": "2026-11-17T16:42:05Z"
          },
          "installation_id": {
            "type": "integer",
            "format": "int64",
            "description": "GitHub installation ID of the connection that gives access to the repository.",
            "example": 58213904
          },
          "installation_account": {
            "type": "string",
            "description": "GitHub account of the connection that gives access to the repository.",
            "example": "acme-inc"
          }
        }
      },
      "GitConnectionBranch": {
        "type": "object",
        "required": [
          "name",
          "default"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Branch name.",
            "example": "main"
          },
          "commit_sha": {
            "type": "string",
            "description": "SHA of the branch's latest commit.",
            "example": "9f2c4e1a7b3d5f6e8a0b1c2d3e4f5a6b7c8d9e0f"
          },
          "default": {
            "type": "boolean",
            "description": "Meant to flag the default branch, but currently always `false`. Use `default_branch` from [List GitHub repositories](/api/git-connections/list-github-repositories) instead.",
            "example": false
          }
        }
      },
      "GitConnectionDetection": {
        "type": "object",
        "required": [
          "detected",
          "supported_build_methods",
          "root_directory",
          "message"
        ],
        "properties": {
          "detected": {
            "type": "boolean",
            "description": "`true` when a supported app was recognised.",
            "example": true
          },
          "app_type": {
            "type": "string",
            "enum": [
              "static",
              "service"
            ],
            "description": "`static` for sites built to static files, `service` for apps that run a server. Omitted when nothing was detected.",
            "example": "service"
          },
          "framework": {
            "type": "string",
            "description": "Detected framework or language, for example `Next.js`, `Vite`, `Go`, `Python`, `Static site` or `Dockerfile`. Omitted when nothing was detected.",
            "example": "Next.js"
          },
          "recommended_build_method": {
            "type": "string",
            "enum": [
              "railpack",
              "dockerfile"
            ],
            "description": "Suggested build method. `dockerfile` when a Dockerfile was found, otherwise `railpack`. Omitted when nothing was detected.",
            "example": "dockerfile"
          },
          "supported_build_methods": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "railpack",
                "dockerfile"
              ]
            },
            "description": "Build methods that can be used. Always includes `railpack`. `dockerfile` is added when a Dockerfile was found.",
            "example": [
              "railpack",
              "dockerfile"
            ]
          },
          "root_directory": {
            "type": "string",
            "description": "Folder the app lives in, relative to the repository root. Empty string for the root.",
            "example": "apps/web"
          },
          "dockerfile_path": {
            "type": "string",
            "description": "Path of the detected Dockerfile. Omitted when there is none.",
            "example": "apps/web/Dockerfile"
          },
          "message": {
            "type": "string",
            "description": "Human-readable summary of what was detected.",
            "example": "Next.js app detected. It needs a server, so we'll run it as a service."
          }
        }
      },
      "DatabasePlan": {
        "type": "object",
        "required": [
          "name",
          "slug",
          "product",
          "zone_slug",
          "vcpu",
          "memory_mib",
          "included_disk_gib",
          "included_egress_gib",
          "network_ingress_mbit",
          "network_egress_mbit",
          "monthly_price_cents",
          "hourly_price_cents",
          "hourly_price_micros",
          "currency",
          "available"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Plan UID."
          },
          "name": {
            "type": "string",
            "description": "Display name of the plan.",
            "example": "Seed"
          },
          "slug": {
            "type": "string",
            "description": "Identifier to pass as `plan_slug`.",
            "example": "database-seed-olas-closet"
          },
          "product": {
            "type": "string",
            "description": "Always `database`.",
            "example": "database"
          },
          "engine": {
            "type": "string",
            "enum": [
              "postgres",
              "mysql",
              "redis"
            ],
            "description": "Engine the plan is for. Omitted when the plan has no engine set.",
            "example": "postgres"
          },
          "zone_slug": {
            "type": "string",
            "description": "Zone the plan runs in.",
            "example": "olas-closet"
          },
          "vcpu": {
            "type": "integer",
            "description": "Whole vCPUs. Reads `1` on plans with a fractional CPU allowance; use `cpu_limit_millis` for the real cap.",
            "example": 1
          },
          "cpu_request_millis": {
            "type": "integer",
            "description": "Guaranteed CPU in millicores. Omitted when not set.",
            "example": 100
          },
          "cpu_limit_millis": {
            "type": "integer",
            "description": "Maximum CPU in millicores (for example `750` is three quarters of a core). Omitted when not set.",
            "example": 750
          },
          "memory_mib": {
            "type": "integer",
            "description": "Memory in MiB.",
            "example": 512
          },
          "included_disk_gib": {
            "type": "integer",
            "description": "Storage included in the plan, in GiB.",
            "example": 5
          },
          "included_egress_gib": {
            "type": "integer",
            "description": "Outbound traffic included per month, in GiB.",
            "example": 50
          },
          "network_ingress_mbit": {
            "type": "integer",
            "description": "Inbound bandwidth cap in Mbit/s.",
            "example": 50
          },
          "network_egress_mbit": {
            "type": "integer",
            "description": "Outbound bandwidth cap in Mbit/s.",
            "example": 50
          },
          "monthly_price_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Monthly price in cents of `currency`. `0` means a free plan.",
            "example": 185
          },
          "hourly_price_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Hourly price in whole cents.",
            "example": 0
          },
          "hourly_price_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Hourly price in millionths of the currency unit (for example `2534` is $0.002534 an hour). `0` for free plans.",
            "example": 0
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code.",
            "example": "USD"
          },
          "available": {
            "type": "boolean",
            "description": "Whether new databases can be created on the plan. Always `true` here."
          }
        }
      },
      "DatabaseVersion": {
        "type": "object",
        "required": [
          "engine",
          "version",
          "available"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "UID of the underlying engine image."
          },
          "engine": {
            "type": "string",
            "enum": [
              "postgres",
              "mysql",
              "redis"
            ],
            "description": "Engine. `redis` runs Valkey.",
            "example": "postgres"
          },
          "version": {
            "type": "string",
            "description": "Engine version to pass as `version`.",
            "example": "17"
          },
          "architecture": {
            "type": "string",
            "description": "CPU architecture of the image. Omitted when unknown.",
            "example": "amd64"
          },
          "available": {
            "type": "boolean",
            "description": "Whether the version is enabled. Always `true` here."
          }
        }
      },
      "Database": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "engine",
          "status",
          "display_status",
          "zone_slug",
          "storage_gib",
          "vcpu",
          "memory_mib",
          "public_access",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the database.",
            "example": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b"
          },
          "name": {
            "type": "string",
            "description": "Display name.",
            "example": "orders-db"
          },
          "slug": {
            "type": "string",
            "description": "URL-safe version of the name. Not necessarily unique.",
            "example": "orders-db"
          },
          "engine": {
            "type": "string",
            "enum": [
              "postgres",
              "mysql",
              "redis"
            ],
            "description": "Database engine. `redis` runs Valkey.",
            "example": "postgres"
          },
          "version": {
            "type": "string",
            "description": "Engine version. Omitted when unknown.",
            "example": "17"
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "ready",
              "stopped",
              "deleting",
              "deleted",
              "failed"
            ],
            "description": "Lifecycle state. `provisioning` while being created, resized, restored or restarted,\n`ready` when usable, `deleting` while being deleted and `failed` when the last create,\nresize, restore, restart or delete failed. `deleted` only appears in an idempotent replay\nof a delete.\n\n`stopped` means the platform stopped the database because the account was suspended\nfor non-payment. A `ready` database switches to `stopped` as soon as the stop is queued\n(compute billing stops), and stays stopped while the account is suspended. Within about\na minute of the account becoming active again it is restarted: it goes through\n`provisioning` back to `ready` (or `failed` if the restart fails). While `stopped`,\nactions that need a `ready` database (resize, password rotation, snapshots, the data\nbrowser) return `409`. If the stop itself fails, the database stays `ready` and the stop\nis retried.\n",
            "example": "ready"
          },
          "display_status": {
            "type": "string",
            "description": "Status to show in user interfaces. Currently the same values as `status`.",
            "example": "ready"
          },
          "plan_slug": {
            "type": "string",
            "description": "Slug of the database's plan. Omitted when the plan is unknown.",
            "example": "database-seed-olas-closet"
          },
          "zone_slug": {
            "type": "string",
            "description": "Zone the database runs in.",
            "example": "olas-closet"
          },
          "storage_gib": {
            "type": "integer",
            "description": "Provisioned storage in GiB.",
            "example": 5
          },
          "vcpu": {
            "type": "integer",
            "description": "Whole vCPUs of the plan.",
            "example": 1
          },
          "cpu_limit_millis": {
            "type": "integer",
            "description": "CPU cap in millicores. Omitted when not set.",
            "example": 750
          },
          "memory_mib": {
            "type": "integer",
            "description": "Memory in MiB.",
            "example": 512
          },
          "host": {
            "type": "string",
            "description": "Public hostname. Omitted for private MySQL and Redis databases.",
            "example": "pg-1c2d3e.ws-acme.db.rumptycloud.com"
          },
          "port": {
            "type": "integer",
            "description": "Engine port: `5432` (PostgreSQL), `3306` (MySQL) or `6379` (Redis). Public MySQL and Redis clients connect to `public_port` instead.",
            "example": 5432
          },
          "database_name": {
            "type": "string",
            "description": "Name of the database inside the engine. Omitted for Redis.",
            "example": "orders_db"
          },
          "username": {
            "type": "string",
            "description": "Database user.",
            "example": "postgres"
          },
          "password": {
            "type": "string",
            "description": "The database password. **Only returned when a database is created**, never by list or get.",
            "example": "Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ"
          },
          "connection_string": {
            "type": "string",
            "description": "Public connection URL (`postgresql://…?sslmode=require`, `mysql://…` or `rediss://…`).\nContains the password only in the create response. Omitted when the database has no\npublic hostname.\n",
            "example": "postgresql://postgres@pg-1c2d3e.ws-acme.db.rumptycloud.com:5432/orders_db?sslmode=require"
          },
          "internal_host": {
            "type": "string",
            "description": "Private hostname, reachable only from workloads running on RumptyCloud in the same zone.",
            "example": "pg-1c2d3e.db.rumpty.internal"
          },
          "internal_connection_string": {
            "type": "string",
            "description": "Private connection URL using `internal_host` (Redis uses plain `redis://`). Contains the password only in the create response. Omitted when `internal_host` is not known.",
            "example": "postgresql://postgres@pg-1c2d3e.db.rumpty.internal:5432/orders_db?sslmode=require"
          },
          "public_access": {
            "type": "boolean",
            "description": "Whether public access was requested. MySQL and Redis databases only have a public endpoint when this is `true`.",
            "example": false
          },
          "public_port": {
            "type": "integer",
            "description": "Public port for MySQL and Redis databases with public access, in the range 30000–40000. Omitted otherwise.",
            "example": 31842
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the database was created.",
            "example": "2026-11-18T09:12:44Z"
          }
        }
      },
      "DatabasePagination": {
        "type": "object",
        "required": [
          "page",
          "page_size",
          "total",
          "total_pages"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "description": "Current page number.",
            "example": 1
          },
          "page_size": {
            "type": "integer",
            "description": "Items per page.",
            "example": 20
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total number of matching databases.",
            "example": 1
          },
          "total_pages": {
            "type": "integer",
            "description": "Total number of pages.",
            "example": 1
          }
        }
      },
      "DatabaseOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "database",
          "status",
          "events_url",
          "is_replay"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued operation. Poll it with [Get an operation](/api/operations/get-an-operation).",
            "example": "019a9b10-5c6f-7a01-8b2c-3d4e5f6a7b8c"
          },
          "database": {
            "$ref": "#/components/schemas/Database"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the operation. `queued` for a new request; the original operation's status on a replay.",
            "example": "queued"
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress.",
            "example": "/v1/operations/019a9b10-5c6f-7a01-8b2c-3d4e5f6a7b8c/events"
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an existing operation was returned for a reused `X-Idempotency` key."
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished. Omitted unless `true`."
          }
        }
      },
      "DatabaseFreeQuota": {
        "type": "object",
        "required": [
          "limit",
          "used",
          "remaining"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Maximum number of active free-plan databases per account.",
            "example": 2
          },
          "used": {
            "type": "integer",
            "description": "Free-plan databases the account has now, excluding failed and deleted ones.",
            "example": 1
          },
          "remaining": {
            "type": "integer",
            "description": "How many more free-plan databases can be created. Never below `0`.",
            "example": 1
          }
        }
      },
      "DatabaseCredentials": {
        "type": "object",
        "description": "**Secret.** Contains the database password.",
        "required": [
          "username",
          "password",
          "connection_string"
        ],
        "properties": {
          "username": {
            "type": "string",
            "description": "Database user.",
            "example": "postgres"
          },
          "password": {
            "type": "string",
            "description": "The current database password, in plain text.",
            "example": "Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ"
          },
          "connection_string": {
            "type": "string",
            "description": "Public connection URL including the password. Empty string when the database has no public hostname (private MySQL or Redis).",
            "example": "postgresql://postgres:Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ@pg-1c2d3e.ws-acme.db.rumptycloud.com:5432/orders_db?sslmode=require"
          },
          "internal_connection_string": {
            "type": "string",
            "description": "Private connection URL including the password, for workloads running on RumptyCloud. Omitted when the internal host is not known yet.",
            "example": "postgresql://postgres:Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ@pg-1c2d3e.db.rumpty.internal:5432/orders_db?sslmode=require"
          },
          "ca_certificate": {
            "type": "string",
            "description": "PEM certificate that clients can trust to verify the server. Omitted until it is available."
          }
        }
      },
      "DatabaseTable": {
        "type": "object",
        "required": [
          "schema",
          "name",
          "kind",
          "estimated_rows"
        ],
        "properties": {
          "schema": {
            "type": "string",
            "description": "Schema (PostgreSQL) or database (MySQL) the table belongs to.",
            "example": "public"
          },
          "name": {
            "type": "string",
            "description": "Table or view name.",
            "example": "orders"
          },
          "kind": {
            "type": "string",
            "description": "PostgreSQL: `table`, `partitioned_table`, `view`, `materialized_view` or `foreign_table`. MySQL: `table`, `view`, or the lower-case table type for anything else.",
            "example": "table"
          },
          "estimated_rows": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Approximate row count from the engine's statistics. `null` for views and for PostgreSQL tables that have not been analyzed yet.",
            "example": 12650
          }
        }
      },
      "DatabaseQueryColumn": {
        "type": "object",
        "required": [
          "name",
          "type"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Column name.",
            "example": "total_cents"
          },
          "type": {
            "type": "string",
            "description": "Type name reported by the engine (for example `int4` in PostgreSQL or `varchar` in MySQL). Empty string for Redis and for unknown types.",
            "example": "int4"
          }
        }
      },
      "DatabaseQueryResult": {
        "type": "object",
        "required": [
          "columns",
          "rows",
          "row_count",
          "truncated",
          "duration_ms"
        ],
        "properties": {
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DatabaseQueryColumn"
            },
            "description": "Result columns, in order."
          },
          "rows": {
            "type": "array",
            "description": "Result rows. Each row is an array of cells in column order. Every value is a string; `null` is SQL `NULL`.",
            "items": {
              "type": "array",
              "items": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "row_count": {
            "type": "integer",
            "description": "Number of rows in `rows`.",
            "example": 2
          },
          "truncated": {
            "type": "boolean",
            "description": "`true` when more rows exist than were returned, because of the row cap, the page size or the response size cap."
          },
          "command": {
            "type": "string",
            "description": "PostgreSQL's command tag (for example `SELECT 2` or `EXPLAIN`). For MySQL, `SELECT <n>`\nwhen the statement returned columns. For Redis `SCAN`-family commands,\n`next cursor <n>`. Omitted when the result was truncated and otherwise when there is\nnone.\n",
            "example": "SELECT 2"
          },
          "duration_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Time taken to run the statement and read the result, in milliseconds.",
            "example": 4
          }
        }
      },
      "DatabaseKey": {
        "type": "object",
        "required": [
          "key",
          "type",
          "ttl_ms"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Key name. Names that are not valid UTF-8 are shown with `\\x` escapes.",
            "example": "session:8f2c"
          },
          "raw_b64": {
            "type": "string",
            "description": "Exact key name as standard base64. Only present when the name is not valid UTF-8."
          },
          "type": {
            "type": "string",
            "description": "Redis type, such as `string`, `hash`, `list`, `set`, `zset` or `stream`.",
            "example": "hash"
          },
          "ttl_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Time to live in milliseconds. `-1` when the key has no expiry.",
            "example": 3542117
          }
        }
      },
      "DatabaseKeyspace": {
        "type": "object",
        "required": [
          "db",
          "keys"
        ],
        "properties": {
          "db": {
            "type": "integer",
            "description": "Logical database number.",
            "example": 0
          },
          "keys": {
            "type": "integer",
            "format": "int64",
            "description": "Number of keys in that database.",
            "example": 3
          }
        }
      },
      "DatabaseKeyList": {
        "type": "object",
        "required": [
          "keys",
          "cursor",
          "db",
          "keyspaces"
        ],
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DatabaseKey"
            },
            "description": "Keys found in this page, sorted by name."
          },
          "cursor": {
            "type": "string",
            "description": "Cursor to pass back to continue the scan. `\"0\"` when the scan is complete.",
            "example": "0"
          },
          "db": {
            "type": "integer",
            "description": "Logical database that was scanned.",
            "example": 0
          },
          "keyspaces": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/DatabaseKeyspace"
            },
            "description": "Key counts per logical database that has keys, from `INFO keyspace`. `null` when no database has keys or the counts could not be read."
          }
        }
      },
      "DatabaseKeyValue": {
        "type": "object",
        "required": [
          "key",
          "type",
          "ttl_ms",
          "length",
          "truncated",
          "next"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Key name. Names that are not valid UTF-8 are shown with `\\x` escapes.",
            "example": "session:8f2c"
          },
          "raw_b64": {
            "type": "string",
            "description": "Exact key name as standard base64. Only present when the name is not valid UTF-8."
          },
          "type": {
            "type": "string",
            "description": "Redis type, such as `string`, `hash`, `list`, `set`, `zset` or `stream`.",
            "example": "hash"
          },
          "ttl_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Time to live in milliseconds. `-1` when the key has no expiry.",
            "example": 3542117
          },
          "length": {
            "type": "integer",
            "format": "int64",
            "description": "String length in bytes, or the number of elements in a collection.",
            "example": 3
          },
          "value": {
            "type": "string",
            "description": "The string value (first 64 KiB). Only present for `string` keys."
          },
          "truncated": {
            "type": "boolean",
            "description": "`true` when a string value is longer than the 64 KiB returned."
          },
          "items": {
            "$ref": "#/components/schemas/DatabaseQueryResult",
            "description": "One page of a collection's elements. Only present for `hash`, `set`, `list`, `zset` and `stream` keys."
          },
          "next": {
            "type": "string",
            "description": "Value to pass as `next` for the following page. Empty string when there are no more pages.",
            "example": ""
          }
        }
      },
      "DatabaseSnapshot": {
        "type": "object",
        "required": [
          "uid",
          "database_uid",
          "source_database_name",
          "detached",
          "name",
          "slug",
          "status",
          "consumed_bytes",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Snapshot UID.",
            "example": "019a9d40-2b3c-7d4e-8f5a-6b7c8d9e0f1a"
          },
          "database_uid": {
            "type": "string",
            "description": "UID of the database the snapshot was taken from. Still set after that database is deleted.",
            "example": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b"
          },
          "source_database_name": {
            "type": "string",
            "description": "Name of the source database.",
            "example": "orders-db"
          },
          "source_engine": {
            "type": "string",
            "enum": [
              "postgres",
              "mysql",
              "redis"
            ],
            "description": "Engine of the source database. Omitted when unknown.",
            "example": "postgres"
          },
          "source_version": {
            "type": "string",
            "description": "Engine version of the source database. Omitted when unknown.",
            "example": "17"
          },
          "detached": {
            "type": "boolean",
            "description": "`true` when the source database has been deleted. Detached snapshots can still be used to create a database, and can be deleted with [Delete a database snapshot](/api/databases/delete-a-database-snapshot)."
          },
          "name": {
            "type": "string",
            "description": "Snapshot name.",
            "example": "before-migration"
          },
          "slug": {
            "type": "string",
            "description": "URL-safe version of the name.",
            "example": "before-migration"
          },
          "status": {
            "type": "string",
            "enum": [
              "creating",
              "available",
              "restoring",
              "deleting",
              "failed"
            ],
            "description": "Snapshot state. Only `available` snapshots can be restored or used to create a database.",
            "example": "available"
          },
          "consumed_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Storage used by the snapshot, in bytes. `0` until reported.",
            "example": 73400320
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the snapshot was requested."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the snapshot last changed."
          }
        }
      },
      "DatabaseSnapshotOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "database_uid",
          "name",
          "action",
          "status",
          "events_url",
          "is_replay",
          "is_completed"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued operation. Poll it with [Get an operation](/api/operations/get-an-operation).",
            "example": "019a9d40-2b3e-7f50-9a61-7c8d9e0f1a2b"
          },
          "database_uid": {
            "type": "string",
            "description": "UID of the database (for deletes, the snapshot's source database).",
            "example": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b"
          },
          "snapshot_uid": {
            "type": "string",
            "description": "UID of the snapshot the operation acts on. Omitted when it is not known.",
            "example": "019a9d3f-1a2b-7c3d-8e4f-5a6b7c8d9e0f"
          },
          "name": {
            "type": "string",
            "description": "The **database's** name for create and restore. The snapshot's name for deletes, except on a replayed delete made through [Delete a snapshot of a database](/api/databases/delete-a-snapshot-of-a-database), which returns the database's name.",
            "example": "orders-db"
          },
          "action": {
            "type": "string",
            "enum": [
              "database_snapshot.create",
              "database_snapshot.restore",
              "database_snapshot.delete"
            ],
            "description": "The queued action.",
            "example": "database_snapshot.create"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the operation. `queued` for a new request; the original operation's status on a replay.",
            "example": "queued"
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress.",
            "example": "/v1/operations/019a9d40-2b3e-7f50-9a61-7c8d9e0f1a2b/events"
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an existing operation was returned for a reused `X-Idempotency` key."
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished."
          }
        }
      },
      "Volume": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "status",
          "zone_slug",
          "size_gib",
          "filesystem",
          "formatted",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the volume."
          },
          "name": {
            "type": "string",
            "description": "Display name of the volume.",
            "example": "data-1"
          },
          "slug": {
            "type": "string",
            "description": "URL-friendly form of the name. Not necessarily unique.",
            "example": "data-1"
          },
          "description": {
            "type": "string",
            "description": "Free-text description. Omitted when empty."
          },
          "status": {
            "type": "string",
            "enum": [
              "creating",
              "available",
              "attaching",
              "in-use",
              "detaching",
              "deleting",
              "deleted",
              "failed"
            ],
            "description": "Lifecycle state. `available` volumes can be attached, `in-use` volumes are attached to\nthe VM in `vm_uid`. `failed` means creating or deleting the volume failed. See\n`last_failure`. `deleted` only appears in an idempotent replay of a delete.\n",
            "example": "in-use"
          },
          "zone_slug": {
            "type": "string",
            "description": "Zone the volume lives in.",
            "example": "olas-closet"
          },
          "size_gib": {
            "type": "integer",
            "description": "Size of the volume in GiB.",
            "example": 50
          },
          "filesystem": {
            "type": "string",
            "enum": [
              "ext4",
              "xfs"
            ],
            "description": "Filesystem the volume is formatted with.",
            "example": "ext4"
          },
          "formatted": {
            "type": "boolean",
            "description": "`true` once the volume has been formatted, which happens on its first successful attach."
          },
          "vm_uid": {
            "type": "string",
            "description": "UID of the VM the volume is attached to or being attached to. Omitted when detached.",
            "example": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90"
          },
          "vm_name": {
            "type": "string",
            "description": "Name of that VM. Omitted when detached or when the VM cannot be found.",
            "example": "web-1"
          },
          "device_name": {
            "type": "string",
            "description": "Block device inside the VM, as reported by the guest agent. Omitted until reported.",
            "example": "/dev/vdb"
          },
          "mount_path": {
            "type": "string",
            "description": "Where the volume is mounted inside the VM, under `/mnt/rumpty/`, as reported by the guest agent. Omitted until reported.",
            "example": "/mnt/rumpty/019a9c401a2b"
          },
          "usage": {
            "$ref": "#/components/schemas/VolumeUsage"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the volume was created (RFC 3339)."
          },
          "attached_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the volume was last attached. Omitted if it has never been attached. Kept after the volume is detached."
          },
          "detached_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the volume was last detached. Omitted if it has never been detached or was attached again since."
          },
          "last_failure": {
            "type": "string",
            "description": "Reason for the last failed operation on the volume. Omitted when there is none."
          }
        }
      },
      "VolumeUsage": {
        "type": "object",
        "description": "Filesystem usage reported by the VM's guest agent. Omitted until the agent has reported a sample for the mounted volume. The last sample is kept after the volume is detached.",
        "required": [
          "total_bytes",
          "used_bytes",
          "available_bytes",
          "used_percent",
          "sampled_at",
          "stale"
        ],
        "properties": {
          "total_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Filesystem size in bytes.",
            "example": 52710469632
          },
          "used_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes in use.",
            "example": 5368709120
          },
          "available_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes still available.",
            "example": 44655652864
          },
          "used_percent": {
            "type": "number",
            "description": "Percentage of the filesystem in use.",
            "example": 10.7
          },
          "sampled_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the sample was taken."
          },
          "stale": {
            "type": "boolean",
            "description": "`true` when the sample is older than the agent's normal reporting interval."
          }
        }
      },
      "VolumeSummary": {
        "type": "object",
        "required": [
          "total_volumes",
          "total_storage_bytes",
          "used_storage_bytes",
          "available_storage_bytes",
          "total_used_percent"
        ],
        "properties": {
          "total_volumes": {
            "type": "integer",
            "description": "Number of volumes, excluding those being deleted.",
            "example": 2
          },
          "total_storage_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Combined provisioned size of those volumes, in bytes (`size_gib` × 1024³).",
            "example": 161061273600
          },
          "used_storage_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Combined used bytes from each volume's last usage report.",
            "example": 5368709120
          },
          "available_storage_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "`total_storage_bytes` minus `used_storage_bytes`, or `0` if used exceeds total.",
            "example": 155692564480
          },
          "total_used_percent": {
            "type": "number",
            "description": "`used_storage_bytes` as a percentage of `total_storage_bytes`. `0` when there are no volumes.",
            "example": 3.3333333333333335
          }
        }
      },
      "VolumeOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "volume",
          "status",
          "events_url",
          "is_replay"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "UID of the queued (or replayed) operation. Pass it to [Get an operation](/api/operations/get-an-operation)."
          },
          "volume": {
            "$ref": "#/components/schemas/Volume"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the operation. `queued` for a new request. On a replay, the original operation's current status.",
            "example": "queued"
          },
          "events_url": {
            "type": "string",
            "description": "Path of the server-sent events stream with the operation's progress.",
            "example": "/v1/operations/019a9c40-1a2c-7d4e-9f5a-6b7c8d9e0f1a/events"
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an existing operation was returned for a reused `X-Idempotency` key."
          },
          "is_completed": {
            "type": "boolean",
            "description": "Present and `true` on a replay whose original operation has already finished."
          }
        }
      },
      "Bucket": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "status",
          "visibility",
          "public_base_url",
          "s3_bucket_name",
          "created_at",
          "cors_origins"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the bucket.",
            "example": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b"
          },
          "name": {
            "type": "string",
            "description": "Display name of the bucket.",
            "example": "Marketing assets"
          },
          "slug": {
            "type": "string",
            "description": "URL-safe version of the name. Unique within the workspace.",
            "example": "marketing-assets"
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "ready",
              "failed",
              "deleting",
              "deleted"
            ],
            "description": "Lifecycle state. Uploads, access keys and CORS changes need `ready`.",
            "example": "ready"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "description": "`public` objects are served from their public URL. `private` objects need a signed read URL.",
            "example": "public"
          },
          "public_base_url": {
            "type": "string",
            "description": "Base URL recorded for the bucket on the public assets host. Use each object's `public_url` or `read_url` to fetch objects, rather than building URLs from this value.",
            "example": "https://assets.rumptycloud.com/projects/019a1111-2222-7333-8444-555566667777/marketing-assets"
          },
          "s3_bucket_name": {
            "type": "string",
            "description": "Name of the underlying S3 bucket. Use it as the bucket name with S3 clients.",
            "example": "assets-acme-6c7d8e"
          },
          "key_prefix": {
            "type": "string",
            "description": "Key prefix under which uploads made through the API are stored. Omitted when it cannot be derived.",
            "example": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets"
          },
          "storage_used_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Total size of the bucket's `ready` objects, in bytes. Omitted when zero.",
            "example": 52428800
          },
          "free_storage_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Your account's free file storage allowance in bytes. Omitted on some responses (for example after updating allowed origins or deleting).",
            "example": 10737418240
          },
          "max_image_size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Maximum size of a single upload, in bytes. Despite the name it applies to every file type. Omitted on some responses.",
            "example": 1073741824
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the bucket was created.",
            "example": "2026-11-18T10:24:00Z"
          },
          "last_failure": {
            "type": "string",
            "description": "Why the last create or delete failed. Omitted when there was no failure.",
            "example": "bucket provisioning timed out"
          },
          "cors_origins": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Browser origins allowed to make cross-origin requests. The console's own origin is always allowed and is not listed. Set with [Set bucket allowed origins](/api/buckets/set-bucket-allowed-origins).",
            "example": [
              "https://www.acme.com"
            ]
          }
        }
      },
      "BucketOperationResult": {
        "type": "object",
        "required": [
          "operation_id",
          "bucket",
          "status",
          "events_url",
          "is_replay"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "ID of the queued operation. Pass it to [Get an operation](/api/operations/get-an-operation).",
            "example": "019a9b3c-1d30-7a11-9b22-3c4d5e6f7a8b"
          },
          "bucket": {
            "$ref": "#/components/schemas/Bucket"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ],
            "description": "Status of the operation. `queued` for a new request; the original operation's current status on a replay.",
            "example": "queued"
          },
          "events_url": {
            "type": "string",
            "description": "Path of the operation's progress event stream.",
            "example": "/v1/operations/019a9b3c-1d30-7a11-9b22-3c4d5e6f7a8b/events"
          },
          "is_replay": {
            "type": "boolean",
            "description": "`true` when an `X-Idempotency` key was reused and the original operation is returned instead of a new one.",
            "example": false
          },
          "is_completed": {
            "type": "boolean",
            "description": "`true` when a replayed operation has already finished. Omitted unless `true`."
          }
        }
      },
      "BucketObject": {
        "type": "object",
        "required": [
          "uid",
          "bucket_uid",
          "key",
          "filename",
          "content_type",
          "size_bytes",
          "status",
          "public_url",
          "read_url_is_signed",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the object.",
            "example": "019a9c01-aa22-7b33-9c44-d5e6f7a8b9c0"
          },
          "bucket_uid": {
            "type": "string",
            "description": "UID of the bucket the object belongs to.",
            "example": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b"
          },
          "key": {
            "type": "string",
            "description": "Full object key inside the S3 bucket.",
            "example": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf"
          },
          "filename": {
            "type": "string",
            "description": "Original file name sent when the upload was created, or the last part of the key for objects written directly over S3.",
            "example": "report.pdf"
          },
          "content_type": {
            "type": "string",
            "description": "MIME type of the object.",
            "example": "application/pdf"
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Size of the object in bytes. Until the upload is completed this is the `size_bytes` sent when the upload was created; completing it replaces it with the size stored in the bucket.",
            "example": 248331
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_upload",
              "ready",
              "failed",
              "deleted"
            ],
            "description": "`pending_upload` until the upload is completed, then `ready`.",
            "example": "ready"
          },
          "public_url": {
            "type": "string",
            "description": "Permanent URL of the object on the public assets host. Only readable without a signature in `public` buckets.",
            "example": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf"
          },
          "read_url": {
            "type": "string",
            "description": "URL to read the object. A presigned URL in `private` buckets, otherwise the public URL.",
            "example": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf"
          },
          "read_url_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When `read_url` stops working. Only present when it is signed.",
            "example": "2026-11-18T10:40:00Z"
          },
          "read_url_is_signed": {
            "type": "boolean",
            "description": "`true` when `read_url` is a presigned, expiring URL.",
            "example": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the object record was created.",
            "example": "2026-11-18T10:30:00Z"
          },
          "last_failure": {
            "type": "string",
            "description": "Why the object failed, if it did. Omitted otherwise.",
            "example": "upload failed"
          }
        }
      },
      "BucketUpload": {
        "type": "object",
        "required": [
          "object_id",
          "key",
          "upload_url",
          "public_url",
          "read_url_is_signed",
          "method",
          "headers",
          "expires_at"
        ],
        "properties": {
          "object_id": {
            "type": "string",
            "description": "UID of the reserved object. Pass it to [Complete an upload](/api/buckets/complete-an-upload) after the `PUT` succeeds.",
            "example": "019a9c01-aa22-7b33-9c44-d5e6f7a8b9c0"
          },
          "key": {
            "type": "string",
            "description": "Generated object key inside the S3 bucket.",
            "example": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf"
          },
          "upload_url": {
            "type": "string",
            "description": "Presigned URL to `PUT` the file's bytes to. Valid until `expires_at`.",
            "example": "https://uploads.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Signature=..."
          },
          "public_url": {
            "type": "string",
            "description": "Permanent URL the object will have on the public assets host.",
            "example": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf"
          },
          "read_url": {
            "type": "string",
            "description": "URL to read the object once uploaded. Presigned in `private` buckets, otherwise the public URL. Omitted if it could not be created.",
            "example": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf"
          },
          "read_url_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When `read_url` stops working. Only present when it is signed.",
            "example": "2026-11-18T10:40:00Z"
          },
          "read_url_is_signed": {
            "type": "boolean",
            "description": "`true` when `read_url` is a presigned, expiring URL.",
            "example": false
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ],
            "description": "HTTP method to use with `upload_url`. Always `PUT`.",
            "example": "PUT"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Headers you must send with the `PUT`, exactly as given. Always includes `Content-Type`. Public buckets also require `x-amz-acl` and `Cache-Control`.",
            "example": {
              "Content-Type": "application/pdf",
              "x-amz-acl": "public-read",
              "Cache-Control": "public, max-age=31536000, immutable"
            }
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When `upload_url` expires (10 minutes after creation by default).",
            "example": "2026-11-18T10:40:00Z"
          }
        }
      },
      "BucketReadUrl": {
        "type": "object",
        "required": [
          "read_url",
          "is_signed"
        ],
        "properties": {
          "read_url": {
            "type": "string",
            "description": "URL to download the object.",
            "example": "https://assets.rumptycloud.com/assets-acme-7a1b2c/projects/019a1111-2222-7333-8444-555566667777/contracts/signed-msa-e1f2a3.pdf?X-Amz-Signature=..."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the URL stops working. Omitted for public URLs, which do not expire.",
            "example": "2026-11-18T11:10:00Z"
          },
          "is_signed": {
            "type": "boolean",
            "description": "`true` for a presigned URL from a private bucket, `false` for a public URL.",
            "example": true
          }
        }
      },
      "BucketUsage": {
        "type": "object",
        "required": [
          "used_bytes",
          "free_bytes",
          "billable_bytes",
          "max_upload_bytes",
          "usage_percentage"
        ],
        "properties": {
          "used_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Total size of the workspace's `ready` bucket objects, in bytes.",
            "example": 52428800
          },
          "free_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Your account's free file storage allowance, in bytes.",
            "example": 10737418240
          },
          "billable_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes above the free allowance (`used_bytes` minus `free_bytes`, never below zero).",
            "example": 0
          },
          "max_upload_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Maximum size of a single upload, in bytes.",
            "example": 1073741824
          },
          "usage_percentage": {
            "type": "integer",
            "description": "`used_bytes` as a whole-number percentage of `free_bytes`, rounded down. Can exceed 100.",
            "example": 0
          }
        }
      },
      "BucketStorageUsagePart": {
        "type": "object",
        "required": [
          "used_bytes",
          "free_bytes",
          "billable_bytes",
          "usage_percentage"
        ],
        "properties": {
          "used_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes used in this storage type.",
            "example": 2147483648
          },
          "free_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Free allowance for this storage type, in bytes.",
            "example": 10737418240
          },
          "billable_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes above the free allowance for this storage type.",
            "example": 0
          },
          "usage_percentage": {
            "type": "integer",
            "description": "`used_bytes` as a whole-number percentage of `free_bytes`, rounded down.",
            "example": 20
          }
        }
      },
      "BucketStorageUsage": {
        "type": "object",
        "required": [
          "used_bytes",
          "free_bytes",
          "billable_bytes",
          "max_upload_bytes",
          "usage_percentage",
          "file_storage",
          "build_artifacts"
        ],
        "properties": {
          "used_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Total bytes used by file storage and build artifacts together.",
            "example": 2684354560
          },
          "free_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Combined free allowance of file storage and build artifacts, in bytes.",
            "example": 11811160064
          },
          "billable_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Total bytes above the combined free allowance.",
            "example": 0
          },
          "max_upload_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Maximum size of a single bucket upload, in bytes.",
            "example": 1073741824
          },
          "usage_percentage": {
            "type": "integer",
            "description": "`used_bytes` as a whole-number percentage of `free_bytes`, rounded down.",
            "example": 22
          },
          "file_storage": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BucketStorageUsagePart"
              }
            ],
            "description": "Bucket objects (`ready` only) across all your workspaces. Free allowance is 10 GiB by default."
          },
          "build_artifacts": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BucketStorageUsagePart"
              }
            ],
            "description": "Deployment build artifacts. Free allowance is 1 GiB by default."
          }
        }
      },
      "BucketStoragePricingTier": {
        "type": "object",
        "required": [
          "price_per_gib_month_micros",
          "price_per_gib_month_usd",
          "free_gib"
        ],
        "properties": {
          "price_per_gib_month_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Price per GiB per month in millionths of a US dollar.",
            "example": 20000
          },
          "price_per_gib_month_usd": {
            "type": "number",
            "description": "Price per GiB per month in US dollars.",
            "example": 0.02
          },
          "free_gib": {
            "type": "number",
            "description": "Free allowance in GiB before charges apply. `0` means there is no free allowance.",
            "example": 10
          }
        }
      },
      "BucketStoragePricing": {
        "type": "object",
        "required": [
          "currency",
          "volume",
          "snapshot",
          "object_storage",
          "artifact_storage"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "Currency of the prices. Always `USD`.",
            "example": "USD"
          },
          "volume": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BucketStoragePricingTier"
              }
            ],
            "description": "Block storage volumes."
          },
          "snapshot": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BucketStoragePricingTier"
              }
            ],
            "description": "VM and volume snapshots."
          },
          "object_storage": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BucketStoragePricingTier"
              }
            ],
            "description": "Bucket objects."
          },
          "artifact_storage": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BucketStoragePricingTier"
              }
            ],
            "description": "Deployment build artifacts."
          }
        }
      },
      "BucketAccessKey": {
        "type": "object",
        "required": [
          "uid",
          "bucket_uid",
          "name",
          "access_key_id",
          "permissions",
          "status",
          "endpoint",
          "region",
          "bucket",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the access key. Use it to revoke the key.",
            "example": "019a9d10-5e6f-7a80-9b1c-2d3e4f5a6b7c"
          },
          "bucket_uid": {
            "type": "string",
            "description": "UID of the bucket the key is scoped to.",
            "example": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b"
          },
          "name": {
            "type": "string",
            "description": "Label you gave the key.",
            "example": "CI uploader"
          },
          "access_key_id": {
            "type": "string",
            "description": "S3 access key ID. Starts with `RPTY`.",
            "example": "RPTY3F9A1C2E7B4D8E0F6A5C"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "write",
                "list",
                "delete"
              ]
            },
            "description": "What the key may do in the bucket.",
            "example": [
              "read",
              "write",
              "list"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "active",
              "revoked",
              "failed"
            ],
            "description": "`provisioning` until the grant is applied on storage, then `active`.",
            "example": "active"
          },
          "endpoint": {
            "type": "string",
            "description": "S3 endpoint to point your client at.",
            "example": "https://s3.rumptycloud.com"
          },
          "region": {
            "type": "string",
            "description": "S3 region to configure in your client.",
            "example": "olas-closet"
          },
          "bucket": {
            "type": "string",
            "description": "S3 bucket name to use with the key (same as the bucket's `s3_bucket_name`).",
            "example": "assets-acme-6c7d8e"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the key was created.",
            "example": "2026-11-18T11:05:00Z"
          },
          "revoked_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the key was revoked. Omitted for keys that are not revoked.",
            "example": "2026-11-20T09:00:00Z"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the key was last used. Omitted if it has never been used.",
            "example": "2026-11-18T12:41:09Z"
          }
        }
      },
      "BucketAccessKeyCreateResult": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BucketAccessKey"
          },
          {
            "type": "object",
            "required": [
              "secret_access_key",
              "operation_id",
              "operation_status",
              "events_url"
            ],
            "properties": {
              "secret_access_key": {
                "type": "string",
                "description": "The S3 secret access key. Shown only once.",
                "example": "q8Zr3mT1vX9bN2kL5pW7yH4cF6dJ0sA1gE3uR8iO"
              },
              "operation_id": {
                "type": "string",
                "description": "ID of the operation that provisions the key. Pass it to [Get an operation](/api/operations/get-an-operation).",
                "example": "019a9d10-5e70-7b91-8c2d-3e4f5a6b7c8d"
              },
              "operation_status": {
                "type": "string",
                "description": "Status of the operation when it was queued. Always `queued`.",
                "example": "queued"
              },
              "events_url": {
                "type": "string",
                "description": "Path of the operation's progress event stream.",
                "example": "/v1/operations/019a9d10-5e70-7b91-8c2d-3e4f5a6b7c8d/events"
              }
            }
          }
        ]
      },
      "FirewallPolicy": {
        "type": "object",
        "required": [
          "uid",
          "name",
          "slug",
          "is_default",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the policy."
          },
          "name": {
            "type": "string",
            "description": "Name of the policy, unique in the workspace.",
            "example": "Web servers"
          },
          "slug": {
            "type": "string",
            "description": "URL-friendly form of the name.",
            "example": "web-servers"
          },
          "description": {
            "type": "string",
            "description": "Free-text description. Omitted when empty."
          },
          "is_default": {
            "type": "boolean",
            "description": "Whether the policy is labelled as a workspace default. It is not applied automatically."
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FirewallRule"
            },
            "description": "The policy's rules, oldest first. Omitted when the policy has no rules."
          },
          "attached_resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FirewallPolicyAttachment"
            },
            "description": "Resources the policy is attached to, newest first. Omitted when there are none."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the policy was created (RFC 3339)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the policy itself was last changed. Rule changes do not update it."
          }
        }
      },
      "FirewallRule": {
        "type": "object",
        "required": [
          "operation_id",
          "uid",
          "direction",
          "action",
          "protocol",
          "port_start",
          "port_end",
          "cidr",
          "is_default"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "On [Add a firewall rule](/api/firewall-policies/add-a-firewall-rule) and\n[Update a firewall rule](/api/firewall-policies/update-a-firewall-rule), the UID of the\nfirst `firewall.apply` operation queued for the change. An empty string when no\noperation was queued, and always empty when rules are returned inside a policy.\n"
          },
          "uid": {
            "type": "string",
            "description": "Unique identifier of the rule."
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ],
            "description": "Traffic direction the rule applies to.",
            "example": "inbound"
          },
          "action": {
            "type": "string",
            "enum": [
              "allow"
            ],
            "description": "What happens to matching traffic. Always `allow`.",
            "example": "allow"
          },
          "protocol": {
            "type": "string",
            "enum": [
              "tcp",
              "udp",
              "all"
            ],
            "description": "IP protocol the rule matches.",
            "example": "tcp"
          },
          "port_start": {
            "type": "integer",
            "description": "First port of the range. `0` with `port_end` `0` means all ports.",
            "example": 443
          },
          "port_end": {
            "type": "integer",
            "description": "Last port of the range.",
            "example": 443
          },
          "cidr": {
            "type": "string",
            "description": "Source address range in CIDR notation.",
            "example": "0.0.0.0/0"
          },
          "description": {
            "type": "string",
            "description": "Note about the rule. Omitted when empty.",
            "example": "HTTPS"
          },
          "is_default": {
            "type": "boolean",
            "description": "`true` for the SSH and app-port rules added automatically when the policy was created."
          }
        }
      },
      "FirewallPolicyAttachment": {
        "type": "object",
        "required": [
          "operation_id",
          "uid",
          "resource_type",
          "resource"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "description": "On [Attach a firewall policy](/api/firewall-policies/attach-a-firewall-policy), the UID\nof the `firewall.apply` operation queued for the resource. An empty string when the\npolicy was already attached or no operation could be queued, and always empty when\nattachments are returned inside a policy.\n"
          },
          "uid": {
            "type": "string",
            "description": "Unique identifier of the attachment. Use it to [detach the policy](/api/firewall-policies/detach-a-firewall-policy)."
          },
          "resource_type": {
            "type": "string",
            "enum": [
              "vm",
              "database",
              "deployment"
            ],
            "description": "Kind of resource the policy is attached to.",
            "example": "vm"
          },
          "resource": {
            "$ref": "#/components/schemas/FirewallResourceSummary"
          }
        }
      },
      "FirewallResourceSummary": {
        "type": "object",
        "description": "Short description of the attached resource. All fields are empty strings if the resource no longer exists.",
        "required": [
          "uid",
          "name",
          "slug",
          "status"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "UID of the VM, database or deployment.",
            "example": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90"
          },
          "name": {
            "type": "string",
            "description": "Name of the resource.",
            "example": "web-1"
          },
          "slug": {
            "type": "string",
            "description": "Slug of the resource.",
            "example": "web-1"
          },
          "status": {
            "type": "string",
            "description": "Current status of the resource. For VMs and databases this is the display status.",
            "example": "running"
          }
        }
      },
      "WalletSummary": {
        "type": "object",
        "required": [
          "balance_cents",
          "currency",
          "display_currency",
          "exchange_rate",
          "display_balance_minor"
        ],
        "properties": {
          "balance_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Current balance in US cents. `0` if you have never had a wallet movement."
          },
          "currency": {
            "type": "string",
            "description": "Currency the balance is held in. Always `USD`."
          },
          "display_currency": {
            "type": "string",
            "enum": [
              "USD",
              "NGN"
            ],
            "description": "Currency to show amounts in. `NGN` when your billing country is Nigeria, otherwise `USD`."
          },
          "exchange_rate": {
            "type": "number",
            "description": "Multiply US cents by this to get `display_currency` minor units. `1` for USD."
          },
          "display_balance_minor": {
            "type": "integer",
            "format": "int64",
            "description": "The balance converted to `display_currency` minor units (cents or kobo), rounded. For display only."
          }
        }
      },
      "WalletEntry": {
        "type": "object",
        "required": [
          "uid",
          "type",
          "amount_cents",
          "balance_before_cents",
          "balance_after_cents",
          "currency",
          "reason",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the entry."
          },
          "type": {
            "type": "string",
            "enum": [
              "credit",
              "debit"
            ],
            "description": "Whether money was added to or taken from the balance."
          },
          "amount_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Amount in US cents. Positive for credits, negative for debits."
          },
          "balance_before_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Balance before this entry, in US cents."
          },
          "balance_after_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Balance after this entry, in US cents."
          },
          "currency": {
            "type": "string",
            "description": "Currency of the amounts. `USD`."
          },
          "reason": {
            "type": "string",
            "description": "What the entry was for, e.g. a top-up or the invoice a usage charge settles."
          },
          "provider": {
            "type": "string",
            "description": "Payment provider behind the entry, e.g. `paystack`. Omitted for entries not tied to a payment."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the entry was recorded."
          }
        }
      },
      "WalletPaymentTransaction": {
        "type": "object",
        "required": [
          "uid",
          "reference",
          "provider",
          "purpose",
          "status",
          "charge_currency",
          "charge_minor",
          "usd_cents",
          "exchange_rate",
          "fee_minor",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the transaction."
          },
          "reference": {
            "type": "string",
            "description": "Payment reference shared with the payment provider. Quote it when contacting support about a payment."
          },
          "provider": {
            "type": "string",
            "description": "Payment provider, e.g. `paystack`."
          },
          "purpose": {
            "type": "string",
            "enum": [
              "wallet_topup",
              "add_card",
              "usage_settlement"
            ],
            "description": "What the payment was for. `add_card` is the small verification charge made when saving a card, credited back to your wallet. `usage_settlement` is an automatic charge to pay an invoice."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "success",
              "failed",
              "abandoned",
              "refunded",
              "disputed"
            ],
            "description": "Outcome of the payment."
          },
          "charge_currency": {
            "type": "string",
            "description": "Currency charged at the provider, e.g. `USD` or `NGN`."
          },
          "charge_minor": {
            "type": "integer",
            "format": "int64",
            "description": "Amount charged, in `charge_currency` minor units."
          },
          "usd_cents": {
            "type": "integer",
            "format": "int64",
            "description": "The amount's value in US cents."
          },
          "exchange_rate": {
            "type": "number",
            "description": "Rate used to convert US cents to `charge_currency` minor units."
          },
          "fee_minor": {
            "type": "integer",
            "format": "int64",
            "description": "Provider fee in `charge_currency` minor units. RumptyCloud pays it. `0` until the payment is verified."
          },
          "channel": {
            "type": "string",
            "description": "Payment channel, e.g. `card` or `bank`. Omitted until known."
          },
          "card_last4": {
            "type": "string",
            "description": "Last four digits of the card used. Omitted when not a card payment or not yet known."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the payment was started."
          },
          "paid_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the payment succeeded. Omitted otherwise."
          }
        }
      },
      "WalletCard": {
        "type": "object",
        "required": [
          "uid",
          "provider",
          "last4",
          "card_type",
          "bank",
          "exp_month",
          "exp_year",
          "is_default",
          "created_at"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the saved card."
          },
          "provider": {
            "type": "string",
            "description": "Payment provider holding the card, e.g. `paystack`."
          },
          "last4": {
            "type": "string",
            "description": "Last four digits of the card number."
          },
          "card_type": {
            "type": "string",
            "description": "Card brand, e.g. `visa`, `mastercard` or `verve`."
          },
          "bank": {
            "type": "string",
            "description": "Issuing bank."
          },
          "exp_month": {
            "type": "string",
            "description": "Expiry month, as reported by the provider."
          },
          "exp_year": {
            "type": "string",
            "description": "Expiry year, as reported by the provider."
          },
          "is_default": {
            "type": "boolean",
            "description": "Whether this card is charged by default."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the card was saved."
          }
        }
      },
      "BillingSummary": {
        "type": "object",
        "required": [
          "currency",
          "display_currency",
          "exchange_rate",
          "current_cycle",
          "total_amount_micros",
          "total_amount_cents",
          "current_hourly_amount_micros",
          "current_monthly_amount_cents",
          "current_resource_count",
          "usage_quantity",
          "usage_record_count",
          "resource_count",
          "breakdown",
          "free_allowances",
          "current_resources"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "Base currency of all amounts. `USD`."
          },
          "display_currency": {
            "type": "string",
            "enum": [
              "USD",
              "NGN"
            ],
            "description": "Currency to show amounts in. `NGN` when your billing country is Nigeria, otherwise `USD`."
          },
          "exchange_rate": {
            "type": "number",
            "description": "Multiply US cents by this to get `display_currency` minor units. `1` for USD."
          },
          "current_cycle": {
            "type": "object",
            "description": "The billing cycle the summary covers.",
            "required": [
              "mode",
              "starts_at",
              "ends_at"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "calendar_month",
                  "rolling_interval",
                  "manual"
                ],
                "description": "How billing cycles are defined. Normally `calendar_month`."
              },
              "starts_at": {
                "type": "string",
                "format": "date-time",
                "description": "Start of the cycle."
              },
              "ends_at": {
                "type": "string",
                "format": "date-time",
                "description": "End of the cycle."
              }
            }
          },
          "total_amount_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Charges so far this cycle, in micros."
          },
          "total_amount_cents": {
            "type": "integer",
            "format": "int64",
            "description": "`total_amount_micros` rounded up to whole cents."
          },
          "current_hourly_amount_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Combined hourly rate of everything billable right now, in micros."
          },
          "current_monthly_amount_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Combined monthly rate of everything billable right now, in cents."
          },
          "current_resource_count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of resources billable right now."
          },
          "usage_quantity": {
            "type": "number",
            "description": "Sum of `quantity` across all `breakdown` groups. Mixes units, so mainly useful as a non-zero check."
          },
          "usage_record_count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of usage records this cycle."
          },
          "resource_count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of distinct resources with usage this cycle."
          },
          "breakdown": {
            "type": "array",
            "description": "This cycle's charges grouped by resource type, metric and unit.",
            "items": {
              "$ref": "#/components/schemas/BillingUsageGroup"
            }
          },
          "free_allowances": {
            "type": "array",
            "description": "Usage of each free tier.",
            "items": {
              "$ref": "#/components/schemas/BillingFreeAllowance"
            }
          },
          "current_resources": {
            "type": "array",
            "description": "Resources billable right now, grouped by resource type and plan.",
            "items": {
              "$ref": "#/components/schemas/BillingCurrentResourceGroup"
            }
          }
        }
      },
      "BillingUsageGroup": {
        "type": "object",
        "required": [
          "resource_type",
          "metric",
          "unit",
          "currency",
          "quantity",
          "amount_micros",
          "amount_cents",
          "usage_record_count",
          "resource_count"
        ],
        "properties": {
          "resource_type": {
            "type": "string",
            "description": "Type of resource, e.g. `vm`, `database`, `deployment`, `k8s_node`, `volume`, `snapshot`, `object_storage` or `inference`."
          },
          "metric": {
            "type": "string",
            "description": "What was measured, e.g. `runtime`, `storage` or `tokens`."
          },
          "unit": {
            "type": "string",
            "description": "Unit of `quantity`, e.g. `hour`, `gb_month` or `token`."
          },
          "currency": {
            "type": "string",
            "description": "Currency of the amounts. `USD`."
          },
          "quantity": {
            "type": "number",
            "description": "Total quantity used this cycle, in `unit`."
          },
          "amount_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Charge for this group, in micros."
          },
          "amount_cents": {
            "type": "integer",
            "format": "int64",
            "description": "`amount_micros` rounded up to whole cents."
          },
          "usage_record_count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of usage records in this group."
          },
          "resource_count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of distinct resources in this group."
          },
          "resources": {
            "type": "array",
            "description": "Each resource's share of the group, including resources removed earlier in the cycle. Omitted when empty.",
            "items": {
              "type": "object",
              "required": [
                "resource_uid",
                "resource_name",
                "plan_slug",
                "quantity",
                "amount_micros",
                "still_active",
                "last_period_end"
              ],
              "properties": {
                "resource_uid": {
                  "type": "string",
                  "description": "UID of the resource."
                },
                "resource_name": {
                  "type": "string",
                  "description": "Name of the resource."
                },
                "plan_slug": {
                  "type": "string",
                  "description": "Plan the resource was billed on."
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity this resource used, in the group's `unit`."
                },
                "amount_micros": {
                  "type": "integer",
                  "format": "int64",
                  "description": "This resource's charge, in micros."
                },
                "still_active": {
                  "type": "boolean",
                  "description": "`false` when the resource was deleted or stopped billing earlier in the cycle."
                },
                "last_period_end": {
                  "type": "string",
                  "format": "date-time",
                  "description": "End of the latest period charged for this resource."
                }
              }
            }
          }
        }
      },
      "BillingFreeAllowance": {
        "type": "object",
        "required": [
          "resource_type",
          "plan_slug",
          "plan_name",
          "included",
          "used",
          "remaining"
        ],
        "properties": {
          "resource_type": {
            "type": "string",
            "description": "Resource type the allowance applies to, e.g. `deployment` or `inference`."
          },
          "plan_slug": {
            "type": "string",
            "description": "Plan the allowance applies to. `inference-tokens` for the AI token allowance."
          },
          "plan_name": {
            "type": "string",
            "description": "Display name of the plan or allowance."
          },
          "included": {
            "type": "integer",
            "description": "How much is free. A count of resources, or tokens per cycle for inference."
          },
          "used": {
            "type": "integer",
            "description": "How much of the allowance is used."
          },
          "remaining": {
            "type": "integer",
            "description": "What is left. Never below `0`."
          }
        }
      },
      "BillingCurrentResourceGroup": {
        "type": "object",
        "required": [
          "resource_type",
          "plan_slug",
          "plan_name",
          "currency",
          "resource_count",
          "hourly_amount_micros",
          "monthly_amount_cents",
          "cycle_runtime_hours",
          "resources"
        ],
        "properties": {
          "resource_type": {
            "type": "string",
            "description": "Type of resource."
          },
          "plan_slug": {
            "type": "string",
            "description": "Plan slug."
          },
          "plan_name": {
            "type": "string",
            "description": "Plan display name."
          },
          "currency": {
            "type": "string",
            "description": "Currency of the amounts. `USD`."
          },
          "resource_count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of billable resources on this plan."
          },
          "hourly_amount_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Combined hourly rate of these resources, in micros."
          },
          "monthly_amount_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Combined monthly rate of these resources, in cents."
          },
          "cycle_runtime_hours": {
            "type": "number",
            "description": "Combined hours these resources have run this cycle."
          },
          "resources": {
            "type": [
              "array",
              "null"
            ],
            "description": "The individual resources in this group.",
            "items": {
              "type": "object",
              "required": [
                "resource_uid",
                "resource_name",
                "status",
                "billing_started_at",
                "hourly_amount_micros",
                "monthly_amount_cents",
                "free_allowance",
                "cycle_runtime_hours",
                "cycle_amount_micros"
              ],
              "properties": {
                "resource_uid": {
                  "type": "string",
                  "description": "UID of the resource."
                },
                "resource_name": {
                  "type": "string",
                  "description": "Name of the resource."
                },
                "status": {
                  "type": "string",
                  "description": "The resource's last observed status, e.g. `running`."
                },
                "billing_started_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "When billing for the resource started."
                },
                "hourly_amount_micros": {
                  "type": "integer",
                  "format": "int64",
                  "description": "The resource's hourly rate, in micros."
                },
                "monthly_amount_cents": {
                  "type": "integer",
                  "format": "int64",
                  "description": "The resource's monthly rate, in cents."
                },
                "free_allowance": {
                  "type": "boolean",
                  "description": "`true` when the resource is free under its plan's free tier."
                },
                "cycle_runtime_hours": {
                  "type": "number",
                  "description": "Hours the resource has run this cycle."
                },
                "cycle_amount_micros": {
                  "type": "integer",
                  "format": "int64",
                  "description": "The resource's charges this cycle, in micros."
                },
                "storage_bytes": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Billable size for storage resources, in bytes. Omitted for compute."
                }
              }
            }
          }
        }
      },
      "Invoice": {
        "type": "object",
        "required": [
          "uid",
          "number",
          "status",
          "period_start",
          "period_end",
          "base_currency",
          "subtotal_net_cents",
          "tax_total_cents",
          "total_gross_cents",
          "currency",
          "exchange_rate",
          "subtotal_net_minor",
          "tax_total_minor",
          "total_gross_minor",
          "tax_type",
          "tax_rate_bps",
          "tax_reason",
          "company",
          "lines"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "description": "Unique identifier of the invoice."
          },
          "number": {
            "type": "string",
            "description": "Sequential invoice number, `INV-<year>-<sequence>`."
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "issued",
              "paid",
              "void"
            ],
            "description": "`issued` when it is waiting to be paid from your wallet, `paid` once settled."
          },
          "period_start": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the billing period."
          },
          "period_end": {
            "type": "string",
            "format": "date-time",
            "description": "End of the billing period."
          },
          "issued_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the invoice was issued. Omitted for drafts."
          },
          "paid_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the invoice was paid. Omitted while unpaid."
          },
          "base_currency": {
            "type": "string",
            "description": "Currency of the `_cents` amounts. `USD`."
          },
          "subtotal_net_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Total before tax, in US cents."
          },
          "tax_total_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Tax, in US cents."
          },
          "total_gross_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Total including tax, in US cents."
          },
          "currency": {
            "type": "string",
            "description": "Currency you are billed in, `NGN` for Nigeria and `USD` otherwise."
          },
          "exchange_rate": {
            "type": "number",
            "description": "Rate used to convert US cents to `currency` minor units when the invoice was issued."
          },
          "subtotal_net_minor": {
            "type": "integer",
            "format": "int64",
            "description": "Total before tax, in `currency` minor units."
          },
          "tax_total_minor": {
            "type": "integer",
            "format": "int64",
            "description": "Tax, in `currency` minor units."
          },
          "total_gross_minor": {
            "type": "integer",
            "format": "int64",
            "description": "Total including tax, in `currency` minor units."
          },
          "tax_type": {
            "type": "string",
            "description": "Type of tax applied. `VAT`."
          },
          "tax_rate_bps": {
            "type": "integer",
            "description": "Tax rate in basis points. `750` is 7.5%."
          },
          "tax_reason": {
            "type": "string",
            "enum": [
              "standard",
              "zero_rated_export"
            ],
            "description": "`standard` for customers in RumptyCloud's home country, `zero_rated_export` (0%) for customers elsewhere."
          },
          "customer_name": {
            "type": "string",
            "description": "Your username when the invoice was issued."
          },
          "customer_email": {
            "type": "string",
            "description": "Your email address when the invoice was issued."
          },
          "customer_country": {
            "type": "string",
            "description": "Your billing country when the invoice was issued."
          },
          "customer_tax_id": {
            "type": "string",
            "description": "Your tax ID when the invoice was issued. Omitted when you had none."
          },
          "company": {
            "type": "object",
            "description": "The company issuing the invoice.",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "Legal name of the issuer."
              },
              "tax_id": {
                "type": "string",
                "description": "The issuer's tax ID. Omitted when not configured."
              },
              "address": {
                "type": "string",
                "description": "The issuer's address. Omitted when not configured."
              }
            }
          },
          "lines": {
            "type": "array",
            "description": "The billed items.",
            "items": {
              "type": "object",
              "required": [
                "description",
                "quantity",
                "net_cents",
                "tax_cents",
                "tax_rate_bps",
                "tax_type",
                "tax_reason"
              ],
              "properties": {
                "description": {
                  "type": "string",
                  "description": "What the line is for."
                },
                "resource_type": {
                  "type": "string",
                  "description": "Resource type the line covers. Omitted when not applicable."
                },
                "metric": {
                  "type": "string",
                  "description": "What was measured, e.g. `runtime` or `storage`."
                },
                "unit": {
                  "type": "string",
                  "description": "Unit of `quantity`, e.g. `hour` or `gb_month`."
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity billed, in `unit`."
                },
                "net_cents": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Line total before tax, in US cents."
                },
                "tax_cents": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Tax on the line, in US cents."
                },
                "tax_rate_bps": {
                  "type": "integer",
                  "description": "Tax rate for the line, in basis points."
                },
                "tax_type": {
                  "type": "string",
                  "description": "Type of tax. `VAT`."
                },
                "tax_reason": {
                  "type": "string",
                  "enum": [
                    "standard",
                    "zero_rated_export"
                  ],
                  "description": "Why this rate applies."
                }
              }
            }
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request was malformed or failed validation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "invalid request",
              "code": 400
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The API key is missing, invalid, expired or revoked.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "unauthorized"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "The account is past due, so new paid resources cannot be created.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "Your account is past due. Add funds to your wallet to create new paid resources.",
              "code": 402,
              "action": "past_due"
            }
          }
        }
      },
      "Forbidden": {
        "description": "You cannot access the workspace, your role does not allow this action, or the account is suspended.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "workspace not found or access denied",
              "code": 403
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource does not exist or you cannot access it.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "not found",
              "code": 404
            }
          }
        }
      },
      "Conflict": {
        "description": "The request conflicts with the resource's current state.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "conflict",
              "code": 409
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate limit exceeded. Wait the number of seconds in the `Retry-After` header before retrying.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "Too many requests. Please wait a moment and try again.",
              "code": 429
            }
          }
        }
      },
      "VmOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this action on this VM, so the existing operation is returned and nothing is queued. `status` is the operation's current status and `vm_status` the VM's current status (`deleted` once the VM is gone). For [Set the app port](/api/virtual-machines/set-the-vm-app-port) the key is also tied to the requested port, and for [Resize a VM](/api/virtual-machines/resize-a-vm) to the requested plan; reusing it with a different one returns `409` with `action: idempotency_key_reused`.",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VmOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation already finished; not queued again",
              "data": {
                "operation_id": "019a8f3e-1a22-7f04-b6d1-0c9e8a7f6d52",
                "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                "name": "web-1",
                "action": "start",
                "status": "succeeded",
                "vm_status": "running",
                "events_url": "/v1/operations/019a8f3e-1a22-7f04-b6d1-0c9e8a7f6d52/events",
                "is_replay": true,
                "is_completed": true
              }
            }
          }
        }
      },
      "SnapshotOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this snapshot action, so the existing\noperation is returned and nothing is queued. `vm_uid` is the VM from the request path and\n`name` is that VM's current name (empty if it is gone). For\n[Delete a snapshot](/api/snapshots/delete-a-snapshot), `vm_uid` is empty and `name` is the\nsnapshot's name.\n",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SnapshotOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation already finished; not queued again",
              "data": {
                "operation_id": "019a9031-6d7e-7f80-8b23-d4e5f6a7b8c9",
                "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                "name": "web-1",
                "action": "vm_snapshot.delete",
                "status": "succeeded",
                "events_url": "/v1/operations/019a9031-6d7e-7f80-8b23-d4e5f6a7b8c9/events",
                "is_replay": true,
                "is_completed": true
              }
            }
          }
        }
      },
      "CustomDomainOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this kind of custom domain action on this VM, so the existing operation is returned and nothing is queued.",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomDomainOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation still in progress; not queued again",
              "data": {
                "operation_id": "019a8f55-0e1f-7a2b-9c3d-4e5f6a7b8c9d",
                "status": "running",
                "events_url": "/v1/operations/019a8f55-0e1f-7a2b-9c3d-4e5f6a7b8c9d/events",
                "is_replay": true,
                "is_completed": false
              }
            }
          }
        }
      },
      "VmIdempotencyKeyReused": {
        "description": "The `X-Idempotency` key was already used for a different operation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "idempotency key was already used for a different operation; use a new X-Idempotency value",
              "code": 409,
              "action": "idempotency_key_reused"
            }
          }
        }
      },
      "KubernetesClusterOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this action, so the existing\noperation is returned and nothing is queued. `cluster` and `status` show the cluster as it\nis now (`deleted` once it is gone). `cluster` includes `kubeconfig` when one exists and you\nhave the `secrets.read` permission; otherwise it is empty and `kubeconfig_restricted` is\n`true`.\n",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/KubernetesClusterOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation already finished; not queued again",
              "data": {
                "operation_id": "019a9b22-1d2e-7f3a-8b4c-5d6e7f8a9b0c",
                "cluster": {
                  "uid": "019a9a10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                  "name": "production",
                  "slug": "production",
                  "status": "deleted",
                  "display_status": "deleted",
                  "zone_slug": "olas-closet",
                  "version": "v1.36.2+k3s1",
                  "image_slug": "ubuntu-2404-lts",
                  "endpoint": "https://production-1c2d3e.k8s.rumptycloud.com:16443",
                  "created_at": "2026-11-18T10:24:00Z"
                },
                "status": "deleted",
                "events_url": "/v1/operations/019a9b22-1d2e-7f3a-8b4c-5d6e7f8a9b0c/events",
                "is_replay": true,
                "is_completed": true
              }
            }
          }
        }
      },
      "DeploymentOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this action on this deployment, so\nthe original operation is returned and nothing is queued. `status` is the operation's\ncurrent status and `deployment` its current state (or `status: deleted` if it is gone).\n",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeploymentOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation already finished; not queued again",
              "data": {
                "operation_id": "019a9b30-8a9b-7c0d-9e1f-2a3b4c5d6e7f",
                "status": "succeeded",
                "events_url": "/v1/operations/019a9b30-8a9b-7c0d-9e1f-2a3b4c5d6e7f/events",
                "is_replay": true,
                "is_completed": true,
                "deployment": {
                  "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                  "name": "acme-api",
                  "slug": "acme-api",
                  "status": "active",
                  "display_status": "active",
                  "plan_slug": "deploy-tiny",
                  "repo_url": "https://github.com/acme/api.git",
                  "branch": "main",
                  "app_type": "service",
                  "build_method": "railpack",
                  "port": 3000,
                  "auto_deploy_enabled": true,
                  "security_scan_enabled": true,
                  "preview_apps_enabled": false,
                  "artifact_retention": 5,
                  "public_url": "https://acme-api.rumptycloud.app",
                  "default_public_url": "https://acme-api.rumptycloud.app",
                  "created_at": "2026-11-18T10:24:00Z"
                }
              }
            }
          }
        }
      },
      "DeploymentCustomDomainOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this action on this domain, so the original operation is returned and nothing is queued.",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeploymentCustomDomainOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation still in progress; not queued again",
              "data": {
                "operation_id": "019a9b55-3d4e-7f5a-8b6c-7d8e9f0a1b2c",
                "status": "running",
                "events_url": "/v1/operations/019a9b55-3d4e-7f5a-8b6c-7d8e9f0a1b2c/events",
                "is_replay": true
              }
            }
          }
        }
      },
      "DeploymentIdempotencyKeyReused": {
        "description": "The `X-Idempotency` key was already used for a different action or a different resource. Send a new key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "idempotency key was already used for a different operation; use a new X-Idempotency value",
              "code": 409,
              "action": "idempotency_key_reused"
            }
          }
        }
      },
      "AppIdempotencyKeyReused": {
        "description": "The `X-Idempotency` key was already used for a different action or a different app. Send a new key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "idempotency key was already used for a different operation; use a new X-Idempotency value",
              "code": 409,
              "action": "idempotency_key_reused"
            }
          }
        }
      },
      "DatabaseNotReady": {
        "description": "The database is not `ready` (`database is not available for this action`), for example\nwhile it is provisioning or `stopped` because the account is suspended. Also returned when\nthe `X-Idempotency` key was already used for a different operation\n(`action: idempotency_key_reused`).\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "database is not available for this action",
              "code": 409
            }
          }
        }
      },
      "DatabaseIdempotencyKeyReused": {
        "description": "The `X-Idempotency` key was already used for a different operation (`action: idempotency_key_reused`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "idempotency key was already used for a different operation; use a new X-Idempotency value",
              "code": 409,
              "action": "idempotency_key_reused"
            }
          }
        }
      },
      "DatabaseOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this action, so the existing\noperation is returned and nothing is queued. `status` is the operation's status and\n`database` is the database as it is now (`status: deleted` once it is gone). The password\nis never included.\n",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DatabaseOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation still in progress; not queued again",
              "data": {
                "operation_id": "019a9b10-5c6f-7a01-8b2c-3d4e5f6a7b8c",
                "database": {
                  "uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                  "name": "orders-db",
                  "slug": "orders-db",
                  "engine": "postgres",
                  "version": "17",
                  "status": "provisioning",
                  "display_status": "provisioning",
                  "plan_slug": "database-seed-olas-closet",
                  "zone_slug": "olas-closet",
                  "storage_gib": 5,
                  "vcpu": 1,
                  "cpu_limit_millis": 750,
                  "memory_mib": 512,
                  "host": "pg-1c2d3e.ws-acme.db.rumptycloud.com",
                  "port": 5432,
                  "database_name": "orders_db",
                  "username": "postgres",
                  "connection_string": "postgresql://postgres@pg-1c2d3e.ws-acme.db.rumptycloud.com:5432/orders_db?sslmode=require",
                  "internal_host": "pg-1c2d3e.db.rumpty.internal",
                  "internal_connection_string": "postgresql://postgres@pg-1c2d3e.db.rumpty.internal:5432/orders_db?sslmode=require",
                  "public_access": false,
                  "created_at": "2026-11-18T09:12:44Z"
                },
                "status": "running",
                "events_url": "/v1/operations/019a9b10-5c6f-7a01-8b2c-3d4e5f6a7b8c/events",
                "is_replay": true
              }
            }
          }
        }
      },
      "DatabaseDataUnavailable": {
        "description": "The data browser cannot run right now. Possible messages:\n`the database must be ready to browse its data`,\n`the data viewer is busy, try again in a moment`, and\n`couldn't reach the database, check that it's running and try again`.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "the data viewer is busy, try again in a moment",
              "code": 409
            }
          }
        }
      },
      "DatabaseSnapshotOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this action, so the existing operation is returned and nothing is queued. `status` is then the operation's status.",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DatabaseSnapshotOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation already finished; not queued again",
              "data": {
                "operation_id": "019a9d40-2b3e-7f50-9a61-7c8d9e0f1a2b",
                "database_uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                "name": "orders-db",
                "action": "database_snapshot.create",
                "status": "succeeded",
                "events_url": "/v1/operations/019a9d40-2b3e-7f50-9a61-7c8d9e0f1a2b/events",
                "is_replay": true,
                "is_completed": true
              }
            }
          }
        }
      },
      "VolumeOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this action, so the existing\noperation is returned and nothing is queued. `status` is the operation's status and\n`volume` is the volume as it is now (`status: deleted` once it is gone).\n",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VolumeOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation already finished; not queued again",
              "data": {
                "operation_id": "019a9c41-2b3c-7d4e-8f5a-6b7c8d9e0f1b",
                "volume": {
                  "uid": "019a9c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                  "name": "data-1",
                  "slug": "data-1",
                  "description": "Postgres data for web-1",
                  "status": "in-use",
                  "zone_slug": "olas-closet",
                  "size_gib": 50,
                  "filesystem": "ext4",
                  "formatted": true,
                  "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                  "vm_name": "web-1",
                  "created_at": "2026-11-18T10:40:00Z",
                  "attached_at": "2026-11-18T10:42:12Z"
                },
                "status": "succeeded",
                "events_url": "/v1/operations/019a9c41-2b3c-7d4e-8f5a-6b7c8d9e0f1b/events",
                "is_replay": true,
                "is_completed": true
              }
            }
          }
        }
      },
      "VolumeNotFound": {
        "description": "No volume with this `uid` exists in the workspace, or it has been deleted.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "volume not found",
              "code": 404
            }
          }
        }
      },
      "BucketOperationReplay": {
        "description": "Replay. The `X-Idempotency` key was already used for this action, so the original\noperation is returned and nothing is queued. `status` is the operation's current status.\n`bucket` is the bucket's current state, or only `uid`, `slug` and `status: deleted` once\nit is gone.\n",
        "headers": {
          "X-Idempotency-Replay": {
            "description": "Always `true` on a replay.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          },
          "X-Idempotency-Completed": {
            "description": "`true` when the original operation has already finished.",
            "schema": {
              "type": "string",
              "example": "true"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Envelope"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BucketOperationResult"
                    }
                  }
                }
              ]
            },
            "example": {
              "success": true,
              "message": "existing operation already finished; not queued again",
              "data": {
                "operation_id": "019a9f42-6a7b-7c8d-9e0f-1a2b3c4d5e6f",
                "bucket": {
                  "uid": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b",
                  "slug": "marketing-assets",
                  "status": "deleted"
                },
                "status": "succeeded",
                "events_url": "/v1/operations/019a9f42-6a7b-7c8d-9e0f-1a2b3c4d5e6f/events",
                "is_replay": true,
                "is_completed": true
              }
            }
          }
        }
      },
      "FirewallPolicyNotFound": {
        "description": "No firewall policy with this `uid` exists in the workspace.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "firewall policy not found",
              "code": 404
            }
          }
        }
      },
      "FirewallPolicyNameTaken": {
        "description": "Another policy in the workspace already has this name.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "a firewall policy with this name already exists",
              "code": 409
            }
          }
        }
      },
      "FirewallRuleInvalid": {
        "description": "Validation failed. Possible messages: `invalid request` (malformed JSON),\n`direction must be inbound or outbound`, `only allow firewall rules are supported`,\n`protocol must be tcp, udp, or all`, `port range must be between 1 and 65535`,\n`cidr is required`, or `cidr must be a valid CIDR block`.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "cidr must be a valid CIDR block",
              "code": 400
            }
          }
        }
      },
      "BillingForbidden": {
        "description": "Your email address is not verified (`action: verify_email`), or your account is suspended for abuse (`action: account_suspended`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "message": "verify your email before using this feature",
              "action": "verify_email"
            }
          }
        }
      }
    }
  },
  "x-sidebar-sections": [
    {
      "label": "Get started",
      "tags": [
        "Operations"
      ]
    },
    {
      "label": "Account",
      "tags": [
        "Account",
        "Workspaces",
        "API Keys",
        "SSH Keys",
        "Billing"
      ]
    },
    {
      "label": "Compute",
      "tags": [
        "Virtual Machines",
        "Snapshots",
        "Kubernetes",
        "Deployments",
        "Apps",
        "Git Connections"
      ]
    },
    {
      "label": "Storage & Data",
      "tags": [
        "Databases",
        "Volumes",
        "Buckets"
      ]
    },
    {
      "label": "Networking",
      "tags": [
        "Firewall Policies"
      ]
    }
  ],
  "tags": [
    {
      "name": "Account",
      "x-slug": "account",
      "description": "Your own account: your profile and billing details, the acceptable use policy you must accept\nbefore creating resources, and your activity log.\n\nThese endpoints belong to you, not to a workspace, so they do not take an `X-Workspace-Slug`\nheader.\n"
    },
    {
      "name": "Workspaces",
      "x-slug": "workspaces",
      "description": "Workspaces group resources and the people who can manage them. Every VM, snapshot and SSH key\nlives in a workspace, and most endpoints act on the workspace named in the `X-Workspace-Slug`\nheader.\n\n**Roles.** Each member has one role:\n\n| Role | Can |\n|---|---|\n| `owner` | Everything, including billing and deleting the workspace. Each workspace has exactly one owner, the person who created it. |\n| `admin` | Manage resources, settings, members and invitations, read the audit log, and delete SSH keys other members added to the workspace. Cannot invite or promote other admins, or change or remove another admin. |\n| `developer` | Create, change and delete resources, connect to them, and manage secrets and their own SSH keys. |\n| `viewer` | Read-only access to the workspace's resources. |\n\n**API keys.** A personal API key is also limited to the `permissions` on that key. The role and\nthe key both have to allow an action. Keys created without a permission list, including keys\ncreated before permissions existed, can read and change resources, connect to them, and manage\nsecrets. They cannot manage billing, members, audit, or delete the workspace unless you grant\nthose permissions when you create the key.\n\n**Workspace UID and slug.** Routes under `/v1/workspaces/{workspace_uid}/...` (notifications,\nsettings, members and invitations) need both the workspace's `uid` in the path and its slug in\n`X-Workspace-Slug`. They must name the same workspace, otherwise the request fails with `403`\n(`workspace not found or access denied`). Listing, creating and deleting workspaces, and the\n`/v1/workspace-invitations/{token}` routes, do not use the header.\n"
    },
    {
      "name": "API Keys",
      "x-slug": "api-keys",
      "description": "Personal API keys authenticate the CLI, the Rumpty MCP and your own automation. Keys belong to\nyou, not to a workspace. A key can only do what its `permissions` allow, and only where your\nrole already allows it. Omitting `permissions` grants the default set: `workspace.read`,\n`resource.write`, `runtime.connect`, `secrets.read` and `secrets.manage`.\n\nA key cannot change your password, second factor, profile or payment cards, mint or revoke\nkeys, use the admin API, or accept a workspace invitation. Those actions require a signed-in\nsession. See [API keys](/settings/api-keys) for the full permission list.\n"
    },
    {
      "name": "SSH Keys",
      "x-slug": "ssh-keys",
      "description": "SSH public keys you can install on VMs. Pass their `uid`s as `ssh_key_uids` when you\n[create a VM](/api/virtual-machines/create-a-vm).\n\nA key belongs both to you and to the workspace you add it in. In a workspace you can use\nyour own keys (including ones you added in other workspaces) and every key other members added\nto that workspace. Only the public key is stored. It is never returned by the API, only its\nfingerprint.\n"
    },
    {
      "name": "Virtual Machines",
      "x-slug": "virtual-machines",
      "description": "Create and manage virtual machines (VMs) in a workspace: pick a plan, image and zone, control\nthe VM's power state, resize it, read its metrics, expose ports over HTTPS, attach custom\ndomains and run one-off commands.\n\nMost write actions are asynchronous. They queue an operation and return `202 Accepted` with an\n`operation_id`. Poll [Get an operation](/api/operations/get-an-operation) to follow it.\n"
    },
    {
      "name": "Snapshots",
      "x-slug": "snapshots",
      "description": "Point-in-time copies of a VM's disk. Take snapshots from a VM, restore a VM to one, or create\na new VM from one. Snapshots belong to the workspace and survive deletion of their source VM.\nCreating, restoring and deleting snapshots are asynchronous operations.\n"
    },
    {
      "name": "Operations",
      "x-slug": "operations",
      "description": "Every asynchronous action (creating a VM, starting it, taking a snapshot, exposing an app and\nso on) is recorded as an operation. Operations move through `queued`, `running` and finally\n`succeeded` or `failed`.\n"
    },
    {
      "name": "Kubernetes",
      "x-slug": "kubernetes",
      "description": "Managed Kubernetes clusters built on [k3s](https://k3s.io). A cluster is one control-plane node\nand one to three worker nodes, each running on its own compute plan. When the cluster is ready\nyou get a public API `endpoint` and a `kubeconfig` to use with `kubectl`.\n\nCreating and deleting clusters is asynchronous. Both return `202 Accepted` with an\n`operation_id`. Poll [Get an operation](/api/operations/get-an-operation) or\n[Get a cluster](/api/kubernetes/get-a-cluster) to follow progress. Send `X-Idempotency` to\nmake retries safe: a repeated request returns the original operation with `200 OK`.\n\nIf the account is suspended for non-payment, running clusters are powered off (`stopped`)\nand restarted automatically once the account is active again.\n"
    },
    {
      "name": "Deployments",
      "x-slug": "deployments",
      "description": "Deployments build and run your application from a Git repository. Point a deployment at a\nrepository and branch, pick a plan, and RumptyCloud builds a container image (with Railpack or\nyour Dockerfile), runs it, and serves it over HTTPS on a `rumptycloud.app` hostname. You can\nadd custom domains, environment variables, a persistent volume, scale-to-zero and\nautoscaling.\n\nEvery build or rollout is a **run**. Runs keep their build logs and, while the image is\nretained, can be redeployed later to roll back.\n\nBuilds, rollouts, restarts, plan changes and deletion are asynchronous. They return\n`202 Accepted` with an `operation_id`. Poll [Get an operation](/api/operations/get-an-operation)\nto follow one.\n\nSend an optional `X-Idempotency` header to make retries safe. The key is looked up before\nanything else is checked, so a retry gets the original result even if the first request\nalready changed the deployment (for example, deleted it). If the key was already used for\nthe same action, the original operation is returned with `200 OK`, `is_replay: true` and\nan `X-Idempotency-Replay: true` header, and nothing new is queued. If the original\noperation has finished, `is_completed` is `true` and `X-Idempotency-Completed: true` is\nset. Reusing a key for a different action or a different deployment returns `409` with\n`action: idempotency_key_reused`. Keys are scoped to the workspace owner's account and\nthe workspace. Requests that queue no operation (create without `deploy_now`, a plan\nchange with nothing live) do not record the key, so repeating one runs it again.\n\nIf the account is suspended for non-payment, live apps are paused (`status: paused`) and\nbuilds, rollouts, restarts, environment applies and plan changes are rejected with `402`\nand `action: past_due` (as they are while the account is past due). Git pushes no longer\ntrigger auto-deploys and pull requests no longer get previews. Once the\naccount is active again, apps that suspension paused are resumed automatically within\nabout a minute.\n"
    },
    {
      "name": "Apps",
      "x-slug": "apps",
      "description": "One-click apps install ready-made software, such as WordPress or Uptime Kuma, from a catalog\nof templates. An app is a group of managed [deployments](/api/deployments/list-deployments)\ncalled **components**: usually a public `web` component plus private backing services such as\na `database`, each with its own plan and persistent volume. Components run pinned, prebuilt\nimages instead of building from a Git repository, and their passwords and secrets are\ngenerated for you.\n\nA regular deployment is something you build from your own code and manage directly. An app\nowns its components: they are created and deleted together, they carry an `app_uid`, they are\nleft out of [List deployments](/api/deployments/list-deployments), and they cannot be deleted\nor moved to another plan on their own. You can still read and manage a component through the\ndeployment endpoints, for example to add a custom domain to the web component or read its\nmetrics.\n"
    },
    {
      "name": "Git Connections",
      "x-slug": "git-connections",
      "description": "Connect GitHub accounts and organizations to a workspace through the RumptyCloud GitHub App,\nso deployments can build from your repositories. Once connected, list the repositories and\nbranches the app can see and detect how a repository should be built.\n\nA workspace can have several GitHub connections, one per GitHub account or organization.\nConnecting a new account happens in the browser on GitHub: get an install URL with\n[Get the GitHub App install URL](/api/git-connections/get-the-github-app-install-url) and open\nit. If you already connected the account in another workspace, you can\n[link that connection](/api/git-connections/link-a-github-app-installation) instead.\n"
    },
    {
      "name": "Databases",
      "x-slug": "databases",
      "description": "Managed PostgreSQL, MySQL and Redis-compatible (Valkey) databases. Pick a plan and engine\nversion, read the connection details and credentials, browse data with read-only queries,\ntake snapshots, resize to another plan and follow metrics.\n\nCreating, resizing, deleting, rotating the password and every snapshot action are\nasynchronous. They queue an operation and return its `operation_id`. Poll\n[Get an operation](/api/operations/get-an-operation) to follow it.\n\nDatabases are owned by the workspace owner's account. Every database endpoint only sees\ndatabases created in the workspace named by `X-Workspace-Slug`.\n"
    },
    {
      "name": "Volumes",
      "x-slug": "volumes",
      "description": "Block storage volumes you can attach to a VM for extra disk space. A volume lives on its own,\nso its data survives detaching it or deleting the VM it was attached to. A volume can be\nattached to one VM at a time, and the VM must be in the same zone.\n\nCreating, attaching, detaching and deleting volumes are asynchronous. They return\n`202 Accepted` with an `operation_id`. Poll [Get an operation](/api/operations/get-an-operation)\nor [Get a volume](/api/volumes/get-a-volume) to follow progress. Send `X-Idempotency` to\nmake retries safe: a repeated request returns the original operation with `200 OK`.\n"
    },
    {
      "name": "Buckets",
      "x-slug": "buckets",
      "description": "S3-compatible object storage buckets for files such as images, documents and video. A bucket\nis either `public` (objects are served from a public URL) or `private` (objects are read\nthrough short-lived signed URLs).\n\nCreating and deleting a bucket is asynchronous. The request returns `202 Accepted` with an\n`operation_id`. Poll [Get an operation](/api/operations/get-an-operation) to follow it.\n\nTo upload a file, use three steps:\n\n1. [Create an upload](/api/buckets/create-an-upload) to get a presigned `upload_url`.\n2. `PUT` the file's bytes to that URL with the returned headers.\n3. [Complete an upload](/api/buckets/complete-an-upload) to mark the object ready.\n\nFor direct S3 access from your own tools, create a\n[bucket access key](/api/buckets/create-a-bucket-access-key).\n\nThe first 10 GiB of file storage per account is free. Uploads that would go over the free\nallowance are rejected while billing for storage is not enabled.\n"
    },
    {
      "name": "Firewall Policies",
      "x-slug": "firewall-policies",
      "description": "Firewall policies control which traffic can reach your VMs, databases and deployments. A\npolicy is a named set of allow rules (protocol, port range and source CIDR). Attach a policy\nto a resource to enforce it. Policies belong to the workspace and can be attached to many\nresources.\n\nA resource with no policy attached is not filtered. Once one or more policies are attached,\nonly inbound traffic matching an allow rule of one of them is let through. Rules are\nallow-only: there are no deny rules.\n\nChanging rules or attachments queues a `firewall.apply` operation for every affected\nresource. Where a response includes an `operation_id`, you can follow it with\n[Get an operation](/api/operations/get-an-operation).\n"
    },
    {
      "name": "Billing",
      "x-slug": "billing",
      "description": "Your prepaid wallet, saved cards, current usage and invoices.\n\nBilling belongs to your account, not to a workspace, so these endpoints take no\n`X-Workspace-Slug` header. Resources are billed to the owner of the workspace they run in, so\nyour usage and invoices cover the workspaces you own.\n\nAmounts are kept in US dollars. Fields ending in `_cents` are US cents and fields ending in\n`_micros` are millionths of a dollar (10,000 micros = 1 cent). Customers billed in Nigeria see\nand pay amounts in naira: `display_currency` and `exchange_rate` tell you how to convert, and\nfields ending in `_minor` are in the minor unit of that currency (kobo for NGN).\n\nEvery billing endpoint, including the wallet and saved card endpoints, needs a verified email\naddress and returns `403` with `action: verify_email` otherwise.\n\nIf usage goes unpaid, your account becomes `past_due` and then `suspended` (see\n`billing_status` in [Get your profile](/api/account/get-your-profile)). Suspension powers\noff your VMs, databases, Kubernetes clusters and deployments. Paying what you owe makes the\naccount `active` again, and everything suspension powered off is started again\nautomatically within about a minute.\n"
    }
  ],
  "paths": {
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Get your profile",
        "x-slug": "get-your-profile",
        "description": "Returns the account the API key belongs to, including the workspaces you are an active member\nof and your role and permissions in each.\n\n`billing_country` is the country used for tax: the value you set with\n[Update your profile](/api/account/update-your-profile), or the country detected when you\nsigned up if you never set one.\n",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Your profile.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AccountProfile"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                    "username": "ada",
                    "email": "ada@acme.dev",
                    "role": "user",
                    "verified": true,
                    "joined_at": "2026-03-04T09:12:44Z",
                    "auth_method": "password",
                    "avatar_url": "/v1/avatars/0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f?v=1772615564",
                    "billing_country": "GB",
                    "tax_id": "GB123456789",
                    "billing_status": "active",
                    "workspaces": [
                      {
                        "uid": "0199c4d2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
                        "name": "Acme",
                        "slug": "acme",
                        "description": "Production workloads",
                        "is_default": true,
                        "role": "owner",
                        "permissions": [
                          "workspace.read",
                          "workspace.manage",
                          "resource.write",
                          "runtime.connect",
                          "secrets.read",
                          "secrets.manage",
                          "members.manage",
                          "audit.read",
                          "billing.read",
                          "billing.manage",
                          "workspace.transfer",
                          "workspace.delete"
                        ],
                        "member_count": 3
                      }
                    ],
                    "two_factor_enabled": true,
                    "signed_up_via_referral": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      },
      "patch": {
        "operationId": "updateMe",
        "summary": "Update your profile",
        "x-slug": "update-your-profile",
        "description": "Updates your billing details. Only the fields you send are changed. Send an empty string to\nclear a field.\n\nYour billing country decides the tax applied to your invoices and the currency amounts are\ndisplayed and charged in. A tax ID marks you as a business customer and is printed on your\ninvoices.\n\nReturns your full profile, the same shape as [Get your profile](/api/account/get-your-profile).\n",
        "tags": [
          "Account"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "billing_country": {
                    "type": "string",
                    "description": "Your tax residence as a 2-letter ISO 3166-1 country code. Trimmed and upper-cased. Send `\"\"` to clear it, in which case the country detected at signup is used again.",
                    "example": "GB"
                  },
                  "tax_id": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "Your VAT number or tax identification number. Trimmed. Send `\"\"` to clear it.",
                    "example": "GB123456789"
                  }
                }
              },
              "example": {
                "billing_country": "GB",
                "tax_id": "GB123456789"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The profile was updated. Returns your full profile.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AccountProfile"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                    "username": "ada",
                    "email": "ada@acme.dev",
                    "role": "user",
                    "verified": true,
                    "joined_at": "2026-03-04T09:12:44Z",
                    "auth_method": "password",
                    "billing_country": "GB",
                    "tax_id": "GB123456789",
                    "billing_status": "active",
                    "workspaces": [
                      {
                        "uid": "0199c4d2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
                        "name": "Acme",
                        "slug": "acme",
                        "description": "Production workloads",
                        "is_default": true,
                        "role": "owner",
                        "permissions": [
                          "workspace.read",
                          "workspace.manage",
                          "resource.write",
                          "runtime.connect",
                          "secrets.read",
                          "secrets.manage",
                          "members.manage",
                          "audit.read",
                          "billing.read",
                          "billing.manage",
                          "workspace.transfer",
                          "workspace.delete"
                        ],
                        "member_count": 3
                      }
                    ],
                    "two_factor_enabled": true,
                    "signed_up_via_referral": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request` (malformed JSON or a field is not a string), `billing_country must be a 2-letter ISO country code`, or `tax_id is too long`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "billing_country must be a 2-letter ISO country code",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      }
    },
    "/v1/policies/acceptable-use": {
      "get": {
        "operationId": "getAcceptableUsePolicyStatus",
        "summary": "Get acceptable use policy status",
        "x-slug": "get-acceptable-use-policy-status",
        "description": "Reports whether you have accepted the current versions of the policies that make up the\nacceptable use policy: the privacy and data policy (`privacy_data_policy`) and the fair use\npolicy (`fair_use_policy`).\n\n`accepted` is `true` only when every policy is accepted at its current version. Until then,\ncreating a VM, a deployment or an app returns `428 Precondition Required` with\n`action: accept_acceptable_use_policy`. Accept with\n[Accept the acceptable use policy](/api/account/accept-the-acceptable-use-policy).\n",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Your acceptance status.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AccountAcceptableUseStatus"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "accepted": false,
                    "policies": [
                      {
                        "policy_key": "privacy_data_policy",
                        "version": "2026-06-03",
                        "accepted": false
                      },
                      {
                        "policy_key": "fair_use_policy",
                        "version": "2026-06-03",
                        "accepted": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/policies/acceptable-use/accept": {
      "post": {
        "operationId": "acceptAcceptableUsePolicy",
        "summary": "Accept the acceptable use policy",
        "x-slug": "accept-the-acceptable-use-policy",
        "description": "Accepts the current version of every policy in the acceptable use policy for your account.\nYou must do this once before you can [create a VM](/api/virtual-machines/create-a-vm),\na deployment or an app. Those endpoints return `428` until you have.\n\nNo request body is needed. The acceptance is recorded with the time, your IP address and your\nuser agent. Calling it again is safe: it refreshes `accepted_at`.\n\nReturns the updated status, the same shape as\n[Get acceptable use policy status](/api/account/get-acceptable-use-policy-status).\n",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "The policies were accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AccountAcceptableUseStatus"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "acceptable use policy accepted",
                  "data": {
                    "accepted": true,
                    "policies": [
                      {
                        "policy_key": "privacy_data_policy",
                        "version": "2026-06-03",
                        "accepted": true,
                        "accepted_at": "2026-11-18T10:20:31Z"
                      },
                      {
                        "policy_key": "fair_use_policy",
                        "version": "2026-06-03",
                        "accepted": true,
                        "accepted_at": "2026-11-18T10:20:31Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/audit-logs": {
      "get": {
        "operationId": "listAuditLogs",
        "summary": "List audit logs",
        "x-slug": "list-audit-logs",
        "description": "Returns audit log entries, newest first. Only actions that change something (creating,\nupdating, deleting, starting a VM and so on) are recorded. Reads are not logged. Each action\nis logged whether it succeeded or failed.\n\nThere are two views:\n\n- **Your activity** (default): every entry where you were the actor, across all workspaces.\n- **Workspace trail**: send the `workspace_slug` query parameter to get every member's\n  entries for that workspace. You need the owner or admin role in the workspace.\n\nThis endpoint does **not** read the `X-Workspace-Slug` header. Use the `workspace_slug` query\nparameter to select a workspace.\n\nPaging details are in a top-level `meta` object next to `data`. Entry fields use PascalCase\nnames. Entries identify the acting user and the workspace by UID only (`UserUID`,\n`WorkspaceUID`); they do not include account or workspace details.\n",
        "tags": [
          "Account"
        ],
        "parameters": [
          {
            "name": "workspace_slug",
            "in": "query",
            "required": false,
            "description": "Slug of a workspace to return the shared audit trail for. Requires the owner or admin role in that workspace. Omit it to get your own activity.",
            "schema": {
              "type": "string",
              "example": "acme"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "description": "Filter by action. A value ending in `.success` or `.failed` matches exactly. Any other\nvalue matches every outcome of that action, so `vm.create` matches `vm.create.success`\nand `vm.create.failed`.\n",
            "schema": {
              "type": "string",
              "example": "vm.create"
            }
          },
          {
            "name": "resource_type",
            "in": "query",
            "required": false,
            "description": "Only return entries for this resource type, e.g. `vm`, `snapshot`, `ssh_key`, `workspace_member`.",
            "schema": {
              "type": "string",
              "example": "vm"
            }
          },
          {
            "name": "resource_uid",
            "in": "query",
            "required": false,
            "description": "Only return entries about the resource with this UID.",
            "schema": {
              "type": "string",
              "example": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Only return entries created at or after this time (RFC 3339). An invalid value is ignored.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-11-01T00:00:00Z"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Only return entries created at or before this time (RFC 3339). An invalid value is ignored.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-11-18T23:59:59Z"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1. Values below 1 return the first page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "example": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Entries per page. Defaults to `50`. Values below 1 or above `200` fall back to `50`.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "example": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The matching audit log entries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "`true` when the request succeeded.",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Always `ok`.",
                      "example": "ok"
                    },
                    "data": {
                      "type": "array",
                      "description": "The entries on this page, newest first.",
                      "items": {
                        "$ref": "#/components/schemas/AccountAuditLog"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "description": "Paging details.",
                      "required": [
                        "total",
                        "page",
                        "page_size"
                      ],
                      "properties": {
                        "total": {
                          "type": "integer",
                          "format": "int64",
                          "description": "Total number of matching entries.",
                          "example": 128
                        },
                        "page": {
                          "type": "integer",
                          "description": "The page that was returned. Values below 1 (or non-numbers) are reported as `1`.",
                          "example": 1
                        },
                        "page_size": {
                          "type": "integer",
                          "description": "The page size that was used. Values below 1 or above `200` (or non-numbers) are reported as `50`.",
                          "example": 50
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "UID": "019a8f2c-7e10-7a21-b3c4-d5e6f7a8b9c0",
                      "UserUID": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                      "WorkspaceUID": "0199c4d2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
                      "Description": "Requested to create web-1",
                      "Actor": "3f9a1c2e",
                      "ActorType": "api_key",
                      "Status": "successful",
                      "Action": "vm.create.success",
                      "Severity": "info",
                      "ResourceName": "web-1",
                      "ResourceUID": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "Category": "compute",
                      "ResourceType": "vm",
                      "IPAddress": "203.0.113.24",
                      "UserAgent": "rumpty-cli/1.4.0",
                      "StatusCode": 202,
                      "Metadata": {},
                      "CreatedAt": "2026-11-18T10:24:00Z"
                    }
                  ],
                  "meta": {
                    "total": 128,
                    "page": 1,
                    "page_size": 50
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The workspace in `workspace_slug` does not exist or you are not a member (`workspace not found or access denied`), or your role cannot read its audit log (`you do not have permission to view this workspace's audit log`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "you do not have permission to view this workspace's audit log"
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/workspaces": {
      "get": {
        "operationId": "listWorkspaces",
        "summary": "List workspaces",
        "x-slug": "list-workspaces",
        "description": "Returns every workspace you are an active member of, newest first, with your role and\npermissions in each. This endpoint needs no `X-Workspace-Slug` header.\n\nWithout query parameters, every workspace is returned in `data`. Send `page` or `page_size` to\npaginate. A top-level `pagination` object is then added next to `data`, and `q` filters the\nresults. `q` is ignored unless `page` or `page_size` is present.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1. Values below 1 (or non-numbers) are treated as `1`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Items per page. Defaults to `10`. Values above `100` are capped at `100`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "example": 20
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search across the workspace's name, slug and description. Only applied when paginating.",
            "schema": {
              "type": "string",
              "example": "acme"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your workspaces. `pagination` is only present when `page` or `page_size` was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Workspace"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/VmPagination"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "0199c4d2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
                      "name": "Acme",
                      "slug": "acme",
                      "description": "Production workloads",
                      "is_default": true,
                      "vm_exec_enabled": false,
                      "created_at": "2026-03-04T09:12:45Z",
                      "updated_at": "2026-10-01T08:00:00Z",
                      "role": "owner",
                      "permissions": [
                        "workspace.read",
                        "workspace.manage",
                        "resource.write",
                        "runtime.connect",
                        "secrets.read",
                        "secrets.manage",
                        "members.manage",
                        "audit.read",
                        "billing.read",
                        "billing.manage",
                        "workspace.transfer",
                        "workspace.delete"
                      ],
                      "member_count": 3
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 20,
                    "total": 1,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      },
      "post": {
        "operationId": "createWorkspace",
        "summary": "Create a workspace",
        "x-slug": "create-a-workspace",
        "description": "Creates a workspace and makes you its owner. This endpoint needs no `X-Workspace-Slug` header.\n\nThe slug is generated from the name plus the first 8 characters of the new workspace's `uid`,\nso `Staging` becomes something like `staging-019a8f2c`. Use the returned `slug` in\n`X-Workspace-Slug` for requests in the new workspace. Workspace names do not have to be\nunique.\n",
        "tags": [
          "Workspaces"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name. Leading and trailing spaces are trimmed. Must contain at least one letter or digit.",
                    "example": "Staging"
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional free-text description.",
                    "example": "Pre-production environment"
                  }
                }
              },
              "example": {
                "name": "Staging",
                "description": "Pre-production environment"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The workspace was created. You are its owner.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Workspace"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "workspace created",
                  "data": {
                    "uid": "019a8f2c-1d2e-7f3a-8b4c-5d6e7f8a9b0c",
                    "name": "Staging",
                    "slug": "staging-019a8f2c",
                    "description": "Pre-production environment",
                    "is_default": false,
                    "vm_exec_enabled": false,
                    "created_at": "2026-11-18T10:24:00Z",
                    "updated_at": "2026-11-18T10:24:00Z",
                    "role": "owner",
                    "permissions": [
                      "workspace.read",
                      "workspace.manage",
                      "resource.write",
                      "runtime.connect",
                      "secrets.read",
                      "secrets.manage",
                      "members.manage",
                      "audit.read",
                      "billing.read",
                      "billing.manage",
                      "workspace.transfer",
                      "workspace.delete"
                    ],
                    "member_count": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request` (malformed JSON or `name` missing), `workspace name cannot be empty`, or `workspace name must contain alphanumeric characters`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "workspace name must contain alphanumeric characters",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403"
        ]
      }
    },
    "/v1/workspaces/{workspace_uid}": {
      "delete": {
        "operationId": "deleteWorkspace",
        "summary": "Delete a workspace",
        "x-slug": "delete-a-workspace",
        "description": "Permanently deletes a workspace you own, together with its members, pending invitations and\nany leftover records. The audit history is kept but no longer linked to the workspace. This\nendpoint needs no `X-Workspace-Slug` header.\n\nYou can only delete a workspace when:\n\n- you are its owner (other members get `404`),\n- it is not your default workspace, and\n- it has no VMs, volumes, databases, Kubernetes clusters, storage buckets or deployments left.\n  Delete those first.\n\nThe response contains the deleted workspace. `role` and `permissions` are not included.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Workspace"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "workspace deleted",
                  "data": {
                    "uid": "019a8f2c-1d2e-7f3a-8b4c-5d6e7f8a9b0c",
                    "name": "Staging",
                    "slug": "staging-019a8f2c",
                    "description": "Pre-production environment",
                    "is_default": false,
                    "vm_exec_enabled": false,
                    "created_at": "2026-11-18T10:24:00Z",
                    "updated_at": "2026-11-18T10:24:00Z",
                    "member_count": 0
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The workspace cannot be deleted: `default workspace cannot be deleted` or `workspace still has resources; delete the resources first`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "workspace still has resources; delete the resources first",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "description": "No workspace with this `uid` is owned by you (`workspace not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "workspace not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/workspaces/{workspace_uid}/notifications": {
      "get": {
        "operationId": "getWorkspaceNotifications",
        "summary": "Get notification settings",
        "x-slug": "get-notification-settings",
        "description": "Reports whether the workspace has an alert webhook. The webhook URL itself is stored encrypted\nand never returned.\n\nRequires the owner or admin role.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's notification settings.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceNotifications"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "webhook_configured": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      },
      "patch": {
        "operationId": "updateWorkspaceNotifications",
        "summary": "Update notification settings",
        "x-slug": "update-notification-settings",
        "description": "Sets or removes the workspace's alert webhook. When set, workspace alerts (for example an app\nthat keeps crashing) are also sent as an HTTP `POST` to this URL, in addition to email. You\ncan use a Discord webhook URL or any HTTPS endpoint.\n\n- Send a URL to set or replace the webhook.\n- Send `\"\"` to remove it.\n- Omit `webhook_url` (or send `null`) to leave it unchanged.\n\nRequires the owner or admin role.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook_url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2048,
                    "description": "HTTPS URL to post alerts to. Leading and trailing spaces are trimmed. Must use `https` and include a host. Send `\"\"` to remove the webhook.",
                    "example": "https://discord.com/api/webhooks/1234567890/abcdefghijklmnop"
                  }
                }
              },
              "example": {
                "webhook_url": "https://discord.com/api/webhooks/1234567890/abcdefghijklmnop"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings were saved.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceNotifications"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "webhook_configured": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request` (malformed JSON), `webhook URL must be 2048 characters or less`, `webhook URL is not valid`, or `webhook URL must use https`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "webhook URL must use https",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      }
    },
    "/v1/workspaces/{workspace_uid}/settings": {
      "get": {
        "operationId": "getWorkspaceSettings",
        "summary": "Get workspace settings",
        "x-slug": "get-workspace-settings",
        "description": "Returns the workspace's settings.\n\nRequires the owner or admin role.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's settings.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceSettings"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "vm_exec_enabled": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      },
      "patch": {
        "operationId": "updateWorkspaceSettings",
        "summary": "Update workspace settings",
        "x-slug": "update-workspace-settings",
        "description": "Changes the workspace's settings. Omitted fields are left unchanged.\n\n`vm_exec_enabled` controls whether [Run a command on a VM](/api/virtual-machines/run-a-command-on-a-vm)\nis allowed in this workspace. It is off by default. AI assistants use that endpoint to run\ncommands on your VMs.\n\nRequires the owner or admin role.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vm_exec_enabled": {
                    "type": "boolean",
                    "description": "Allow running commands on the workspace's VMs through the API.",
                    "example": true
                  }
                }
              },
              "example": {
                "vm_exec_enabled": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings were saved. Returns the current settings.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceSettings"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "vm_exec_enabled": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      }
    },
    "/v1/workspaces/{workspace_uid}/members": {
      "get": {
        "operationId": "listWorkspaceMembers",
        "summary": "List members",
        "x-slug": "list-members",
        "description": "Returns the workspace's members in the order they joined, with each member's role and\npermissions. `is_current_user` marks you.\n\nAny workspace role can call this.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's members.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WorkspaceMember"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "0199c4d2-5e70-7a8b-9c0d-1e2f3a4b5c6e",
                      "user_uid": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                      "username": "ada",
                      "email": "ada@acme.dev",
                      "role": "owner",
                      "permissions": [
                        "workspace.read",
                        "workspace.manage",
                        "resource.write",
                        "runtime.connect",
                        "secrets.read",
                        "secrets.manage",
                        "members.manage",
                        "audit.read",
                        "billing.read",
                        "billing.manage",
                        "workspace.transfer",
                        "workspace.delete"
                      ],
                      "status": "active",
                      "joined_at": "2026-03-04T09:12:45Z",
                      "is_current_user": true
                    },
                    {
                      "uid": "019a6e01-3b4c-7d5e-8f6a-7b8c9d0e1f2a",
                      "user_uid": "019a6dff-9a8b-7c6d-8e5f-4a3b2c1d0e9f",
                      "username": "grace",
                      "email": "grace@acme.dev",
                      "role": "developer",
                      "permissions": [
                        "workspace.read",
                        "resource.write",
                        "runtime.connect",
                        "secrets.read",
                        "secrets.manage"
                      ],
                      "status": "active",
                      "joined_at": "2026-10-27T15:02:10Z",
                      "invited_by": {
                        "uid": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                        "username": "ada"
                      },
                      "is_current_user": false
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      }
    },
    "/v1/workspaces/{workspace_uid}/members/{member_uid}": {
      "patch": {
        "operationId": "updateWorkspaceMemberRole",
        "summary": "Change a member's role",
        "x-slug": "change-a-members-role",
        "description": "Changes a member's role to `admin`, `developer` or `viewer`. The new permissions apply to the\nmember's next request.\n\nRequires the owner or admin role. Some changes are not allowed:\n\n- The owner's role cannot be changed, and no one can be made owner.\n- Admins cannot give anyone the `admin` role, and cannot change another admin's role.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          },
          {
            "$ref": "#/components/parameters/WorkspaceMemberUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "role"
                ],
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "developer",
                      "viewer"
                    ],
                    "description": "The member's new role.",
                    "example": "viewer"
                  }
                }
              },
              "example": {
                "role": "viewer"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The role was changed. Returns the updated member. `invited_by` is not included in this response.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceMember"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "member role updated",
                  "data": {
                    "uid": "019a6e01-3b4c-7d5e-8f6a-7b8c9d0e1f2a",
                    "user_uid": "019a6dff-9a8b-7c6d-8e5f-4a3b2c1d0e9f",
                    "username": "grace",
                    "email": "grace@acme.dev",
                    "role": "viewer",
                    "permissions": [
                      "workspace.read"
                    ],
                    "status": "active",
                    "joined_at": "2026-10-27T15:02:10Z",
                    "is_current_user": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `role is required` (missing or malformed body) or `role must be admin, developer, or viewer`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "role must be admin, developer, or viewer",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed: your role cannot manage members, `the workspace owner role cannot be changed`,\n`admins cannot assign the admin role`, or `admins cannot change another admin's role`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "the workspace owner role cannot be changed",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "description": "No member with this `uid` in the workspace (`workspace member not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "workspace member not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "removeWorkspaceMember",
        "summary": "Remove a member",
        "x-slug": "remove-a-member",
        "description": "Removes a member from the workspace. They lose access immediately. Resources they created stay\nin the workspace.\n\nRequires the owner or admin role. You cannot remove yourself or the owner, and admins cannot\nremove another admin.\n\nThe response contains the member as they were before removal.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          },
          {
            "$ref": "#/components/parameters/WorkspaceMemberUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The member was removed.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceMember"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "member removed",
                  "data": {
                    "uid": "019a6e01-3b4c-7d5e-8f6a-7b8c9d0e1f2a",
                    "user_uid": "019a6dff-9a8b-7c6d-8e5f-4a3b2c1d0e9f",
                    "username": "grace",
                    "email": "grace@acme.dev",
                    "role": "developer",
                    "permissions": [
                      "workspace.read",
                      "resource.write",
                      "runtime.connect",
                      "secrets.read",
                      "secrets.manage"
                    ],
                    "status": "active",
                    "joined_at": "2026-10-27T15:02:10Z",
                    "is_current_user": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed: your role cannot manage members, `you cannot remove yourself from the workspace`,\n`the workspace owner cannot be removed`, or `admins cannot remove another admin`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "the workspace owner cannot be removed",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "description": "No member with this `uid` in the workspace (`workspace member not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "workspace member not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/workspaces/{workspace_uid}/invitations": {
      "get": {
        "operationId": "listWorkspaceInvitations",
        "summary": "List invitations",
        "x-slug": "list-invitations",
        "description": "Returns the workspace's pending invitations, newest first. Accepted, revoked and expired\ninvitations are not listed.\n\nRequires the owner or admin role.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The pending invitations.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WorkspaceInvitation"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a8f30-4c5d-7e6f-8a9b-0c1d2e3f4a5b",
                      "email": "linus@acme.dev",
                      "role": "developer",
                      "status": "pending",
                      "created_at": "2026-11-18T10:24:00Z",
                      "expires_at": "2026-11-21T10:24:00Z",
                      "invited_by": {
                        "uid": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                        "username": "ada"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "429"
        ]
      },
      "post": {
        "operationId": "createWorkspaceInvitation",
        "summary": "Invite a member",
        "x-slug": "invite-a-member",
        "description": "Emails an invitation to join the workspace. The email contains a link with a secret token. The\ntoken is never returned by the API. The invitee opens the link, signs in or signs up with the\ninvited email address, and accepts. See\n[Accept an invitation](/api/workspaces/accept-an-invitation).\n\nInvitations expire after 72 hours. Use\n[Resend an invitation](/api/workspaces/resend-an-invitation) to send a fresh link.\n\nRequires the owner or admin role. Admins cannot invite someone as `admin`.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "role"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254,
                    "description": "Email address to invite. It is trimmed and lower-cased before use.",
                    "example": "linus@acme.dev"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "developer",
                      "viewer"
                    ],
                    "description": "Role the invitee gets when they accept.",
                    "example": "developer"
                  }
                }
              },
              "example": {
                "email": "linus@acme.dev",
                "role": "developer"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The invitation was created and the email queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceInvitation"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "invitation sent",
                  "data": {
                    "uid": "019a8f30-4c5d-7e6f-8a9b-0c1d2e3f4a5b",
                    "email": "linus@acme.dev",
                    "role": "developer",
                    "status": "pending",
                    "created_at": "2026-11-18T10:24:00Z",
                    "expires_at": "2026-11-21T10:24:00Z",
                    "invited_by": {
                      "uid": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                      "username": "ada"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `email and role are required`, `a valid email address is required`, or `role must be admin, developer, or viewer`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "a valid email address is required",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your role cannot manage members, or you are an admin inviting someone as `admin` (`admins cannot assign the admin role`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "admins cannot assign the admin role",
                  "code": 403
                }
              }
            }
          },
          "409": {
            "description": "Conflict: `you are already a member of this workspace` (you invited yourself),\n`user is already a member of this workspace`, or\n`a pending invitation already exists for this email`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "a pending invitation already exists for this email",
                  "code": 409
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403",
          "409",
          "429"
        ]
      }
    },
    "/v1/workspaces/{workspace_uid}/invitations/{invitation_uid}/resend": {
      "post": {
        "operationId": "resendWorkspaceInvitation",
        "summary": "Resend an invitation",
        "x-slug": "resend-an-invitation",
        "description": "Emails a pending invitation again with a new link. The previous link stops working, and the\ninvitation's expiry is reset to 72 hours from now. No request body is needed.\n\nRequires the owner or admin role.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          },
          {
            "$ref": "#/components/parameters/WorkspaceInvitationUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The invitation was resent.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceInvitation"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "invitation resent",
                  "data": {
                    "uid": "019a8f30-4c5d-7e6f-8a9b-0c1d2e3f4a5b",
                    "email": "linus@acme.dev",
                    "role": "developer",
                    "status": "pending",
                    "created_at": "2026-11-18T10:24:00Z",
                    "expires_at": "2026-11-22T09:00:00Z",
                    "invited_by": {
                      "uid": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                      "username": "ada"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No invitation with this `uid` in the workspace (`invitation not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invitation not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The invitation was already accepted, revoked or marked expired (`invitation is no longer pending`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invitation is no longer pending",
                  "code": 409
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409",
          "429"
        ]
      }
    },
    "/v1/workspaces/{workspace_uid}/invitations/{invitation_uid}": {
      "delete": {
        "operationId": "revokeWorkspaceInvitation",
        "summary": "Revoke an invitation",
        "x-slug": "revoke-an-invitation",
        "description": "Revokes a pending invitation. Its link stops working straight away.\n\nRequires the owner or admin role.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/WorkspaceUid"
          },
          {
            "$ref": "#/components/parameters/WorkspaceInvitationUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The invitation was revoked. Returns it with `status` set to `revoked`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceInvitation"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "invitation revoked",
                  "data": {
                    "uid": "019a8f30-4c5d-7e6f-8a9b-0c1d2e3f4a5b",
                    "email": "linus@acme.dev",
                    "role": "developer",
                    "status": "revoked",
                    "created_at": "2026-11-18T10:24:00Z",
                    "expires_at": "2026-11-21T10:24:00Z",
                    "invited_by": {
                      "uid": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                      "username": "ada"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No invitation with this `uid` in the workspace (`invitation not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invitation not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The invitation was already accepted, revoked or marked expired (`invitation is no longer pending`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invitation is no longer pending",
                  "code": 409
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409",
          "429"
        ]
      }
    },
    "/v1/workspace-invitations/{token}/lookup": {
      "get": {
        "operationId": "lookupWorkspaceInvitation",
        "summary": "Look up an invitation",
        "x-slug": "look-up-an-invitation",
        "description": "Returns the basic details of an invitation from the token in its email link, so a signed-out\ninvitee can be sent to sign in or sign up. `account_exists` tells you which.\n\nThis endpoint is public and needs no API key or workspace: holding the token is the\ncredential. `status` is reported as `expired` once the invitation is past its expiry, even if\nit was never marked expired. Responses are sent with `Cache-Control: no-store`.\n",
        "tags": [
          "Workspaces"
        ],
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceInvitationToken"
          }
        ],
        "responses": {
          "200": {
            "description": "The invitation's details.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceInvitationLookup"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "email": "linus@acme.dev",
                    "role": "developer",
                    "status": "pending",
                    "expires_at": "2026-11-21T10:24:00Z",
                    "workspace_name": "Acme",
                    "invited_by": "ada",
                    "account_exists": false
                  }
                }
              }
            }
          },
          "404": {
            "description": "The token does not match any invitation (`invitation not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invitation not found",
                  "code": 404
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "x-response-order": [
          "200",
          "404",
          "429"
        ]
      }
    },
    "/v1/workspace-invitations/{token}": {
      "get": {
        "operationId": "previewWorkspaceInvitation",
        "summary": "Preview an invitation",
        "x-slug": "preview-an-invitation",
        "description": "Returns an invitation addressed to you, with the workspace it is for, so you can review it\nbefore [accepting it](/api/workspaces/accept-an-invitation). Use the token from the\ninvitation email.\n\nNeeds a verified account whose email matches the invited address. No `X-Workspace-Slug`\nheader is needed, since you may not belong to any workspace yet. If the invitation has\nexpired, it is marked expired and `409` is returned. Responses are sent with\n`Cache-Control: no-store`.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceInvitationToken"
          }
        ],
        "responses": {
          "200": {
            "description": "The invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceInvitationPreview"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a8f30-4c5d-7e6f-8a9b-0c1d2e3f4a5b",
                    "email": "linus@acme.dev",
                    "role": "developer",
                    "status": "pending",
                    "expires_at": "2026-11-21T10:24:00Z",
                    "workspace": {
                      "uid": "0199c4d2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
                      "name": "Acme",
                      "slug": "acme",
                      "description": "Production workloads",
                      "is_default": true,
                      "member_count": 0
                    },
                    "invited_by": {
                      "uid": "0199c4d1-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                      "username": "ada"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your email is not verified (`action: verify_email`), or the invitation was sent to a different address (`this invitation was sent to a different email address`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "this invitation was sent to a different email address",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "description": "The token does not match any invitation (`invitation not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invitation not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "`invitation is no longer pending` (already accepted, revoked or expired) or `invitation has expired`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invitation has expired",
                  "code": 409
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404",
          "409",
          "429"
        ]
      }
    },
    "/v1/workspace-invitations/{token}/accept": {
      "post": {
        "operationId": "acceptWorkspaceInvitation",
        "summary": "Accept an invitation",
        "x-slug": "accept-an-invitation",
        "description": "Accepts an invitation addressed to you and adds you to the workspace with the invited role.\nThe inviter is emailed that you joined. No request body is needed.\n\nNeeds a verified account whose email matches the invited address. No `X-Workspace-Slug`\nheader is needed. Use the returned `slug` in `X-Workspace-Slug` for requests in the\nworkspace you joined. Responses are sent with `Cache-Control: no-store`.\n",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceInvitationToken"
          }
        ],
        "responses": {
          "200": {
            "description": "You joined the workspace. Returns it with your new role and permissions. `member_count` is always `0` in this response.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WorkspaceSummary"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "invitation accepted",
                  "data": {
                    "uid": "0199c4d2-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
                    "name": "Acme",
                    "slug": "acme",
                    "description": "Production workloads",
                    "is_default": true,
                    "role": "developer",
                    "permissions": [
                      "workspace.read",
                      "resource.write",
                      "runtime.connect",
                      "secrets.read",
                      "secrets.manage"
                    ],
                    "member_count": 0
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your email is not verified (`action: verify_email`), or the invitation was sent to a different address (`this invitation was sent to a different email address`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "this invitation was sent to a different email address",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "description": "The token does not match any invitation (`invitation not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invitation not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "`invitation is no longer pending`, `invitation has expired`, or `you are already a member of this workspace`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "you are already a member of this workspace",
                  "code": 409
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404",
          "409",
          "429"
        ]
      }
    },
    "/v1/api-keys": {
      "post": {
        "operationId": "createApiKey",
        "summary": "Create an API key",
        "x-slug": "create-an-api-key",
        "description": "Creates a personal API key. The full `token` appears **only in this response**. Store it\nsecurely, because it cannot be retrieved again.\n\nKeys expire after 365 days by default. Set `expires_in_days` to choose a lifetime (capped at\n730 days), or set `never_expires` to `true`. Do not send both.\n",
        "tags": [
          "API Keys"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Label for the key. Must be unique among your keys.",
                    "example": "CI deploy"
                  },
                  "expires_in_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 730,
                    "description": "Days until the key expires. Defaults to `365`. Values above `730` are capped at `730`.",
                    "example": 90
                  },
                  "never_expires": {
                    "type": "boolean",
                    "description": "Create a key that never expires. Cannot be combined with `expires_in_days`.",
                    "default": false
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "cli",
                      "mcp"
                    ],
                    "default": "cli",
                    "description": "What the key is for. `cli` covers the CLI and REST API. `mcp` is for the Rumpty MCP server."
                  },
                  "permissions": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "workspace.read",
                        "resource.write",
                        "runtime.connect",
                        "secrets.read",
                        "secrets.manage",
                        "members.manage",
                        "audit.read",
                        "billing.read",
                        "billing.manage",
                        "workspace.manage",
                        "workspace.transfer",
                        "workspace.delete"
                      ]
                    },
                    "description": "Permissions this key may use, capped by your role in each workspace. Omit it to\ngrant the default set (`workspace.read`, `resource.write`, `runtime.connect`,\n`secrets.read`, `secrets.manage`). Keys that already exist keep that same default\nuntil you replace them.\n"
                  }
                }
              },
              "example": {
                "name": "CI deploy",
                "expires_in_days": 90,
                "scope": "cli"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The key was created. The response includes the one-time `token`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "allOf": [
                            {
                              "$ref": "#/components/schemas/ApiKey"
                            },
                            {
                              "type": "object",
                              "required": [
                                "token"
                              ],
                              "properties": {
                                "token": {
                                  "type": "string",
                                  "description": "The full secret token. Shown only once.",
                                  "example": "rumpty_3f9a1c2e_9b8d7c6e5f4a3b2c1d0e9f8a7b6c5d4e"
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "API key created. Copy the token now. It will not be shown again.",
                  "data": {
                    "uid": "7c1e2f9a-4b3d-4e8f-9a1b-2c3d4e5f6a7b",
                    "name": "CI deploy",
                    "prefix": "3f9a1c2e",
                    "scopes": [
                      "cli"
                    ],
                    "permissions": [
                      "workspace.read",
                      "resource.write",
                      "runtime.connect",
                      "secrets.read",
                      "secrets.manage"
                    ],
                    "expires_at": "2027-02-16T10:24:00Z",
                    "created_at": "2026-11-18T10:24:00Z",
                    "token": "rumpty_3f9a1c2e_9b8d7c6e5f4a3b2c1d0e9f8a7b6c5d4e"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `name` is missing or already used, `scope` is not `cli` or `mcp`, `permissions` contains an unknown value, or both `never_expires` and `expires_in_days` were sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "an API key with this name already exists.",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401"
        ]
      },
      "get": {
        "operationId": "listApiKeys",
        "summary": "List API keys",
        "x-slug": "list-api-keys",
        "description": "Returns your active API keys. Secret tokens are never returned, only the `prefix` that identifies each key.",
        "tags": [
          "API Keys"
        ],
        "responses": {
          "200": {
            "description": "Your API keys.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ApiKey"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "7c1e2f9a-4b3d-4e8f-9a1b-2c3d4e5f6a7b",
                      "name": "CI deploy",
                      "prefix": "3f9a1c2e",
                      "scopes": [
                        "cli"
                      ],
                      "permissions": [
                        "workspace.read",
                        "resource.write",
                        "runtime.connect",
                        "secrets.read",
                        "secrets.manage"
                      ],
                      "expires_at": "2027-02-16T10:24:00Z",
                      "created_at": "2026-11-18T10:24:00Z",
                      "last_used_at": "2026-11-18T11:02:13Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "x-response-order": [
          "200",
          "401"
        ]
      }
    },
    "/v1/api-keys/{uid}": {
      "delete": {
        "operationId": "revokeApiKey",
        "summary": "Revoke an API key",
        "x-slug": "revoke-an-api-key",
        "description": "Revokes the key immediately. Requests using it are rejected with `401` from then on.",
        "tags": [
          "API Keys"
        ],
        "parameters": [
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "The key's `uid`.",
            "schema": {
              "type": "string",
              "example": "7c1e2f9a-4b3d-4e8f-9a1b-2c3d4e5f6a7b"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The key was revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "api key revoked"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "404"
        ]
      }
    },
    "/v1/ssh-keys": {
      "post": {
        "operationId": "createSshKey",
        "summary": "Add an SSH key",
        "x-slug": "add-an-ssh-key",
        "description": "Adds an SSH public key to your account and to the workspace. The key must be a single line in\nOpenSSH `authorized_keys` format, such as the contents of `~/.ssh/id_ed25519.pub`.\n\nNames and keys are unique per account, across all your workspaces: you cannot add two keys\nwith the same name, or the same key twice.\n\nRequires the owner, admin or developer role. Viewers get `403`.\n",
        "tags": [
          "SSH Keys"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "public_key"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Label for the key. Leading and trailing spaces are trimmed. Must be unique among your keys.",
                    "example": "laptop"
                  },
                  "public_key": {
                    "type": "string",
                    "description": "The public key in OpenSSH `authorized_keys` format (`<type> <base64> [comment]`). Leading and trailing whitespace is trimmed.",
                    "example": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q ada@laptop"
                  }
                }
              },
              "example": {
                "name": "laptop",
                "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q ada@laptop"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The key was added.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/SshKey"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ssh key created",
                  "data": {
                    "uid": "019a7b10-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                    "name": "laptop",
                    "fingerprint": "SHA256:q3Jk9m2c6yVt1bW8xZ0pLr4sN7uE5aH2gD1fK8jQ0oM",
                    "created_at": "2026-11-18T10:24:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request` (malformed JSON, or `name` or `public_key` missing or\nempty), `name and public_key are required` (a field is only whitespace),\n`invalid ssh public key`, `an ssh key with this name already exists`, or\n`this ssh key has already been added to your account`. A missing `X-Workspace-Slug`\nheader returns `workspace is required`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "an ssh key with this name already exists",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403"
        ]
      },
      "get": {
        "operationId": "listSshKeys",
        "summary": "List SSH keys",
        "x-slug": "list-ssh-keys",
        "description": "Returns the SSH keys you can use in this workspace, newest first: every key you added (in any\nworkspace) plus every key other members added to this workspace. Deleted keys are not listed.\n\nAny workspace role can call this.\n",
        "tags": [
          "SSH Keys"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The SSH keys usable in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SshKey"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a7b10-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                      "name": "laptop",
                      "fingerprint": "SHA256:q3Jk9m2c6yVt1bW8xZ0pLr4sN7uE5aH2gD1fK8jQ0oM",
                      "created_at": "2026-11-18T10:24:00Z"
                    },
                    {
                      "uid": "0199f3a0-6b7c-7d8e-9f0a-1b2c3d4e5f60",
                      "name": "ci-runner",
                      "fingerprint": "SHA256:Zx8nP1qL4vR7tY0wB3eH6kM9cF2jS5uA8dG1oN4iT7E",
                      "created_at": "2026-09-21T16:40:12Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      }
    },
    "/v1/ssh-keys/{uid}": {
      "delete": {
        "operationId": "deleteSshKey",
        "summary": "Delete an SSH key",
        "x-slug": "delete-an-ssh-key",
        "description": "Deletes an SSH key.\n\n- Your own keys can be deleted from any workspace you have the developer role or higher in,\n  including keys you added in another workspace.\n- A key another member added can only be deleted by an owner or admin of the workspace it\n  was added in, and only through that workspace. Otherwise the call returns `403`\n  (`you can only delete your own ssh keys`).\n\nDeleting a key only removes it from RumptyCloud, so it can no longer be chosen for new VMs.\nThis endpoint does not change VMs that already have the key installed.\n\nRequires the owner, admin or developer role. Viewers get `403`.\n",
        "tags": [
          "SSH Keys"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "The key's `uid`.",
            "schema": {
              "type": "string",
              "example": "019a7b10-2c3d-7e4f-8a9b-0c1d2e3f4a5b"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The key was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "ssh key deleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your role cannot delete keys, or the key belongs to another member and you are not an owner or admin of this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "you can only delete your own ssh keys",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "description": "No key with this `uid` is usable in this workspace (`ssh key not found`): it is neither yours nor added to this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "ssh key not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/plans": {
      "get": {
        "operationId": "listPlans",
        "summary": "List plans",
        "x-slug": "list-plans",
        "description": "Returns the compute plans you can create a VM on, cheapest first. Only plans that are\ncurrently available are listed.\n\nThis endpoint is public and needs no API key or workspace.\n",
        "tags": [
          "Virtual Machines"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The available compute plans.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Plan"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "0199e0a1-3c2d-7e4f-8a9b-1c2d3e4f5a6b",
                      "name": "Small",
                      "slug": "small",
                      "kind": "persistent",
                      "product": "compute",
                      "zone_slug": "olas-closet",
                      "vcpu": 1,
                      "memory_mib": 2048,
                      "included_disk_gib": 20,
                      "included_egress_gib": 100,
                      "network_ingress_mbit": 100,
                      "network_egress_mbit": 100,
                      "monthly_price_cents": 1020,
                      "hourly_price_cents": 2,
                      "hourly_price_micros": 13973,
                      "currency": "USD",
                      "free_allowance_count": 0,
                      "ephemeral_eligible": false,
                      "default_runtime_mins": 0,
                      "available": true
                    }
                  ]
                }
              }
            }
          }
        },
        "x-response-order": [
          "200"
        ]
      }
    },
    "/v1/images": {
      "get": {
        "operationId": "listImages",
        "summary": "List images",
        "x-slug": "list-images",
        "description": "Returns the enabled operating system images you can create a VM from, grouped by family.\nDatabase engine images are not included.\n\nThis endpoint is public and needs no API key or workspace.\n",
        "tags": [
          "Virtual Machines"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The available VM images.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Image"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "0199e0a2-1b2c-7d3e-9f40-5a6b7c8d9e0f",
                      "name": "Ubuntu 24.04 LTS",
                      "slug": "ubuntu-24-04",
                      "family": "ubuntu",
                      "version": "24.04",
                      "architecture": "amd64",
                      "enabled": true,
                      "desktop": false,
                      "created_at": "2026-01-12T09:00:00Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "x-response-order": [
          "200"
        ]
      }
    },
    "/v1/zones": {
      "get": {
        "operationId": "listZones",
        "summary": "List zones",
        "x-slug": "list-zones",
        "description": "Returns the zones VMs can run in. There is currently one zone, `olas-closet`, which is also\nthe default when you create a VM without a `zone_slug`.\n\nThis endpoint is public and needs no API key or workspace.\n",
        "tags": [
          "Virtual Machines"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The available zones.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Zone"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "name": "Ola's Closet",
                      "slug": "olas-closet",
                      "status": "available",
                      "description": "RumptyCloud's first compute zone.",
                      "default": true
                    }
                  ]
                }
              }
            }
          }
        },
        "x-response-order": [
          "200"
        ]
      }
    },
    "/v1/vms": {
      "get": {
        "operationId": "listVms",
        "summary": "List VMs",
        "x-slug": "list-vms",
        "description": "Returns the workspace's VMs, newest first. Deleted VMs are not included.\n\nWithout query parameters, every VM is returned in `data`. Send `page` or `page_size` to\npaginate. A top-level `pagination` object is then added next to `data`, and `q` filters the\nresults. `q` is ignored unless `page` or `page_size` is present.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1. Values below 1 (or non-numbers) are treated as `1`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Items per page. Defaults to `10`. Values above `100` are capped at `100`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "example": 20
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search across the VM's name, slug, private IP, app hostname, status and display status. Only applied when paginating.",
            "schema": {
              "type": "string",
              "example": "web"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's VMs. `pagination` is only present when `page` or `page_size` was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Vm"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/VmPagination"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "name": "web-1",
                      "slug": "web-1",
                      "kind": "persistent",
                      "status": "running",
                      "desired_status": "running",
                      "actual_status": "running",
                      "display_status": "running",
                      "plan_slug": "small",
                      "vcpu": 1,
                      "memory_mib": 2048,
                      "image_slug": "ubuntu-24-04",
                      "image_name": "Ubuntu 24.04 LTS",
                      "zone_slug": "olas-closet",
                      "private_ip": "10.16.4.23",
                      "guest_username": "root",
                      "disk_gib": 20,
                      "app_name": "brave-otter-6b8d90",
                      "app_hostname": "brave-otter-6b8d90.rumptycloud.app",
                      "app_url": "https://brave-otter-6b8d90.rumptycloud.app",
                      "app_port": 8080,
                      "usage": {
                        "total_bytes": 21474836480,
                        "used_bytes": 4294967296,
                        "available_bytes": 17179869184,
                        "used_percent": 20,
                        "sampled_at": "2026-11-18T10:29:30Z",
                        "stale": false
                      },
                      "ssh_keys": [
                        {
                          "uid": "019a7b10-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                          "name": "laptop",
                          "fingerprint": "SHA256:q3Jk9m2c6yVt1bW8xZ0pLr4sN7uE5aH2gD1fK8jQ0oM",
                          "created_at": "2026-10-02T14:11:05Z"
                        }
                      ],
                      "created_at": "2026-11-18T10:24:00Z"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 20,
                    "total": 1,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      },
      "post": {
        "operationId": "createVm",
        "summary": "Create a VM",
        "x-slug": "create-a-vm",
        "description": "Queues a new VM and returns `202 Accepted` with the `operation_id` of the create operation.\nThe VM starts in `provisioning`. Poll [Get an operation](/api/operations/get-an-operation)\nor [Get a VM](/api/virtual-machines/get-a-vm) to see when it is `running`.\n\n`X-Idempotency` is optional but recommended. If you repeat a request with the same key and\nthe same `name`, you get the original operation back with `200 OK` and\n`X-Idempotency-Replay: true`, and nothing new is queued. The replay check runs after the\nbasic field checks (required fields, SSH keys, zone) but before the billing, plan, image,\nquota and name checks, so a retry after the VM was created still returns the original\noperation.\nReusing the key with a different `name` returns `409` with `action: idempotency_key_reused`.\nWithout a key, every request queues a new VM.\n\nThings to know:\n\n- You must accept the acceptable use policy before creating your first VM. Until then this\n  endpoint returns `428` with `action: accept_acceptable_use_policy`.\n- Provide `image_slug`, or `snapshot_uid` to create the VM from a snapshot. A VM created from\n  a snapshot uses the snapshot's image and login user and is always persistent.\n- New VMs from an image log in as `root`.\n- If the plan is ephemeral-eligible, the VM is ephemeral even when `ephemeral` is `false`.\n  Ephemeral VMs expire after the plan's `default_runtime_mins` (72 hours if the plan sets\n  none). Each account can have one active ephemeral VM.\n- Desktop images need a plan with at least 2 vCPU and 2048 MiB of memory.\n- The VM gets an HTTPS app URL that forwards to port `8080` by default. Change it with\n  [Set the VM app port](/api/virtual-machines/set-the-vm-app-port).\n- VM names must be unique in the workspace. Uniqueness is checked on the slug of the name,\n  so `Web 1` and `web-1` clash.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "plan_slug",
                  "vpc_slug",
                  "ssh_key_uids"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name of the VM. Leading and trailing spaces are trimmed. Its slug must be unique among the workspace's VMs.",
                    "example": "web-1"
                  },
                  "plan_slug": {
                    "type": "string",
                    "description": "Slug of a compute plan from [List plans](/api/virtual-machines/list-plans). Case-insensitive.",
                    "example": "small"
                  },
                  "image_slug": {
                    "type": "string",
                    "description": "Slug of an image from [List images](/api/virtual-machines/list-images). Required unless `snapshot_uid` is set, and ignored when it is.",
                    "example": "ubuntu-24-04"
                  },
                  "vpc_slug": {
                    "type": "string",
                    "description": "Slug of the VPC to attach the VM to. Use `default` for the platform's default private network.",
                    "example": "default"
                  },
                  "zone_slug": {
                    "type": "string",
                    "description": "Zone to run the VM in. Defaults to `olas-closet`, currently the only zone.",
                    "default": "olas-closet",
                    "example": "olas-closet"
                  },
                  "ssh_key_uids": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string"
                    },
                    "description": "UIDs of SSH keys to install on the VM. At least one is required. Each key must be yours or belong to the workspace.",
                    "example": [
                      "019a7b10-2c3d-7e4f-8a9b-0c1d2e3f4a5b"
                    ]
                  },
                  "ephemeral": {
                    "type": "boolean",
                    "default": false,
                    "description": "Request a short-lived ephemeral VM. Only allowed on ephemeral-eligible plans. On those plans the VM is ephemeral whatever you send. Ignored when `snapshot_uid` is set."
                  },
                  "snapshot_uid": {
                    "type": "string",
                    "description": "UID of an `available` snapshot in this workspace to create the VM from. When set, `image_slug` is not needed.",
                    "example": "019a9012-4b5c-7d6e-8f90-a1b2c3d4e5f6"
                  },
                  "startup_script": {
                    "type": "string",
                    "description": "Optional shell script to run on the VM's first boot.",
                    "example": "#!/bin/bash\napt-get update && apt-get install -y nginx\n"
                  }
                }
              },
              "example": {
                "name": "web-1",
                "plan_slug": "small",
                "image_slug": "ubuntu-24-04",
                "vpc_slug": "default",
                "ssh_key_uids": [
                  "019a7b10-2c3d-7e4f-8a9b-0c1d2e3f4a5b"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replay. The `X-Idempotency` key was already used to create a VM with this name, so the existing operation is returned and nothing is queued. `status` is the operation's current status and `vm_status` the VM's current status (`deleted` once the VM is gone).",
            "headers": {
              "X-Idempotency-Replay": {
                "description": "Always `true` on a replay.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              },
              "X-Idempotency-Completed": {
                "description": "`true` when the original operation has already finished.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmCreateResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "existing operation still in progress; not queued again",
                  "data": {
                    "operation_id": "019a8f2c-7d43-7c11-8a2b-5f6e7d8c9b01",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "status": "running",
                    "vm_status": "provisioning",
                    "events_url": "/v1/operations/019a8f2c-7d43-7c11-8a2b-5f6e7d8c9b01/events",
                    "is_replay": true,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "202": {
            "description": "The create operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmCreateResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm create request queued",
                  "data": {
                    "operation_id": "019a8f2c-7d43-7c11-8a2b-5f6e7d8c9b01",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "status": "queued",
                    "vm_status": "provisioning",
                    "events_url": "/v1/operations/019a8f2c-7d43-7c11-8a2b-5f6e7d8c9b01/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages: `invalid request` (malformed JSON),\n`name, plan_slug, and vpc_slug are required`, `image_slug is required`,\n`at least one ssh key is required`, `invalid zone`, `invalid compute plan`,\n`this compute plan is not available`, `invalid image`, `invalid snapshot`,\n`snapshot source image is unavailable`,\n`selected plan is not eligible for ephemeral compute`, `invalid ssh key`, `invalid vpc`,\nor the desktop plan-size message.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "at least one ssh key is required",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account is past due and cannot create new paid resources.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "Your account is past due. Add funds to your wallet to create new paid resources.",
                  "code": 402,
                  "action": "past_due"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Conflict: `A VM with this name already exists.`, `ephemeral compute limit reached`,\n`snapshot is not ready to restore`, or the `X-Idempotency` key was already used for a\ndifferent operation (`action: idempotency_key_reused`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "A VM with this name already exists.",
                  "code": 409
                }
              }
            }
          },
          "428": {
            "description": "You have not accepted the acceptable use policy yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "acceptable use policy acceptance is required before creating a virtual machine",
                  "action": "accept_acceptable_use_policy"
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "409",
          "428"
        ]
      }
    },
    "/v1/vms/summary": {
      "get": {
        "operationId": "getVmSummary",
        "summary": "Get VM summary",
        "x-slug": "get-vm-summary",
        "description": "Returns VM counts for the workspace. VMs that are deleting or deleted are not counted.\n`stopped_vms` is every counted VM that is not `running`, so it includes VMs that are\nprovisioning or failed.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "VM counts for the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmSummary"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "total_vms": 3,
                    "running_vms": 2,
                    "stopped_vms": 1
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      }
    },
    "/v1/vms/{uid}": {
      "get": {
        "operationId": "getVm",
        "summary": "Get a VM",
        "x-slug": "get-a-vm",
        "description": "Returns one VM, including its plan, image, app URL, SSH keys and the latest root disk usage reported by the guest agent.",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The VM.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Vm"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "slug": "web-1",
                    "kind": "persistent",
                    "status": "running",
                    "desired_status": "running",
                    "actual_status": "running",
                    "display_status": "running",
                    "plan_slug": "small",
                    "vcpu": 1,
                    "memory_mib": 2048,
                    "image_slug": "ubuntu-24-04",
                    "image_name": "Ubuntu 24.04 LTS",
                    "zone_slug": "olas-closet",
                    "private_ip": "10.16.4.23",
                    "guest_username": "root",
                    "disk_gib": 20,
                    "app_name": "brave-otter-6b8d90",
                    "app_hostname": "brave-otter-6b8d90.rumptycloud.app",
                    "app_url": "https://brave-otter-6b8d90.rumptycloud.app",
                    "app_port": 8080,
                    "ssh_keys": [
                      {
                        "uid": "019a7b10-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                        "name": "laptop",
                        "fingerprint": "SHA256:q3Jk9m2c6yVt1bW8xZ0pLr4sN7uE5aH2gD1fK8jQ0oM",
                        "created_at": "2026-10-02T14:11:05Z"
                      }
                    ],
                    "created_at": "2026-11-18T10:24:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "deleteVm",
        "summary": "Delete a VM",
        "x-slug": "delete-a-vm",
        "description": "Queues deletion of the VM. The VM moves to `deleting` straight away and disappears from\nlistings once the operation finishes. Snapshots of the VM are kept. Find them with\n[List snapshots](/api/snapshots/list-snapshots).\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key returns the original operation with `200`, even\nafter the VM has been deleted.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/VmOperationReplay"
          },
          "202": {
            "description": "The delete operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm operation queued",
                  "data": {
                    "operation_id": "019a8f71-2b3c-7d4e-8f5a-6b7c8d9e0f12",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "action": "delete",
                    "status": "queued",
                    "vm_status": "deleting",
                    "events_url": "/v1/operations/019a8f71-2b3c-7d4e-8f5a-6b7c8d9e0f12/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The VM is already deleting or deleted (`vm is not available for this action`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm is not available for this action",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/start": {
      "post": {
        "operationId": "startVm",
        "summary": "Start a VM",
        "x-slug": "start-a-vm",
        "description": "Queues a start of a stopped VM. The VM shows `provisioning` until it is running again.\n\nAccounts that are past due, suspended or terminated cannot start VMs and get `402`. VMs\nthat were stopped because the account was suspended for non-payment are started again\nautomatically once the account is back in good standing.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key returns the original operation with `200`, even\nif the VM is already running by then. The replay is checked before billing, so a retry\nstill gets the original operation after the account became past due.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/VmOperationReplay"
          },
          "202": {
            "description": "The start operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm operation queued",
                  "data": {
                    "operation_id": "019a8f3e-1a22-7f04-b6d1-0c9e8a7f6d52",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "action": "start",
                    "status": "queued",
                    "vm_status": "provisioning",
                    "events_url": "/v1/operations/019a8f3e-1a22-7f04-b6d1-0c9e8a7f6d52/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The account is past due, suspended or terminated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "Your account is past due. Add funds to your wallet to create new paid resources.",
                  "code": 402,
                  "action": "past_due"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The VM is already running (`vm is already running`), is deleting or deleted (`vm is not available for this action`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm is already running",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/stop": {
      "post": {
        "operationId": "stopVm",
        "summary": "Stop a VM",
        "x-slug": "stop-a-vm",
        "description": "Queues a stop. The VM's status changes to `stopped` as soon as the request is accepted.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key returns the original operation with `200`, even\nthough the VM is already `stopped`. Without a key, a second stop returns `409`\n(`vm is already stopped`).\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/VmOperationReplay"
          },
          "202": {
            "description": "The stop operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm operation queued",
                  "data": {
                    "operation_id": "019a8f40-5c6d-7e8f-9a0b-1c2d3e4f5a60",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "action": "stop",
                    "status": "queued",
                    "vm_status": "stopped",
                    "events_url": "/v1/operations/019a8f40-5c6d-7e8f-9a0b-1c2d3e4f5a60/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The VM is already stopped (`vm is already stopped`), is deleting or deleted (`vm is not available for this action`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm is already stopped",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/reboot": {
      "post": {
        "operationId": "rebootVm",
        "summary": "Reboot a VM",
        "x-slug": "reboot-a-vm",
        "description": "Queues a reboot. The VM shows `provisioning` until it is running again.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key returns the original operation with `200`.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/VmOperationReplay"
          },
          "202": {
            "description": "The reboot operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm operation queued",
                  "data": {
                    "operation_id": "019a8f42-6d7e-7f80-9a1b-2c3d4e5f6a71",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "action": "reboot",
                    "status": "queued",
                    "vm_status": "provisioning",
                    "events_url": "/v1/operations/019a8f42-6d7e-7f80-9a1b-2c3d4e5f6a71/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The VM is deleting or deleted (`vm is not available for this action`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm is not available for this action",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/resize": {
      "post": {
        "operationId": "resizeVm",
        "summary": "Resize a VM",
        "x-slug": "resize-a-vm",
        "description": "Moves the VM to a different compute plan. Billing switches to the new plan's rate right\naway (usage so far is settled at the old rate first).\n\n- A **running** VM is restarted so the new CPU and memory take effect. It shows\n  `provisioning` until it is back.\n- A **stopped** VM gets the new resources on its next start.\n- The root disk can only grow. Moving to a plan with a larger included disk expands it.\n  Plans whose included disk is smaller than the VM's current disk are rejected.\n- Ephemeral VMs can only move between ephemeral-eligible plans, and persistent VMs between\n  persistent plans.\n- VMs on a desktop image need a plan with at least 2 vCPU and 2048 MiB of memory.\n\nThe VM must be `running` or `stopped`. This is asynchronous. It returns `202 Accepted` with\nan `operation_id`. See [Get an operation](/api/operations/get-an-operation). Send an\n`X-Idempotency` key to make retries safe: a retry with the same key returns the original\noperation with `200`, even after the resize has finished. The same key with a different\n`plan_slug` returns `409` with `action: idempotency_key_reused`.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "plan_slug"
                ],
                "properties": {
                  "plan_slug": {
                    "type": "string",
                    "description": "Slug of the available compute plan to move to. Case-insensitive. Must differ from the current plan.",
                    "example": "medium"
                  }
                }
              },
              "example": {
                "plan_slug": "medium"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/VmOperationReplay"
          },
          "202": {
            "description": "The resize operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm resize queued",
                  "data": {
                    "operation_id": "019a8f45-7e8f-7a90-8b1c-3d4e5f6a7b82",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "action": "resize",
                    "status": "queued",
                    "vm_status": "provisioning",
                    "events_url": "/v1/operations/019a8f45-7e8f-7a90-8b1c-3d4e5f6a7b82/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request`, `plan_slug is required`, `invalid compute plan`,\n`this compute plan is not available`, `this plan is not available for this VM type`,\n`This VM is already on the <plan> plan.`, the disk-size message, or the desktop\nplan-size message.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "This VM is already on the Small plan.",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The VM is not `running` or `stopped` (`vm is not available for this action`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm is not available for this action",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/metrics/current": {
      "get": {
        "operationId": "getVmCurrentMetrics",
        "summary": "Get current VM metrics",
        "x-slug": "get-current-vm-metrics",
        "description": "Returns the latest CPU, memory, disk and network sample reported by the guest agent.\n\nIf no sample has arrived yet, `available` is `false`, the metric fields are left out and\n`unavailable_reason` explains why. `stale` is `true` when the latest sample is more than two\nminutes old.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The latest metrics sample.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmMetricsCurrent"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "available": true,
                    "stale": false,
                    "cpu_percent": 12.5,
                    "memory_percent": 41.2,
                    "disk_percent": 20.1,
                    "network_rx_bytes": 184467201,
                    "network_tx_bytes": 52310944,
                    "sampled_at": "2026-11-18T10:29:45Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/vms/{uid}/metrics/history": {
      "get": {
        "operationId": "getVmMetricHistory",
        "summary": "Get VM metric history",
        "x-slug": "get-vm-metric-history",
        "description": "Returns a time series of the VM's metrics over a time range. The step between points\ndepends on the range:\n\n| `range` | `step_seconds` |\n| ------- | -------------- |\n| `15m`   | 15             |\n| `1h`    | 60             |\n| `6h`    | 300            |\n| `24h`   | 900            |\n| `7d`    | 3600           |\n| `30d`   | 21600          |\n\nIf no samples exist in the range, `available` is `false` and `points` is empty.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Time window to return, ending now. Case-insensitive.",
            "schema": {
              "type": "string",
              "enum": [
                "15m",
                "1h",
                "6h",
                "24h",
                "7d",
                "30d"
              ],
              "default": "1h",
              "example": "24h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The metric history.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmMetricsHistory"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "available": true,
                    "stale": false,
                    "range": "1h",
                    "step_seconds": 60,
                    "latest": {
                      "timestamp": "2026-11-18T10:29:00Z",
                      "cpu_percent": 12.5,
                      "memory_percent": 41.2,
                      "disk_percent": 20.1,
                      "network_rx_bytes": 184467201,
                      "network_tx_bytes": 52310944
                    },
                    "points": [
                      {
                        "timestamp": "2026-11-18T10:28:00Z",
                        "cpu_percent": 10.8,
                        "memory_percent": 41,
                        "disk_percent": 20.1,
                        "network_rx_bytes": 184120044,
                        "network_tx_bytes": 52299310
                      },
                      {
                        "timestamp": "2026-11-18T10:29:00Z",
                        "cpu_percent": 12.5,
                        "memory_percent": 41.2,
                        "disk_percent": 20.1,
                        "network_rx_bytes": 184467201,
                        "network_tx_bytes": 52310944
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "`range` is not one of the allowed values (`invalid metrics range`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invalid metrics range",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/vms/{uid}/firewall-policies": {
      "get": {
        "operationId": "listVmFirewallPolicies",
        "summary": "List a VM's firewall policies",
        "x-slug": "list-a-vms-firewall-policies",
        "description": "Returns the firewall policies attached to the VM, with their rules and every resource each\npolicy is attached to. Returns an empty list when no policy is attached. To attach or detach a\npolicy, use [Attach a firewall policy](/api/firewall-policies/attach-a-firewall-policy).\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The attached firewall policies.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FirewallPolicy"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/vms/{uid}/domains": {
      "get": {
        "operationId": "listCustomDomains",
        "summary": "List custom domains",
        "x-slug": "list-custom-domains",
        "description": "Returns the custom domains attached to the VM, with their verification status.",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The VM's custom domains.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CustomDomain"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a8f50-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "vm_app_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "domain_name": "app.acme.com",
                      "status": "active",
                      "verification_txt": "rumpty-verification-019a8f50",
                      "created_at": "2026-11-18T11:05:00Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "post": {
        "operationId": "addCustomDomain",
        "summary": "Add a custom domain",
        "x-slug": "add-a-custom-domain",
        "description": "Registers a custom domain for the VM's app URL. The domain starts as `pending`. Nothing is\nrouted until you verify it.\n\nTo verify, create two DNS records at your DNS provider, then call\n[Verify a custom domain](/api/virtual-machines/verify-a-custom-domain):\n\n- A `CNAME` record for the domain pointing to the VM's `app_hostname`.\n- A `TXT` record at `rumpty-challenge.<domain_name>` whose value is the returned\n  `verification_txt`.\n\nRoot (apex) domains such as `acme.com` are not supported yet. Use a subdomain such as\n`www.acme.com`. A domain can only be registered once across RumptyCloud.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain_name"
                ],
                "properties": {
                  "domain_name": {
                    "type": "string",
                    "description": "Fully qualified subdomain to attach. Lowercased and trimmed. Must contain only letters, digits, hyphens and dots, and end in a TLD of at least two letters.",
                    "example": "app.acme.com"
                  }
                }
              },
              "example": {
                "domain_name": "app.acme.com"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The domain was added in `pending` state.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/CustomDomain"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "custom domain added",
                  "data": {
                    "uid": "019a8f50-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "vm_app_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "domain_name": "app.acme.com",
                    "status": "pending",
                    "verification_txt": "rumpty-verification-019a8f50",
                    "created_at": "2026-11-18T11:05:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request`, `domain name is required`, `invalid domain name format`, or the domain is a root domain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "root domains are not supported yet; use a subdomain such as www.acme.com",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The domain is already registered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "domain name is already registered",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/domains/{domain_uid}": {
      "delete": {
        "operationId": "deleteCustomDomain",
        "summary": "Delete a custom domain",
        "x-slug": "delete-a-custom-domain",
        "description": "Removes the custom domain. It disappears from\n[List custom domains](/api/virtual-machines/list-custom-domains) immediately. Its route\nis torn down by an `unexpose` operation.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key returns the original operation with `200`, even\nthough the domain is already gone. Without a key, a retry returns `404`\n(`custom domain not found`).\n\nThe key is tied to the domain: reusing it for another domain returns `409` with\n`action: idempotency_key_reused`.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/CustomDomainUid"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CustomDomainOperationReplay"
          },
          "202": {
            "description": "The domain was removed and the route teardown was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/CustomDomainOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "custom domain deletion queued",
                  "data": {
                    "operation_id": "019a8f58-1f2a-7b3c-8d4e-5f6a7b8c9d0e",
                    "status": "queued",
                    "events_url": "/v1/operations/019a8f58-1f2a-7b3c-8d4e-5f6a7b8c9d0e/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/VmIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/domains/{domain_uid}/verify": {
      "post": {
        "operationId": "verifyCustomDomain",
        "summary": "Verify a custom domain",
        "x-slug": "verify-a-custom-domain",
        "description": "Checks the domain's DNS records against its authoritative nameserver and, if they match,\nqueues an `expose` operation that issues a TLS certificate and routes the domain to the\nVM's app port. The domain stays `pending` until that operation finishes and becomes\n`active`.\n\nThe `CNAME` must point to the VM's `app_hostname`, and the `TXT` record at\n`rumpty-challenge.<domain_name>` must equal `verification_txt`. If either check fails,\nthe domain is marked `failed` with the reason in `last_error`, and the request returns\n`400` with the same message.\n\nCalling this again is safe:\n\n- If you resend an `X-Idempotency` key already used to verify a domain on this VM, that\n  operation is returned with `200` and `X-Idempotency-Replay: true`. Reusing the key for\n  another domain returns `409` with `action: idempotency_key_reused`.\n- If the domain is already `active`, you get `202` with `status: succeeded`, an empty\n  `operation_id` and `is_replay: false`, and nothing is queued.\n- If a verification queued in the last 15 minutes is still running, that operation is\n  returned with `202` and `is_replay: false` instead of a new one.\n\nOtherwise this is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation).\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/CustomDomainUid"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CustomDomainOperationReplay"
          },
          "202": {
            "description": "DNS checks passed and the expose operation was queued, or an existing result was returned.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/CustomDomainOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "custom domain verification and exposure queued",
                  "data": {
                    "operation_id": "019a8f55-0e1f-7a2b-9c3d-4e5f6a7b8c9d",
                    "status": "queued",
                    "events_url": "/v1/operations/019a8f55-0e1f-7a2b-9c3d-4e5f6a7b8c9d/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "DNS verification failed or the domain is a root domain. Example DNS messages: `CNAME record has not propagated or does not point to\n<app_hostname>`, `verification TXT record not found or does not match: <verification_txt>`,\n`unable to locate authoritative DNS nameservers for domain`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "CNAME record has not propagated or does not point to brave-otter-6b8d90.rumptycloud.app",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/VmIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/apps": {
      "get": {
        "operationId": "listVmApps",
        "summary": "List VM apps",
        "x-slug": "list-vm-apps",
        "description": "Returns the extra ports exposed on the VM over HTTPS, each with its own public URL.",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The VM's exposed apps.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/VmApp"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a8f61-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "name": "grafana",
                      "slug": "grafana",
                      "status": "ready",
                      "port": 3000,
                      "protocol": "http",
                      "hostname": "3000-brave-otter-6b8d90.rumptycloud.app",
                      "url": "https://3000-brave-otter-6b8d90.rumptycloud.app",
                      "created_at": "2026-11-18T11:20:00Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "post": {
        "operationId": "exposeVmApp",
        "summary": "Expose a VM app",
        "x-slug": "expose-a-vm-app",
        "description": "Publishes a port on the VM at its own HTTPS URL, `https://<port>-<vm-host-label>.<domain>`.\nThe app starts as `pending` and becomes `ready` once the route is live.\n\nEach VM can expose a given port once, and app names (after slugging) must be unique per VM.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key returns the original operation and its app with\n`200`, instead of `409` for the name or port that the first request already took.\n\nThe key is tied to the VM and the app name (or `port-<port>` when no name is given).\nReusing it on another VM or for another name returns `409` with\n`action: idempotency_key_reused`.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "port"
                ],
                "properties": {
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535,
                    "description": "Port on the VM that the app listens on.",
                    "example": 3000
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 40,
                    "description": "Name for the exposure. It is converted to a slug (lowercase letters, digits and hyphens), which must be 40 characters or fewer. Defaults to `port-<port>`.",
                    "example": "grafana"
                  },
                  "protocol": {
                    "type": "string",
                    "enum": [
                      "http",
                      "grpc"
                    ],
                    "default": "http",
                    "description": "Backend protocol. Use `grpc` for gRPC (HTTP/2) services."
                  }
                }
              },
              "example": {
                "port": 3000,
                "name": "grafana"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replay. The `X-Idempotency` key was already used to expose an app, so that operation is returned and nothing is queued. `app` is the app's current state. If the app has since been removed, `app` holds only its `uid`, `vm_uid` and `name`.",
            "headers": {
              "X-Idempotency-Replay": {
                "description": "Always `true` on a replay.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              },
              "X-Idempotency-Completed": {
                "description": "`true` when the original operation has already finished.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmAppOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "existing operation already finished; not queued again",
                  "data": {
                    "operation_id": "019a8f61-0a1c-7d3e-9f40-5b6c7d8e9f01",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "vm_name": "web-1",
                    "app": {
                      "uid": "019a8f61-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "name": "grafana",
                      "slug": "grafana",
                      "status": "ready",
                      "port": 3000,
                      "protocol": "http",
                      "hostname": "3000-brave-otter-6b8d90.rumptycloud.app",
                      "url": "https://3000-brave-otter-6b8d90.rumptycloud.app",
                      "created_at": "2026-11-18T11:20:00Z"
                    },
                    "status": "succeeded",
                    "events_url": "/v1/operations/019a8f61-0a1c-7d3e-9f40-5b6c7d8e9f01/events",
                    "is_replay": true,
                    "is_completed": true
                  }
                }
              }
            }
          },
          "202": {
            "description": "The expose operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmAppOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm app exposure queued",
                  "data": {
                    "operation_id": "019a8f61-0a1c-7d3e-9f40-5b6c7d8e9f01",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "vm_name": "web-1",
                    "app": {
                      "uid": "019a8f61-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "name": "grafana",
                      "slug": "grafana",
                      "status": "pending",
                      "port": 3000,
                      "protocol": "http",
                      "hostname": "3000-brave-otter-6b8d90.rumptycloud.app",
                      "url": "https://3000-brave-otter-6b8d90.rumptycloud.app",
                      "created_at": "2026-11-18T11:20:00Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a8f61-0a1c-7d3e-9f40-5b6c7d8e9f01/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request` (missing or zero `port`), `port must be between 1 and 65535`, `protocol must be http or grpc`, `name is invalid`, or `name must be 40 characters or fewer`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "protocol must be http or grpc",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Conflict: `app exposure name already exists for this vm`,\n`app exposure port already exists for this vm`, `vm is not available for app exposure`\n(VM deleting or deleted), `http access is not configured`, or the `X-Idempotency` key\nwas used for a different operation (`action: idempotency_key_reused`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "app exposure port already exists for this vm",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/apps/{app}": {
      "delete": {
        "operationId": "unexposeVmApp",
        "summary": "Unexpose a VM app",
        "x-slug": "unexpose-a-vm-app",
        "description": "Removes an exposed port's public URL. The app moves to `deleting` and is removed when the\noperation finishes. Only apps in `ready` or `failed` state can be removed. If the app is\nalready `deleting`, its in-flight operation is returned with `200` and `is_replay: true`.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key returns the original operation with `200`, even\nafter the app has been removed. The key is tied to the VM and the app: reusing it for\nanother app or VM returns `409` with `action: idempotency_key_reused`.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "name": "app",
            "in": "path",
            "required": true,
            "description": "The app's `slug` (its name is also accepted and converted to a slug).",
            "schema": {
              "type": "string",
              "example": "grafana"
            }
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Replay. The `X-Idempotency` key was already used to unexpose this app, or the app is already being removed, so the existing operation is returned and nothing is queued. If the app is already gone, `app` holds only its `uid`, `vm_uid` and `name`.",
            "headers": {
              "X-Idempotency-Replay": {
                "description": "Always `true` on a replay.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              },
              "X-Idempotency-Completed": {
                "description": "`true` when the original operation has already finished.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmAppOperationResult"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "The unexpose operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmAppOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm app unexposure queued",
                  "data": {
                    "operation_id": "019a8f66-3c4d-7e5f-8a6b-7c8d9e0f1a2b",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "vm_name": "web-1",
                    "app": {
                      "uid": "019a8f61-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "name": "grafana",
                      "slug": "grafana",
                      "status": "deleting",
                      "port": 3000,
                      "protocol": "http",
                      "hostname": "3000-brave-otter-6b8d90.rumptycloud.app",
                      "url": "https://3000-brave-otter-6b8d90.rumptycloud.app",
                      "created_at": "2026-11-18T11:20:00Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a8f66-3c4d-7e5f-8a6b-7c8d9e0f1a2b/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Conflict: `app exposure is still being provisioned` (app is `pending`),\n`app exposure is already being removed`,\n`app exposure cannot be removed in its current state`,\n`vm is not available for this action`, or the `X-Idempotency` key was used for a\ndifferent operation (`action: idempotency_key_reused`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "app exposure is still being provisioned",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/app-port": {
      "put": {
        "operationId": "setVmAppPort",
        "summary": "Set the VM app port",
        "x-slug": "set-the-vm-app-port",
        "description": "Points the VM's own app URL (`app_url`) at a different port on the VM. The VM's `app_port`\nonly changes once the switch has finished, so it always shows the port being served.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key returns the original operation with `200`, even\nafter the port has switched. The same key with a different `port` returns `409` with\n`action: idempotency_key_reused`.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/VmIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "port"
                ],
                "properties": {
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535,
                    "description": "Port on the VM that the app URL should forward to. Must differ from the current `app_port`.",
                    "example": 3000
                  }
                }
              },
              "example": {
                "port": 3000
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/VmOperationReplay"
          },
          "202": {
            "description": "The port change was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm app port change queued",
                  "data": {
                    "operation_id": "019a8f68-4d5e-7f6a-9b7c-8d9e0f1a2b3c",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "action": "set_app_port",
                    "status": "queued",
                    "vm_status": "running",
                    "events_url": "/v1/operations/019a8f68-4d5e-7f6a-9b7c-8d9e0f1a2b3c/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request` (missing or zero `port`) or `port must be between 1 and 65535`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "port must be between 1 and 65535",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Conflict: `the app url already serves port <port>`, `this vm has no app url`,\n`vm is not available for this action` (VM deleting or deleted), or the `X-Idempotency`\nkey was used for a different operation (`action: idempotency_key_reused`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "the app url already serves port 3000",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/exec": {
      "post": {
        "operationId": "runVmCommand",
        "summary": "Run a command on a VM",
        "x-slug": "run-a-command-on-a-vm",
        "description": "Runs one non-interactive command on a running VM over SSH and waits for it to finish. The\ncommand runs as `bash -lc '<command>'`.\n\n- Command execution through the API is **off by default**. A workspace owner or admin must\n  turn it on in workspace settings, otherwise this returns `403`.\n- Requires the `runtime connect` permission (owner, admin or developer role).\n- The command times out after 30 seconds by default, or `timeout_seconds` (max 60).\n- `stdout` and `stderr` are each capped at 64 KiB. Truncation is flagged in the response.\n- Each user can have at most 4 console sessions and commands open at once.\n- The first command on an older VM may return `409` while command access is set up. Retry\n  after about 30 seconds.\n\nA non-zero `exit_code` is still a `200` response. When the command times out, `timed_out`\nis `true` and `exit_code` is usually `124`, or `-1` if the VM never returned one.\n",
        "tags": [
          "Virtual Machines"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "command"
                ],
                "properties": {
                  "command": {
                    "type": "string",
                    "maxLength": 8192,
                    "description": "Shell command to run. Leading and trailing whitespace is trimmed. At most 8192 bytes.",
                    "example": "df -h /"
                  },
                  "timeout_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 60,
                    "default": 30,
                    "description": "Seconds to let the command run. Values above `60` are capped at `60`. `0` or omitted means `30`.",
                    "example": 20
                  }
                }
              },
              "example": {
                "command": "df -h /",
                "timeout_seconds": 20
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The command ran. Check `exit_code` to see whether it succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmExecResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "exit_code": 0,
                    "stdout": "Filesystem      Size  Used Avail Use% Mounted on\n/dev/vda1        20G  4.0G   16G  20% /\n",
                    "stderr": "",
                    "duration_ms": 184
                  }
                }
              }
            }
          },
          "400": {
            "description": "`command` is missing or empty (`command is required`), or longer than 8192 bytes (`command is too long`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "command is required",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your role cannot connect to VMs, or command execution is turned off for this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "running commands through the API is turned off for this workspace; a workspace owner or admin can turn it on in workspace settings",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The command could not be run right now: `vm is not running`,\n`vm network route is not ready`,\n`too many open console sessions or commands; try again shortly`,\n`enabling command access on this VM; retry in about 30 seconds`,\n`this VM can't accept commands yet; connect with SSH instead`, or\n`unable to reach the VM over SSH`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm is not running",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/snapshots": {
      "get": {
        "operationId": "listVmSnapshots",
        "summary": "List VM snapshots",
        "x-slug": "list-vm-snapshots",
        "description": "Returns the snapshots taken from this VM, newest first. Use [List snapshots](/api/snapshots/list-snapshots) to include snapshots whose source VM has been deleted.",
        "tags": [
          "Snapshots"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The VM's snapshots.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Snapshot"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9012-4b5c-7d6e-8f90-a1b2c3d4e5f6",
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "source_vm_name": "web-1",
                      "detached": false,
                      "name": "before-upgrade",
                      "slug": "before-upgrade",
                      "status": "available",
                      "consumed_bytes": 1073741824,
                      "created_at": "2026-11-18T12:00:00Z",
                      "updated_at": "2026-11-18T12:01:42Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "post": {
        "operationId": "createSnapshot",
        "summary": "Create a snapshot",
        "x-slug": "create-a-snapshot",
        "description": "Queues a snapshot of the VM's disk. The snapshot starts as `creating` and becomes\n`available` when it is ready. `consumed_bytes` is filled in then.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). The new snapshot's UID is the\noperation's `resource_uid`. In the response, `name` is the VM's name, not the snapshot's.\n\nSend an `X-Idempotency` key to make retries safe: a retry with the same key returns the\noriginal operation with `200` and nothing new is queued. The key is tied to the VM and\nthe snapshot `name`: reusing it for another VM or name returns `409` with\n`action: idempotency_key_reused`.\n",
        "tags": [
          "Snapshots"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/SnapshotIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "Name of the snapshot. Its slug is derived from it.",
                    "example": "before-upgrade"
                  },
                  "shutdown_before_snapshot": {
                    "type": "boolean",
                    "default": false,
                    "description": "Shut the VM down before taking the snapshot, for a consistent copy of a busy disk."
                  }
                }
              },
              "example": {
                "name": "before-upgrade",
                "shutdown_before_snapshot": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SnapshotOperationReplay"
          },
          "202": {
            "description": "The snapshot operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/SnapshotOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm snapshot creation request queued",
                  "data": {
                    "operation_id": "019a9012-4b5d-7e6f-8a01-b2c3d4e5f6a7",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "action": "vm_snapshot.create",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9012-4b5d-7e6f-8a01-b2c3d4e5f6a7/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "`name` is missing or longer than 100 characters (`invalid request payload`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invalid request payload"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The VM is deleting or deleted (`vm is not available for snapshots`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm is not available for snapshots",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/snapshots/{snapshot_uid}/restore": {
      "post": {
        "operationId": "restoreSnapshot",
        "summary": "Restore a snapshot",
        "x-slug": "restore-a-snapshot",
        "description": "Restores the VM from one of its own snapshots. The snapshot must be `available`. While\nthe restore runs, the snapshot shows `restoring` and the VM shows `provisioning`.\n\nTo start a new VM from a snapshot instead, pass `snapshot_uid` to\n[Create a VM](/api/virtual-machines/create-a-vm).\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key for the same snapshot returns the original\noperation with `200`, even after the restore has finished.\n",
        "tags": [
          "Snapshots"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/SnapshotUid"
          },
          {
            "$ref": "#/components/parameters/SnapshotIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SnapshotOperationReplay"
          },
          "202": {
            "description": "The restore operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/SnapshotOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm snapshot restore request queued",
                  "data": {
                    "operation_id": "019a9020-5c6d-7e7f-9a12-c3d4e5f6a7b8",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "action": "vm_snapshot.restore",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9020-5c6d-7e7f-9a12-c3d4e5f6a7b8/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The VM or snapshot does not exist, or the snapshot was not taken from this VM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The snapshot is not `available` (`snapshot is not in available state for restore`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot is not in available state for restore",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/vms/{uid}/snapshots/{snapshot_uid}": {
      "delete": {
        "operationId": "deleteVmSnapshot",
        "summary": "Delete a VM snapshot",
        "x-slug": "delete-a-vm-snapshot",
        "description": "Deletes one of the VM's snapshots. The snapshot shows `deleting` until the operation\nfinishes. To delete a snapshot whose VM no longer exists, use\n[Delete a snapshot](/api/snapshots/delete-a-snapshot).\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key for the same snapshot returns the original\noperation with `200`, even after the snapshot is gone.\n",
        "tags": [
          "Snapshots"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VmUid"
          },
          {
            "$ref": "#/components/parameters/SnapshotUid"
          },
          {
            "$ref": "#/components/parameters/SnapshotIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SnapshotOperationReplay"
          },
          "202": {
            "description": "The delete operation was queued. `name` is the VM's name.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/SnapshotOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm snapshot deletion request queued",
                  "data": {
                    "operation_id": "019a9031-6d7e-7f80-8b23-d4e5f6a7b8c9",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "name": "web-1",
                    "action": "vm_snapshot.delete",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9031-6d7e-7f80-8b23-d4e5f6a7b8c9/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The VM or snapshot does not exist, or the snapshot was not taken from this VM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The snapshot is already being deleted (`snapshot is already being deleted`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot is already being deleted",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/snapshots": {
      "get": {
        "operationId": "listSnapshots",
        "summary": "List snapshots",
        "x-slug": "list-snapshots",
        "description": "Returns every VM snapshot in the workspace, newest first. This includes detached\nsnapshots (`detached: true`) whose source VM has been deleted.\n",
        "tags": [
          "Snapshots"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's snapshots.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Snapshot"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9012-4b5c-7d6e-8f90-a1b2c3d4e5f6",
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "source_vm_name": "web-1",
                      "detached": false,
                      "name": "before-upgrade",
                      "slug": "before-upgrade",
                      "status": "available",
                      "consumed_bytes": 1073741824,
                      "created_at": "2026-11-18T12:00:00Z",
                      "updated_at": "2026-11-18T12:01:42Z"
                    },
                    {
                      "uid": "019a6d01-2a3b-7c4d-9e5f-6a7b8c9d0e1f",
                      "vm_uid": "019a6c00-1f2e-7d3c-8b4a-5c6d7e8f9a0b",
                      "source_vm_name": "old-api",
                      "detached": true,
                      "name": "final",
                      "slug": "final",
                      "status": "available",
                      "consumed_bytes": 3221225472,
                      "created_at": "2026-10-30T08:15:00Z",
                      "updated_at": "2026-11-02T17:40:11Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      }
    },
    "/v1/snapshots/{snapshot_uid}": {
      "get": {
        "operationId": "getSnapshot",
        "summary": "Get a snapshot",
        "x-slug": "get-a-snapshot",
        "description": "Returns one snapshot in the workspace, whether or not its source VM still exists.",
        "tags": [
          "Snapshots"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/SnapshotUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Snapshot"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9012-4b5c-7d6e-8f90-a1b2c3d4e5f6",
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "source_vm_name": "web-1",
                    "detached": false,
                    "name": "before-upgrade",
                    "slug": "before-upgrade",
                    "status": "available",
                    "consumed_bytes": 1073741824,
                    "created_at": "2026-11-18T12:00:00Z",
                    "updated_at": "2026-11-18T12:01:42Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "deleteSnapshot",
        "summary": "Delete a snapshot",
        "x-slug": "delete-a-snapshot",
        "description": "Deletes a snapshot by UID. Unlike [Delete a VM snapshot](/api/snapshots/delete-a-vm-snapshot),\nthis works for detached snapshots whose source VM has been deleted. The snapshot shows\n`deleting` until the operation finishes.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). Send an `X-Idempotency` key to make\nretries safe: a retry with the same key for the same snapshot returns the original\noperation with `200`, even after the snapshot is gone. On that replay `vm_uid` is empty.\n",
        "tags": [
          "Snapshots"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/SnapshotUid"
          },
          {
            "$ref": "#/components/parameters/SnapshotIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SnapshotOperationReplay"
          },
          "202": {
            "description": "The delete operation was queued. Here `name` is the snapshot's name and `vm_uid` is the source VM's UID.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/SnapshotOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "vm snapshot deletion request queued",
                  "data": {
                    "operation_id": "019a9040-7e8f-7a91-9c34-e5f6a7b8c9d0",
                    "vm_uid": "019a6c00-1f2e-7d3c-8b4a-5c6d7e8f9a0b",
                    "name": "final",
                    "action": "vm_snapshot.delete",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9040-7e8f-7a91-9c34-e5f6a7b8c9d0/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The snapshot is already being deleted (`snapshot is already being deleted`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot is already being deleted",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/operations": {
      "get": {
        "operationId": "listOperations",
        "summary": "List operations",
        "x-slug": "list-operations",
        "description": "Returns all operations in the workspace, newest first. This covers every resource type, not\nonly VMs, and is not paginated.\n",
        "tags": [
          "Operations"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's operations.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Operation"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a8f3e-1a22-7f04-b6d1-0c9e8a7f6d52",
                      "resource_type": "vm",
                      "resource_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "resource_name": "web-1",
                      "action": "start",
                      "status": "running",
                      "started_at": "2026-11-18T10:40:02Z",
                      "created_at": "2026-11-18T10:40:00Z",
                      "events_url": "/v1/operations/019a8f3e-1a22-7f04-b6d1-0c9e8a7f6d52/events"
                    },
                    {
                      "uid": "019a8f2c-7d43-7c11-8a2b-5f6e7d8c9b01",
                      "resource_type": "vm",
                      "resource_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "resource_name": "web-1",
                      "action": "create",
                      "status": "succeeded",
                      "started_at": "2026-11-18T10:24:01Z",
                      "finished_at": "2026-11-18T10:25:13Z",
                      "created_at": "2026-11-18T10:24:00Z",
                      "events_url": "/v1/operations/019a8f2c-7d43-7c11-8a2b-5f6e7d8c9b01/events"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403"
        ]
      }
    },
    "/v1/operations/{operation_id}": {
      "get": {
        "operationId": "getOperation",
        "summary": "Get an operation",
        "x-slug": "get-an-operation",
        "description": "Returns one operation. Poll this after any asynchronous action until `status` is\n`succeeded` or `failed`. `started_at` and `finished_at` appear once the operation has\nstarted and finished.\n",
        "tags": [
          "Operations"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "description": "The operation's `uid`, as returned in `operation_id` by the action that queued it.",
            "schema": {
              "type": "string",
              "example": "019a8f2c-7d43-7c11-8a2b-5f6e7d8c9b01"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The operation.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Operation"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a8f2c-7d43-7c11-8a2b-5f6e7d8c9b01",
                    "resource_type": "vm",
                    "resource_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "resource_name": "web-1",
                    "action": "create",
                    "status": "succeeded",
                    "started_at": "2026-11-18T10:24:01Z",
                    "finished_at": "2026-11-18T10:25:13Z",
                    "created_at": "2026-11-18T10:24:00Z",
                    "events_url": "/v1/operations/019a8f2c-7d43-7c11-8a2b-5f6e7d8c9b01/events"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/kubernetes/clusters": {
      "get": {
        "operationId": "listKubernetesClusters",
        "summary": "List clusters",
        "x-slug": "list-clusters",
        "description": "Returns the workspace's Kubernetes clusters, newest first, with their nodes. Deleted clusters\nare not included. This endpoint is not paginated.\n\nThe list never includes `kubeconfig` (and does not set `kubeconfig_restricted`). Use\n[Get a cluster](/api/kubernetes/get-a-cluster) to read it.\n",
        "tags": [
          "Kubernetes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's clusters.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/KubernetesCluster"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9a10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "name": "production",
                      "slug": "production",
                      "status": "running",
                      "display_status": "running",
                      "zone_slug": "olas-closet",
                      "version": "v1.36.2+k3s1",
                      "image_slug": "ubuntu-2404-lts",
                      "endpoint": "https://production-1c2d3e.k8s.rumptycloud.com:16443",
                      "nodes": [
                        {
                          "uid": "019a9a10-5c6e-7f01-8a2b-3c4d5e6f7a8b",
                          "name": "production-cp-1",
                          "role": "control-plane",
                          "status": "ready",
                          "plan_slug": "scale",
                          "vcpu": 2,
                          "memory_mib": 2048,
                          "disk_gib": 50,
                          "private_ip": "10.16.7.11",
                          "guest_username": "root"
                        },
                        {
                          "uid": "019a9a10-5c6f-7b2c-9d3e-4f5a6b7c8d9e",
                          "name": "production-worker-1",
                          "role": "worker",
                          "status": "ready",
                          "plan_slug": "launch",
                          "vcpu": 1,
                          "memory_mib": 512,
                          "disk_gib": 10,
                          "private_ip": "10.16.7.12",
                          "guest_username": "root"
                        }
                      ],
                      "created_at": "2026-11-18T10:24:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      },
      "post": {
        "operationId": "createKubernetesCluster",
        "summary": "Create a cluster",
        "x-slug": "create-a-cluster",
        "description": "Queues a new Kubernetes cluster and returns `202 Accepted` with the `operation_id` of the\ncreate operation. The cluster and its nodes start in `provisioning`. Poll\n[Get an operation](/api/operations/get-an-operation) or\n[Get a cluster](/api/kubernetes/get-a-cluster) until the cluster is `running`.\n\nEvery field except `name` is optional:\n\n| Field | Default |\n| --- | --- |\n| `version` | `v1.36.2+k3s1` |\n| `image_slug` | `ubuntu-2404-lts` |\n| `control_plane_plan_slug` | `scale` |\n| `worker_plan_slug` | `launch` |\n| `worker_count` | `1` |\n\nThings to know:\n\n- The cluster runs in the default zone, `olas-closet`.\n- Cluster names must be unique in the workspace. Uniqueness is checked on the slug of the\n  name, so `Production` and `production` clash.\n- Node names are derived from the cluster name: `<name>-cp-1` for the control plane and\n  `<name>-worker-1`, `<name>-worker-2` and so on for workers.\n- The API `endpoint` has the form\n  `https://<slug>-<id>.k8s.rumptycloud.com:16443`, where `<id>` is a short fragment of the\n  cluster's `uid`.\n- Compute plans must be available. An unavailable plan returns `400`\n  (`this compute plan is not available`).\n- Past-due and suspended accounts get `402`.\n- `X-Idempotency` is optional. A retry with a key you already used for a cluster create\n  returns the original operation with `200 OK`, `is_replay: true` and the\n  `X-Idempotency-Replay` header, and nothing new is queued. The replay is checked first\n  (before billing, validation and the name check), so a retry after the cluster was created\n  does not fail with `409` for the name. The same key with a different `name` returns\n  `409` with `action: idempotency_key_reused`. Without a key, a retry of a create that\n  already succeeded returns `409` because the name is taken.\n",
        "tags": [
          "Kubernetes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/KubernetesIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name of the cluster. Leading and trailing spaces are trimmed. Its slug must be unique among the workspace's clusters.",
                    "example": "production"
                  },
                  "version": {
                    "type": "string",
                    "description": "k3s version to install. The API passes it to the provisioner without validating it.",
                    "default": "v1.36.2+k3s1",
                    "example": "v1.36.2+k3s1"
                  },
                  "image_slug": {
                    "type": "string",
                    "description": "Slug of the node operating system image. Case-insensitive. Must be an enabled image from [List images](/api/virtual-machines/list-images), except the default `ubuntu-2404-lts`, which can be used even when it is hidden from the VM catalog.",
                    "default": "ubuntu-2404-lts",
                    "example": "ubuntu-2404-lts"
                  },
                  "control_plane_plan_slug": {
                    "type": "string",
                    "description": "Compute plan for the control-plane node. Case-insensitive. Must be a compute plan from [List plans](/api/virtual-machines/list-plans).",
                    "default": "scale",
                    "example": "scale"
                  },
                  "worker_plan_slug": {
                    "type": "string",
                    "description": "Compute plan for every worker node. Case-insensitive. Must be a compute plan from [List plans](/api/virtual-machines/list-plans).",
                    "default": "launch",
                    "example": "launch"
                  },
                  "worker_count": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3,
                    "default": 1,
                    "description": "Number of worker nodes. `0`, negative values or an omitted field mean `1`. Values above `3` are rejected.",
                    "example": 2
                  },
                  "ssh_key_uids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "UIDs of SSH keys to install on every node. Optional. Each key must be yours or belong to the workspace.",
                    "example": [
                      "019a7b10-2c3d-7e4f-8a9b-0c1d2e3f4a5b"
                    ]
                  }
                }
              },
              "example": {
                "name": "production",
                "control_plane_plan_slug": "scale",
                "worker_plan_slug": "launch",
                "worker_count": 2,
                "ssh_key_uids": [
                  "019a7b10-2c3d-7e4f-8a9b-0c1d2e3f4a5b"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/KubernetesClusterOperationReplay"
          },
          "202": {
            "description": "The create operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/KubernetesClusterOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "kubernetes cluster create request queued",
                  "data": {
                    "operation_id": "019a9a10-5c70-7a1b-8c2d-3e4f5a6b7c8d",
                    "cluster": {
                      "uid": "019a9a10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "name": "production",
                      "slug": "production",
                      "status": "provisioning",
                      "display_status": "provisioning",
                      "zone_slug": "olas-closet",
                      "version": "v1.36.2+k3s1",
                      "image_slug": "ubuntu-2404-lts",
                      "endpoint": "https://production-1c2d3e.k8s.rumptycloud.com:16443",
                      "nodes": [
                        {
                          "uid": "019a9a10-5c6e-7f01-8a2b-3c4d5e6f7a8b",
                          "name": "production-cp-1",
                          "role": "control-plane",
                          "status": "provisioning",
                          "plan_slug": "scale",
                          "vcpu": 2,
                          "memory_mib": 2048,
                          "disk_gib": 50,
                          "guest_username": "root"
                        },
                        {
                          "uid": "019a9a10-5c6f-7b2c-9d3e-4f5a6b7c8d9e",
                          "name": "production-worker-1",
                          "role": "worker",
                          "status": "provisioning",
                          "plan_slug": "launch",
                          "vcpu": 1,
                          "memory_mib": 512,
                          "disk_gib": 10,
                          "guest_username": "root"
                        },
                        {
                          "uid": "019a9a10-5c71-7c3d-8e4f-5a6b7c8d9e0f",
                          "name": "production-worker-2",
                          "role": "worker",
                          "status": "provisioning",
                          "plan_slug": "launch",
                          "vcpu": 1,
                          "memory_mib": 512,
                          "disk_gib": 10,
                          "guest_username": "root"
                        }
                      ],
                      "created_at": "2026-11-18T10:24:00Z"
                    },
                    "status": "provisioning",
                    "events_url": "/v1/operations/019a9a10-5c70-7a1b-8c2d-3e4f5a6b7c8d/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages: `invalid request` (malformed JSON or missing\n`name`), `name is required` (blank name), `worker_count cannot exceed 3`,\n`invalid compute plan`, `this compute plan is not available`, `invalid image`, or\n`invalid ssh key`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "worker_count cannot exceed 3",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A cluster with the same name slug already exists in the workspace (`cluster name already exists`), or the `X-Idempotency` key was already used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "cluster name already exists",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "409"
        ]
      }
    },
    "/v1/kubernetes/clusters/{uid}": {
      "get": {
        "operationId": "getKubernetesCluster",
        "summary": "Get a cluster",
        "x-slug": "get-a-cluster",
        "description": "Returns one cluster with its nodes, API `endpoint` and, once available, its `kubeconfig`.\n\n`kubeconfig` contains cluster-admin credentials and is only returned to roles with the\n`secrets read` permission (owner, admin or developer). For other roles (viewers) it is\nalways omitted and `kubeconfig_restricted` is `true`, so an empty kubeconfig does not mean\nit is still being generated.\n\nIf the cluster is `running` but its kubeconfig has not arrived yet, this request also asks\nthe platform to fetch it in the background (at most once every two minutes). Call again\nshortly to pick it up.\n\nDeleted clusters are still returned, with status `deleted`.\n",
        "tags": [
          "Kubernetes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/KubernetesClusterUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The cluster.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/KubernetesCluster"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9a10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                    "name": "production",
                    "slug": "production",
                    "status": "running",
                    "display_status": "running",
                    "zone_slug": "olas-closet",
                    "version": "v1.36.2+k3s1",
                    "image_slug": "ubuntu-2404-lts",
                    "endpoint": "https://production-1c2d3e.k8s.rumptycloud.com:16443",
                    "kubeconfig": "apiVersion: v1\nkind: Config\nclusters:\n  - name: production\n    cluster:\n      server: https://production-1c2d3e.k8s.rumptycloud.com:16443\n      certificate-authority-data: LS0tLS1CRUdJTi...\n...\n",
                    "nodes": [
                      {
                        "uid": "019a9a10-5c6e-7f01-8a2b-3c4d5e6f7a8b",
                        "name": "production-cp-1",
                        "role": "control-plane",
                        "status": "ready",
                        "plan_slug": "scale",
                        "vcpu": 2,
                        "memory_mib": 2048,
                        "disk_gib": 50,
                        "private_ip": "10.16.7.11",
                        "guest_username": "root"
                      },
                      {
                        "uid": "019a9a10-5c6f-7b2c-9d3e-4f5a6b7c8d9e",
                        "name": "production-worker-1",
                        "role": "worker",
                        "status": "ready",
                        "plan_slug": "launch",
                        "vcpu": 1,
                        "memory_mib": 512,
                        "disk_gib": 10,
                        "private_ip": "10.16.7.12",
                        "guest_username": "root"
                      }
                    ],
                    "created_at": "2026-11-18T10:24:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No cluster with this `uid` exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "cluster not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "deleteKubernetesCluster",
        "summary": "Delete a cluster",
        "x-slug": "delete-a-cluster",
        "description": "Queues deletion of the cluster and all of its nodes. The cluster and its nodes move to\n`deleting` straight away, and the cluster disappears from listings once the operation\nfinishes.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). A cluster can be deleted in any\nstatus except `deleting` and `deleted`, including while it is `stopped`.\n\n`X-Idempotency` is optional. A retry with the same key for the same cluster returns the\noriginal operation with `200 OK` and `is_replay: true`, even after the cluster is gone.\nWithout a key, a repeated delete returns `409` because the cluster is already deleting.\n\nThe response's `cluster` includes `kubeconfig` when one exists.\n",
        "tags": [
          "Kubernetes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/KubernetesClusterUid"
          },
          {
            "$ref": "#/components/parameters/KubernetesIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/KubernetesClusterOperationReplay"
          },
          "202": {
            "description": "The delete operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/KubernetesClusterOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "kubernetes cluster delete request queued",
                  "data": {
                    "operation_id": "019a9b22-1d2e-7f3a-8b4c-5d6e7f8a9b0c",
                    "cluster": {
                      "uid": "019a9a10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "name": "production",
                      "slug": "production",
                      "status": "deleting",
                      "display_status": "deleting",
                      "zone_slug": "olas-closet",
                      "version": "v1.36.2+k3s1",
                      "image_slug": "ubuntu-2404-lts",
                      "endpoint": "https://production-1c2d3e.k8s.rumptycloud.com:16443",
                      "nodes": [
                        {
                          "uid": "019a9a10-5c6e-7f01-8a2b-3c4d5e6f7a8b",
                          "name": "production-cp-1",
                          "role": "control-plane",
                          "status": "ready",
                          "plan_slug": "scale",
                          "vcpu": 2,
                          "memory_mib": 2048,
                          "disk_gib": 50,
                          "private_ip": "10.16.7.11",
                          "guest_username": "root"
                        }
                      ],
                      "created_at": "2026-11-18T10:24:00Z"
                    },
                    "status": "deleting",
                    "events_url": "/v1/operations/019a9b22-1d2e-7f3a-8b4c-5d6e7f8a9b0c/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No cluster with this `uid` exists in the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "cluster not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The cluster is already being deleted or has been deleted (`cluster is already deleting`), or the `X-Idempotency` key was already used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "cluster is already deleting",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/plans": {
      "get": {
        "operationId": "listDeploymentPlans",
        "summary": "List deployment plans",
        "x-slug": "list-deployment-plans",
        "description": "Returns the compute plans available for deployments, cheapest first. Only plans that are\ncurrently available are listed. Use a plan's `slug` as `plan_slug` when you\n[create a deployment](/api/deployments/create-a-deployment) or\n[change its plan](/api/deployments/change-a-deployment-plan).\n\nPlans with `free_allowance_count` above `0` are Free plans. A Free app always scales to zero\nwhen idle, runs a single instance, and counts toward a per-account allowance (see\n[Get the free app quota](/api/deployments/get-the-free-app-quota)).\n\nThe list can include plans reserved for one-click app components, such as\n`deploy-backing`. Those cannot be chosen when creating a deployment or changing a plan\n(`invalid deployment plan`).\n\nThis endpoint needs an API key but no workspace.\n",
        "tags": [
          "Deployments"
        ],
        "responses": {
          "200": {
            "description": "The available deployment plans.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DeploymentPlan"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "0199e0b1-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                      "name": "Free",
                      "slug": "deploy-free",
                      "product": "deployment",
                      "zone_slug": "olas-closet",
                      "vcpu": 1,
                      "cpu_request_millis": 25,
                      "cpu_limit_millis": 1000,
                      "memory_mib": 512,
                      "included_disk_gib": 0,
                      "included_egress_gib": 50,
                      "network_ingress_mbit": 50,
                      "network_egress_mbit": 50,
                      "monthly_price_cents": 0,
                      "hourly_price_cents": 0,
                      "hourly_price_micros": 0,
                      "currency": "USD",
                      "free_allowance_count": 5,
                      "available": true
                    },
                    {
                      "uid": "0199e0b1-2c3d-7e4f-8a9b-0c1d2e3f4a5c",
                      "name": "Tiny",
                      "slug": "deploy-tiny",
                      "product": "deployment",
                      "zone_slug": "olas-closet",
                      "vcpu": 1,
                      "cpu_request_millis": 25,
                      "cpu_limit_millis": 1000,
                      "memory_mib": 512,
                      "included_disk_gib": 0,
                      "included_egress_gib": 50,
                      "network_ingress_mbit": 50,
                      "network_egress_mbit": 50,
                      "monthly_price_cents": 200,
                      "hourly_price_cents": 0,
                      "hourly_price_micros": 2739,
                      "currency": "USD",
                      "free_allowance_count": 0,
                      "available": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/deployments": {
      "post": {
        "operationId": "createDeployment",
        "summary": "Create a deployment",
        "x-slug": "create-a-deployment",
        "description": "Creates a deployment from a Git repository.\n\n- With `deploy_now: true`, the first build is queued straight away. The response is\n  `202 Accepted` with an `operation_id` and the new `run`. Follow it with\n  [Get an operation](/api/operations/get-an-operation) or\n  [Get a deployment run](/api/deployments/get-a-deployment-run).\n- Otherwise the deployment is only saved and the response is `201 Created` without an\n  `operation_id`. Start the first build later with\n  [Deploy a deployment](/api/deployments/deploy-a-deployment).\n\nThings to know:\n\n- You must accept the acceptable use policy first. Until then this endpoint returns `428`\n  with `action: accept_acceptable_use_policy`.\n- The deployment gets a unique HTTPS hostname on the platform domain, shown in `public_url`\n  and `default_public_url`. The slug is derived from `name`; if it is taken in the\n  workspace, a short suffix is added.\n- Private repositories need the RumptyCloud GitHub App. Send `git_provider: github_app`\n  and `git_repo_full_name`. If GitHub is not connected, a `deploy_now` request fails with\n  `Connect GitHub before deploying this repository.`\n- For GitHub App repositories, a non-empty `root_directory` is checked against the branch\n  and rejected if the folder does not exist.\n- On a Free plan (`free_allowance_count` above `0`), scale-to-zero is forced on, the app\n  runs a single replica, and the account's Free allowance must not be used up.\n- A persistent volume pins the app to one replica. Preview apps need `git_provider` and no\n  volume; otherwise `preview_apps_enabled` is silently turned off.\n- `env_vars` are stored encrypted and are available both at build time and at runtime.\n  `build_env` values are only passed to this first build and are not stored.\n- `X-Idempotency` only deduplicates creates with `deploy_now: true`, where the key is\n  stored on the build operation. The same key with a different `name` returns `409`\n  (`action: idempotency_key_reused`). Without `deploy_now` nothing records the key, so a\n  retry creates a second deployment (with a suffixed slug).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "plan_slug",
                  "repo_url"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name. Leading and trailing spaces are trimmed. The slug and default hostname are derived from it.",
                    "example": "acme-api"
                  },
                  "plan_slug": {
                    "type": "string",
                    "description": "Slug of a plan from [List deployment plans](/api/deployments/list-deployment-plans). Case-insensitive.",
                    "example": "deploy-tiny"
                  },
                  "repo_url": {
                    "type": "string",
                    "description": "Git repository to build. Accepts `https://`, `http://`, `git://` and `ssh://git@`\nURLs, or the `git@host:owner/repo.git` form. The path must look like\n`/owner/repo`.\n",
                    "example": "https://github.com/acme/api.git"
                  },
                  "git_provider": {
                    "type": "string",
                    "enum": [
                      "github_app"
                    ],
                    "description": "Set to `github_app` to clone through your connected RumptyCloud GitHub App installation (needed for private repositories, previews and status checks). Omit for public repositories.",
                    "example": "github_app"
                  },
                  "git_repo_full_name": {
                    "type": "string",
                    "description": "`owner/repository` on GitHub. Required when `git_provider` is set. Each part may contain only letters, digits, `_`, `.` and `-`.",
                    "example": "acme/api"
                  },
                  "git_repo_id": {
                    "type": "string",
                    "description": "GitHub's numeric repository ID, stored for reference.",
                    "example": "812345678"
                  },
                  "branch": {
                    "type": "string",
                    "default": "main",
                    "description": "Branch to build. Defaults to `main`.",
                    "example": "main"
                  },
                  "root_directory": {
                    "type": "string",
                    "description": "Folder inside the repository to build from, for monorepos. Must be relative and stay inside the repository. Empty or `.` builds from the root.",
                    "example": "apps/api"
                  },
                  "app_type": {
                    "type": "string",
                    "enum": [
                      "service",
                      "static"
                    ],
                    "default": "service",
                    "description": "`service` for a long-running server, `static` for a static site. `backend` and `api` are accepted as `service`; `frontend` and `web` as `static`."
                  },
                  "build_method": {
                    "type": "string",
                    "enum": [
                      "railpack",
                      "dockerfile"
                    ],
                    "default": "railpack",
                    "description": "How to build the image. `railpack` detects the language and builds automatically. `dockerfile` uses the repository's Dockerfile."
                  },
                  "build_command": {
                    "type": "string",
                    "description": "Optional command that overrides the detected build step.",
                    "example": "npm run build"
                  },
                  "start_command": {
                    "type": "string",
                    "description": "Optional command that overrides the detected start command.",
                    "example": "node dist/server.js"
                  },
                  "health_check_path": {
                    "type": "string",
                    "default": "/",
                    "description": "HTTP path probed to decide the app is healthy. Must start with `/`, contain no whitespace and be at most 255 characters.",
                    "example": "/healthz"
                  },
                  "port": {
                    "type": "integer",
                    "default": 8080,
                    "description": "Port your app listens on. Zero or negative values use `8080`.",
                    "example": 3000
                  },
                  "auto_deploy_enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Build and deploy automatically on every push to `branch` (GitHub App repositories)."
                  },
                  "security_scan_enabled": {
                    "type": "boolean",
                    "default": true,
                    "description": "Scan each built image for known vulnerabilities. On unless you send `false`. Scanning is a paid add-on."
                  },
                  "preview_apps_enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Create a temporary preview app for each pull request. Only applied when `git_provider` is set and there is no volume."
                  },
                  "deploy_now": {
                    "type": "boolean",
                    "default": false,
                    "description": "Queue the first build immediately."
                  },
                  "build_env": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Extra variables for the first build only. Not stored. Ignored when `deploy_now` is `false`.",
                    "example": {
                      "NODE_ENV": "production"
                    }
                  },
                  "env_vars": {
                    "type": "array",
                    "description": "Environment variables to store on the deployment. Keys must be unique.",
                    "items": {
                      "$ref": "#/components/schemas/DeploymentEnvVarInput"
                    }
                  },
                  "volume_mount_path": {
                    "type": "string",
                    "description": "Absolute path to mount a persistent volume at. Send together with\n`volume_size_gib`. Cannot be `/` or a system directory such as `/app`, `/etc`\nor `/var` (use a subdirectory like `/var/data`), and cannot be under `/proc`,\n`/sys` or `/dev`.\n",
                    "example": "/data"
                  },
                  "volume_size_gib": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 512,
                    "description": "Volume size in GiB, from 1 to 512. Volumes are billed and can only grow later.",
                    "example": 10
                  },
                  "scale_to_zero_enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Let the app sleep after `scale_to_zero_idle_minutes` without traffic. It wakes on the next request. Always on for Free plans."
                  },
                  "scale_to_zero_idle_minutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1440,
                    "default": 5,
                    "description": "Idle minutes before the app sleeps. `0` means the default of 5."
                  },
                  "min_replicas": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5,
                    "default": 1,
                    "description": "Instances that are always running. Must be `1` when scale-to-zero is on. `0` means the default."
                  },
                  "max_replicas": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5,
                    "default": 1,
                    "description": "Upper bound for autoscaling. Must be at least `min_replicas`, and `1` with a volume or on a Free plan. Each running replica is billed at the plan rate. `0` means the default."
                  },
                  "target_request_rate": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "default": 100,
                    "description": "Requests per second per replica above which a replica is added. `0` means the default."
                  }
                }
              },
              "example": {
                "name": "acme-api",
                "plan_slug": "deploy-tiny",
                "repo_url": "https://github.com/acme/api.git",
                "git_provider": "github_app",
                "git_repo_full_name": "acme/api",
                "branch": "main",
                "port": 3000,
                "health_check_path": "/healthz",
                "auto_deploy_enabled": true,
                "deploy_now": true,
                "env_vars": [
                  {
                    "key": "DATABASE_URL",
                    "value": "postgres://app:s3cret@db.internal:5432/app"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeploymentOperationReplay"
          },
          "201": {
            "description": "The deployment was created without a build (`deploy_now` was `false` or omitted). `operation_id` is empty and `status` is the deployment's status.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "deployment created",
                  "data": {
                    "operation_id": "",
                    "is_replay": false,
                    "status": "active",
                    "deployment": {
                      "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "name": "acme-api",
                      "slug": "acme-api",
                      "status": "active",
                      "display_status": "active",
                      "plan_slug": "deploy-tiny",
                      "plan_name": "Tiny",
                      "repo_url": "https://github.com/acme/api.git",
                      "branch": "main",
                      "app_type": "service",
                      "build_method": "railpack",
                      "health_check_path": "/",
                      "port": 8080,
                      "auto_deploy_enabled": false,
                      "security_scan_enabled": true,
                      "preview_apps_enabled": false,
                      "artifact_retention": 5,
                      "public_url": "https://acme-api.rumptycloud.app",
                      "default_public_url": "https://acme-api.rumptycloud.app",
                      "created_at": "2026-11-18T10:24:00Z"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "The deployment was created and its first build was queued (`deploy_now` was `true`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "deployment created",
                  "data": {
                    "operation_id": "019a9a12-5c6e-7a1b-8c2d-3e4f5a6b7c8d",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9a12-5c6e-7a1b-8c2d-3e4f5a6b7c8d/events",
                    "is_replay": false,
                    "deployment": {
                      "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "name": "acme-api",
                      "slug": "acme-api",
                      "status": "building",
                      "display_status": "building",
                      "plan_slug": "deploy-tiny",
                      "plan_name": "Tiny",
                      "vcpu": 1,
                      "cpu_limit_millis": 1000,
                      "memory_mib": 512,
                      "monthly_price_cents": 200,
                      "hourly_price_micros": 2739,
                      "currency": "USD",
                      "repo_url": "https://github.com/acme/api.git",
                      "git_provider": "github_app",
                      "git_repo_full_name": "acme/api",
                      "branch": "main",
                      "app_type": "service",
                      "build_method": "railpack",
                      "health_check_path": "/healthz",
                      "port": 3000,
                      "auto_deploy_enabled": true,
                      "security_scan_enabled": true,
                      "preview_apps_enabled": false,
                      "artifact_retention": 5,
                      "min_replicas": 1,
                      "max_replicas": 1,
                      "target_request_rate": 100,
                      "current_replicas": 1,
                      "scale_to_zero_idle_minutes": 5,
                      "last_run_uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                      "public_url": "https://acme-api.rumptycloud.app",
                      "default_public_url": "https://acme-api.rumptycloud.app",
                      "created_at": "2026-11-18T10:24:00Z"
                    },
                    "run": {
                      "uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                      "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "operation_id": "019a9a12-5c6e-7a1b-8c2d-3e4f5a6b7c8d",
                      "trigger": "manual",
                      "status": "queued",
                      "branch": "main",
                      "trigger_actor": "ada",
                      "created_at": "2026-11-18T10:24:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages include: `invalid request` (malformed JSON, or\n`name`, `plan_slug` or `repo_url` missing), `name is required`,\n`repo_url must be a valid git repository URL`, `repo_url must point to a git repository`,\n`unsupported git provider`, `git_repo_full_name is required`,\n`git_repo_full_name must look like owner/repository`, `root_directory must be relative`,\n`app_type must be service or static`, `invalid build method`,\n`health_check_path must start with /`, `volume size must be between 1 and 512 GiB`,\n`invalid deployment plan`, `deployment plan is not available`,\n`max_replicas must be between 1 and 5`,\n`deployments with a persistent volume cannot scale beyond 1 replica`,\n`the Free plan runs a single instance; switch to a paid plan to scale out`,\nthe Free app limit message, `duplicate environment variable <KEY>`,\n`environment variable value is required`, a root directory not found on the branch, and\n`Connect GitHub before deploying this repository.`\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "app_type must be service or static",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/DeploymentIdempotencyKeyReused"
          },
          "428": {
            "description": "You have not accepted the acceptable use policy yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "acceptable use policy acceptance is required before creating a deployment",
                  "action": "accept_acceptable_use_policy"
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "201",
          "200",
          "400",
          "401",
          "402",
          "403",
          "409",
          "428"
        ]
      },
      "get": {
        "operationId": "listDeployments",
        "summary": "List deployments",
        "x-slug": "list-deployments",
        "description": "Returns the workspace's deployments, newest first. Deleted deployments, pull request\npreviews and the component deployments of one-click [apps](/api/apps/list-apps) are not\nincluded. Each item carries the status of its latest run in `last_run_status`, and\n`display_status` shows `updating` while a new version builds for a live app, and `starting` once that build has an image.\n\nWithout query parameters, every deployment is returned in `data`. Send `page` or\n`page_size` to paginate. A top-level `pagination` object is then added next to `data`, and\n`q` filters the results. `q` is ignored unless `page` or `page_size` is present.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1. Values below 1 (or non-numbers) are treated as `1`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Items per page. Defaults to `10`. Values above `100` are capped at `100`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "example": 20
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search across name, slug, repository URL, branch, plan slug and status. Only applied when paginating.",
            "schema": {
              "type": "string",
              "example": "api"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's deployments. `pagination` is only present when `page` or `page_size` was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Deployment"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/VmPagination"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "name": "acme-api",
                      "slug": "acme-api",
                      "status": "active",
                      "display_status": "active",
                      "plan_slug": "deploy-tiny",
                      "plan_name": "Tiny",
                      "vcpu": 1,
                      "cpu_limit_millis": 1000,
                      "memory_mib": 512,
                      "monthly_price_cents": 200,
                      "hourly_price_micros": 2739,
                      "currency": "USD",
                      "repo_url": "https://github.com/acme/api.git",
                      "git_provider": "github_app",
                      "git_repo_full_name": "acme/api",
                      "branch": "main",
                      "app_type": "service",
                      "build_method": "railpack",
                      "health_check_path": "/healthz",
                      "port": 3000,
                      "auto_deploy_enabled": true,
                      "security_scan_enabled": true,
                      "preview_apps_enabled": false,
                      "artifact_retention": 5,
                      "min_replicas": 1,
                      "max_replicas": 1,
                      "target_request_rate": 100,
                      "current_replicas": 1,
                      "scale_to_zero_idle_minutes": 5,
                      "last_run_uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                      "last_run_status": "ready",
                      "public_url": "https://acme-api.rumptycloud.app",
                      "default_public_url": "https://acme-api.rumptycloud.app",
                      "created_at": "2026-11-18T10:24:00Z"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 20,
                    "total": 1,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/deployments/summary": {
      "get": {
        "operationId": "getDeploymentSummary",
        "summary": "Get the deployment summary",
        "x-slug": "get-the-deployment-summary",
        "description": "Returns deployment counts for the workspace, using the same set of deployments as [List deployments](/api/deployments/list-deployments).",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The deployment counts.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentSummary"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "total": 4,
                    "active": 3,
                    "building": 1,
                    "needs_attention": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/deployments/free-quota": {
      "get": {
        "operationId": "getFreeDeploymentQuota",
        "summary": "Get the free app quota",
        "x-slug": "get-the-free-app-quota",
        "description": "Returns how many Free plan apps the workspace owner's account may run, how many it runs now,\nand how many are left. The allowance is per account, across every workspace the owner\nowns. All values are `0` when no Free plan is offered.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The Free app allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentFreeQuota"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "limit": 5,
                    "used": 2,
                    "remaining": 3
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/deployments/activity": {
      "get": {
        "operationId": "listDeploymentActivity",
        "summary": "List deployment activity",
        "x-slug": "list-deployment-activity",
        "description": "Returns how many runs were started per day across the whole workspace, with how many\nsucceeded (`ready`) and failed. Only days with at least one run are included, oldest first.\nDays are calendar dates in West Africa Time (UTC+1).\n\nThis counts every run in the workspace, including runs of pull request previews and of\none-click app components. For a single deployment, use\n[List activity for a deployment](/api/deployments/list-activity-for-a-deployment).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentActivityDays"
          }
        ],
        "responses": {
          "200": {
            "description": "Run counts per day.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DeploymentActivityDay"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "date": "2026-11-17",
                      "count": 3,
                      "succeeded": 2,
                      "failed": 1
                    },
                    {
                      "date": "2026-11-18",
                      "count": 1,
                      "succeeded": 1,
                      "failed": 0
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/deployments/{uid}": {
      "get": {
        "operationId": "getDeployment",
        "summary": "Get a deployment",
        "x-slug": "get-a-deployment",
        "description": "Returns one deployment. Compared with the list, this also includes:\n\n- `env_changes_pending` and `env_changes_require_build`, which tell you whether saved\n  environment variable changes are waiting for the next deploy.\n- `previews`, the live pull request previews of the deployment.\n\nComponent deployments of one-click apps can be read here too. They carry an `app_uid`.\nPull request previews themselves return `404`.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The deployment.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Deployment"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                    "name": "acme-api",
                    "slug": "acme-api",
                    "status": "active",
                    "display_status": "active",
                    "plan_slug": "deploy-tiny",
                    "plan_name": "Tiny",
                    "vcpu": 1,
                    "cpu_limit_millis": 1000,
                    "memory_mib": 512,
                    "monthly_price_cents": 200,
                    "hourly_price_micros": 2739,
                    "currency": "USD",
                    "repo_url": "https://github.com/acme/api.git",
                    "git_provider": "github_app",
                    "git_repo_full_name": "acme/api",
                    "branch": "main",
                    "app_type": "service",
                    "build_method": "railpack",
                    "health_check_path": "/healthz",
                    "port": 3000,
                    "auto_deploy_enabled": true,
                    "security_scan_enabled": true,
                    "preview_apps_enabled": true,
                    "artifact_retention": 5,
                    "previews": [
                      {
                        "uid": "019a9b02-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
                        "pr_number": 42,
                        "branch": "feature/login",
                        "status": "active",
                        "commit_sha": "3f9c2a1b7d4e5f60718293a4b5c6d7e8f9012345",
                        "public_url": "https://acme-api-pr-42.rumptycloud.app",
                        "expires_at": "2026-11-25T09:00:00Z"
                      }
                    ],
                    "min_replicas": 1,
                    "max_replicas": 2,
                    "target_request_rate": 100,
                    "current_replicas": 1,
                    "scale_to_zero_idle_minutes": 5,
                    "custom_domain": "api.acme.com",
                    "last_run_uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                    "last_run_status": "ready",
                    "public_url": "https://api.acme.com",
                    "default_public_url": "https://acme-api.rumptycloud.app",
                    "created_at": "2026-11-18T10:24:00Z",
                    "env_changes_pending": true,
                    "env_changes_require_build": true
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      },
      "patch": {
        "operationId": "updateDeployment",
        "summary": "Update a deployment",
        "x-slug": "update-a-deployment",
        "description": "Changes a deployment's settings. Send only the fields you want to change.\n\nSettings are saved immediately but most only take effect on the next build or deploy\n(a [manual deploy](/api/deployments/deploy-a-deployment) or a git push). Changing\n`artifact_retention` deletes older build images right away. Turning scale-to-zero off\nwakes a sleeping (`idle`) deployment's status back to `active`.\n\nRules enforced:\n\n- A persistent volume can be added, and its size can only grow. Once created it cannot be\n  removed. A volume limits the app to one replica and is incompatible with preview apps.\n- Scale-to-zero needs `min_replicas` of `1`. Free plans always scale to zero and run one\n  replica, so sending `scale_to_zero_enabled: false` on a Free plan is rejected.\n- Component deployments of one-click apps cannot scale to zero.\n- Preview apps need a GitHub repository (`git_repo_full_name`).\n- For GitHub App repositories, a changed `branch` or `root_directory` is checked against\n  the repository.\n\nTo change the plan, use [Change a deployment plan](/api/deployments/change-a-deployment-plan).\nThe response is the updated deployment without `last_run_status`, so `display_status`\nequals `status`.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "branch": {
                    "type": "string",
                    "description": "Branch to build. Cannot be empty.",
                    "example": "main"
                  },
                  "root_directory": {
                    "type": "string",
                    "description": "Folder inside the repository to build from. Must be relative and stay inside the repository. Empty builds from the root.",
                    "example": "apps/api"
                  },
                  "app_type": {
                    "type": "string",
                    "enum": [
                      "service",
                      "static"
                    ],
                    "description": "`service` or `static` (aliases `backend`, `api`, `frontend` and `web` are accepted)."
                  },
                  "build_command": {
                    "type": "string",
                    "description": "Build command override. Send an empty string to clear it."
                  },
                  "start_command": {
                    "type": "string",
                    "description": "Start command override. Send an empty string to clear it."
                  },
                  "health_check_path": {
                    "type": "string",
                    "description": "Health check path. Must start with `/`. Empty resets it to `/`.",
                    "example": "/healthz"
                  },
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Port your app listens on. Must be positive.",
                    "example": 3000
                  },
                  "auto_deploy_enabled": {
                    "type": "boolean",
                    "description": "Build and deploy automatically on every push to the branch."
                  },
                  "security_scan_enabled": {
                    "type": "boolean",
                    "description": "Scan built images for vulnerabilities."
                  },
                  "preview_apps_enabled": {
                    "type": "boolean",
                    "description": "Create a preview app for each pull request."
                  },
                  "artifact_retention": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50,
                    "description": "How many built images to keep for rollbacks. `0` keeps all. The live image and in-flight runs are never pruned.",
                    "example": 5
                  },
                  "volume_mount_path": {
                    "type": "string",
                    "description": "Absolute mount path of the persistent volume. Same rules as on create.",
                    "example": "/data"
                  },
                  "volume_size_gib": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 512,
                    "description": "Volume size in GiB. Can only grow.",
                    "example": 20
                  },
                  "scale_to_zero_enabled": {
                    "type": "boolean",
                    "description": "Let the app sleep when idle."
                  },
                  "scale_to_zero_idle_minutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1440,
                    "description": "Idle minutes before the app sleeps. `0` means 5."
                  },
                  "min_replicas": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5,
                    "description": "Instances always running."
                  },
                  "max_replicas": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5,
                    "description": "Autoscaling upper bound."
                  },
                  "target_request_rate": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "description": "Requests per second per replica before scaling out."
                  }
                }
              },
              "example": {
                "branch": "release",
                "health_check_path": "/healthz",
                "max_replicas": 3
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated deployment.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Deployment"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "deployment updated",
                  "data": {
                    "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                    "name": "acme-api",
                    "slug": "acme-api",
                    "status": "active",
                    "display_status": "active",
                    "plan_slug": "deploy-tiny",
                    "plan_name": "Tiny",
                    "repo_url": "https://github.com/acme/api.git",
                    "git_provider": "github_app",
                    "git_repo_full_name": "acme/api",
                    "branch": "release",
                    "app_type": "service",
                    "build_method": "railpack",
                    "health_check_path": "/healthz",
                    "port": 3000,
                    "auto_deploy_enabled": true,
                    "security_scan_enabled": true,
                    "preview_apps_enabled": false,
                    "artifact_retention": 5,
                    "min_replicas": 1,
                    "max_replicas": 3,
                    "target_request_rate": 100,
                    "current_replicas": 1,
                    "scale_to_zero_idle_minutes": 5,
                    "last_run_uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                    "public_url": "https://acme-api.rumptycloud.app",
                    "default_public_url": "https://acme-api.rumptycloud.app",
                    "created_at": "2026-11-18T10:24:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Examples: `invalid request`, `branch is required`,\n`invalid port number`, `artifact_retention must be between 0 (keep all) and 50`,\n`connect GitHub before enabling preview apps`,\n`the persistent volume cannot be removed once created`,\n`volume size can only grow: this deployment already has 10 GiB`,\n`min_replicas cannot exceed max_replicas`,\n`one-click apps cannot scale to zero; they stay always on`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "volume size can only grow: this deployment already has 10 GiB",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "deleteDeployment",
        "summary": "Delete a deployment",
        "x-slug": "delete-a-deployment",
        "description": "Deletes the deployment. It is marked `deleted` straight away and disappears from listings,\nbilling stops, its custom domains are released and its pull request previews are removed.\nTearing down the running app, its route and its persistent volume (destructively) happens\nin a `delete_deployment` operation.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation).\n\nComponent deployments of a one-click app cannot be deleted on their own. Delete the app\nwith [Delete an app](/api/apps/delete-an-app).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeploymentOperationReplay"
          },
          "202": {
            "description": "The deployment was marked deleted and the teardown was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "deployment deletion queued",
                  "data": {
                    "operation_id": "019a9c40-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9c40-7a8b-7c9d-8e0f-1a2b3c4d5e6f/events",
                    "is_replay": false,
                    "deployment": {
                      "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "name": "acme-api",
                      "slug": "acme-api",
                      "status": "deleted",
                      "display_status": "deleted",
                      "plan_slug": "deploy-tiny",
                      "repo_url": "https://github.com/acme/api.git",
                      "branch": "main",
                      "app_type": "service",
                      "build_method": "railpack",
                      "port": 3000,
                      "auto_deploy_enabled": true,
                      "security_scan_enabled": true,
                      "preview_apps_enabled": false,
                      "artifact_retention": 5,
                      "default_public_url": "https://acme-api.rumptycloud.app",
                      "created_at": "2026-11-18T10:24:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The deployment belongs to a one-click app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "this deployment is part of an app and can't be deleted on its own. Delete the app instead",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DeploymentIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/{uid}/activity": {
      "get": {
        "operationId": "listDeploymentActivityForDeployment",
        "summary": "List activity for a deployment",
        "x-slug": "list-activity-for-a-deployment",
        "description": "Returns how many runs this deployment started per day, with how many succeeded (`ready`)\nand failed. Only days with at least one run are included, oldest first. Days are calendar\ndates in West Africa Time (UTC+1).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentActivityDays"
          }
        ],
        "responses": {
          "200": {
            "description": "Run counts per day.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DeploymentActivityDay"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "date": "2026-11-18",
                      "count": 2,
                      "succeeded": 1,
                      "failed": 1
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/deploy": {
      "post": {
        "operationId": "deployDeployment",
        "summary": "Deploy a deployment",
        "x-slug": "deploy-a-deployment",
        "description": "Queues a new build of the deployment's branch and rolls it out when the build succeeds.\nSaved environment variable and settings changes are picked up. Any earlier build that is\nstill in progress is cancelled. While a live app rebuilds it keeps serving the current\nversion, and its `display_status` is `updating`.\n\nThe body is optional. Send no body, or `{}`, to build the latest commit on the branch.\n\nFor a component deployment of a one-click app (which runs a prebuilt image) the body is\nignored and this behaves like [Apply environment changes](/api/deployments/apply-environment-changes).\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id` and the new `run`.\nSee [Get an operation](/api/operations/get-an-operation).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "commit_sha": {
                    "type": "string",
                    "description": "Commit to build. Defaults to the head of the branch.",
                    "example": "3f9c2a1b7d4e5f60718293a4b5c6d7e8f9012345"
                  },
                  "commit_message": {
                    "type": "string",
                    "description": "Label shown on the run.",
                    "example": "Fix login redirect"
                  },
                  "build_env": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Extra variables for this build only. They override stored variables with the same key and are not saved.",
                    "example": {
                      "FEATURE_FLAGS": "beta"
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeploymentOperationReplay"
          },
          "202": {
            "description": "The build was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "deployment build queued",
                  "data": {
                    "operation_id": "019a9b10-4d5e-7f60-8a1b-2c3d4e5f6a7b",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9b10-4d5e-7f60-8a1b-2c3d4e5f6a7b/events",
                    "is_replay": false,
                    "deployment": {
                      "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "name": "acme-api",
                      "slug": "acme-api",
                      "status": "active",
                      "display_status": "active",
                      "plan_slug": "deploy-tiny",
                      "repo_url": "https://github.com/acme/api.git",
                      "branch": "main",
                      "app_type": "service",
                      "build_method": "railpack",
                      "port": 3000,
                      "auto_deploy_enabled": true,
                      "security_scan_enabled": true,
                      "preview_apps_enabled": false,
                      "artifact_retention": 5,
                      "last_run_uid": "019a9b10-4d5c-7a2b-9c3d-4e5f6a7b8c9d",
                      "public_url": "https://acme-api.rumptycloud.app",
                      "default_public_url": "https://acme-api.rumptycloud.app",
                      "created_at": "2026-11-18T10:24:00Z"
                    },
                    "run": {
                      "uid": "019a9b10-4d5c-7a2b-9c3d-4e5f6a7b8c9d",
                      "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "operation_id": "019a9b10-4d5e-7f60-8a1b-2c3d4e5f6a7b",
                      "trigger": "manual",
                      "status": "queued",
                      "branch": "main",
                      "trigger_actor": "ada",
                      "created_at": "2026-11-18T12:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid request` (no or malformed JSON body), or `Connect GitHub before deploying this repository.`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invalid request"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DeploymentIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/{uid}/apply-env": {
      "post": {
        "operationId": "applyDeploymentEnv",
        "summary": "Apply environment changes",
        "x-slug": "apply-environment-changes",
        "description": "Rolls out the currently served image again without a rebuild, with the deployment's\ncurrent environment variables and runtime settings. A new run is recorded with the live\nversion's commit details.\n\nBecause environment variables are also available at build time, saved changes on a\ndeployment built from a repository need a rebuild. In that case (the deployment shows\n`env_changes_require_build: true`) this endpoint returns `400` and you should use\n[Deploy a deployment](/api/deployments/deploy-a-deployment) instead. One-click app\ncomponents run a prebuilt image, so for them this applies environment changes directly.\n\nPast-due and suspended accounts get `402` with `action: past_due`. A retry with an\n`X-Idempotency` key already used here still gets the original operation.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id` and the new `run`.\nSee [Get an operation](/api/operations/get-an-operation).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeploymentOperationReplay"
          },
          "202": {
            "description": "The rollout was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "environment changes queued",
                  "data": {
                    "operation_id": "019a9b20-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9b20-6e7f-7a8b-9c0d-1e2f3a4b5c6d/events",
                    "is_replay": false,
                    "deployment": {
                      "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "name": "acme-api",
                      "slug": "acme-api",
                      "status": "active",
                      "display_status": "active",
                      "plan_slug": "deploy-tiny",
                      "repo_url": "https://github.com/acme/api.git",
                      "branch": "main",
                      "app_type": "service",
                      "build_method": "railpack",
                      "port": 3000,
                      "auto_deploy_enabled": true,
                      "security_scan_enabled": true,
                      "preview_apps_enabled": false,
                      "artifact_retention": 5,
                      "last_run_uid": "019a9b20-6e7d-7f0a-8b1c-2d3e4f5a6b7c",
                      "public_url": "https://acme-api.rumptycloud.app",
                      "default_public_url": "https://acme-api.rumptycloud.app",
                      "created_at": "2026-11-18T10:24:00Z"
                    },
                    "run": {
                      "uid": "019a9b20-6e7d-7f0a-8b1c-2d3e4f5a6b7c",
                      "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "operation_id": "019a9b20-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
                      "trigger": "manual",
                      "status": "building",
                      "branch": "main",
                      "commit_sha": "3f9c2a1b7d4e5f60718293a4b5c6d7e8f9012345",
                      "commit_message": "Fix login redirect",
                      "trigger_actor": "ada",
                      "image_digest": "sha256:9b8d7c6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c",
                      "created_at": "2026-11-18T12:30:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Nothing is live yet (`Nothing is live yet. Deploy the app first — the initial deploy picks up all environment variables.`),\nor the saved changes need a rebuild (`Environment changes apply on the next deploy. Use Redeploy.`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "Environment changes apply on the next deploy. Use Redeploy.",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DeploymentIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/{uid}/restart": {
      "post": {
        "operationId": "restartDeployment",
        "summary": "Restart a deployment",
        "x-slug": "restart-a-deployment",
        "description": "Restarts the running version of the app without a build or a new run. If the platform\npaused or stopped the app because it was unhealthy (see `crashloop`), this starts a\nrecovery attempt, and the `crashloop` state clears once the app reports ready.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). The response has no `run`.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeploymentOperationReplay"
          },
          "202": {
            "description": "The restart was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "restart queued",
                  "data": {
                    "operation_id": "019a9b30-8a9b-7c0d-9e1f-2a3b4c5d6e7f",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9b30-8a9b-7c0d-9e1f-2a3b4c5d6e7f/events",
                    "is_replay": false,
                    "deployment": {
                      "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "name": "acme-api",
                      "slug": "acme-api",
                      "status": "active",
                      "display_status": "active",
                      "plan_slug": "deploy-tiny",
                      "repo_url": "https://github.com/acme/api.git",
                      "branch": "main",
                      "app_type": "service",
                      "build_method": "railpack",
                      "port": 3000,
                      "auto_deploy_enabled": true,
                      "security_scan_enabled": true,
                      "preview_apps_enabled": false,
                      "artifact_retention": 5,
                      "last_run_uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                      "public_url": "https://acme-api.rumptycloud.app",
                      "default_public_url": "https://acme-api.rumptycloud.app",
                      "created_at": "2026-11-18T10:24:00Z",
                      "crashloop": {
                        "state": "stopped",
                        "since": "2026-11-18T11:40:00Z",
                        "reason": "The app kept crashing after it started."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Nothing has been deployed yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "Nothing is live yet. Deploy the app first.",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DeploymentIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/{uid}/plan": {
      "post": {
        "operationId": "changeDeploymentPlan",
        "summary": "Change a deployment plan",
        "x-slug": "change-a-deployment-plan",
        "description": "Moves the deployment to another plan. Billing switches to the new rate immediately; usage\nso far is settled at the old rate first.\n\n- If the app has a live version, the current image is rolled out again under the new\n  plan's CPU and memory limits, with no rebuild. A run and an operation are created and\n  `status` is `queued`. See [Get an operation](/api/operations/get-an-operation).\n- Otherwise the plan is just recorded and the next deploy uses it. There is no\n  `operation_id` and `status` is `completed`.\n\nBoth cases return `202 Accepted`. Moving to a Free plan turns scale-to-zero on and limits\nthe app to one replica; moving off a Free plan turns scale-to-zero off.\n\nIn the second case no operation is recorded, so the `X-Idempotency` key is not stored and\na retry returns `400` (`This deployment is already on the <plan> plan.`). Past-due and\nsuspended accounts get `402` with `action: past_due`.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "plan_slug"
                ],
                "properties": {
                  "plan_slug": {
                    "type": "string",
                    "description": "Slug of the new plan from [List deployment plans](/api/deployments/list-deployment-plans). Case-insensitive.",
                    "example": "deploy-starter"
                  }
                }
              },
              "example": {
                "plan_slug": "deploy-starter"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeploymentOperationReplay"
          },
          "202": {
            "description": "The plan change was queued, or recorded immediately when nothing is live (`status` is `completed`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "deployment plan change queued",
                  "data": {
                    "operation_id": "019a9b40-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9b40-0a1b-7c2d-8e3f-4a5b6c7d8e9f/events",
                    "is_replay": false,
                    "deployment": {
                      "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "name": "acme-api",
                      "slug": "acme-api",
                      "status": "active",
                      "display_status": "active",
                      "plan_slug": "deploy-starter",
                      "plan_name": "Starter",
                      "vcpu": 1,
                      "cpu_limit_millis": 1500,
                      "memory_mib": 1024,
                      "monthly_price_cents": 400,
                      "hourly_price_micros": 5479,
                      "currency": "USD",
                      "repo_url": "https://github.com/acme/api.git",
                      "branch": "main",
                      "app_type": "service",
                      "build_method": "railpack",
                      "port": 3000,
                      "auto_deploy_enabled": true,
                      "security_scan_enabled": true,
                      "preview_apps_enabled": false,
                      "artifact_retention": 5,
                      "last_run_uid": "019a9b40-0a19-7e3f-9a4b-5c6d7e8f9a0b",
                      "public_url": "https://acme-api.rumptycloud.app",
                      "default_public_url": "https://acme-api.rumptycloud.app",
                      "created_at": "2026-11-18T10:24:00Z"
                    },
                    "run": {
                      "uid": "019a9b40-0a19-7e3f-9a4b-5c6d7e8f9a0b",
                      "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "operation_id": "019a9b40-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
                      "trigger": "manual",
                      "status": "building",
                      "branch": "main",
                      "commit_message": "Plan change to Starter",
                      "trigger_actor": "ada",
                      "created_at": "2026-11-18T13:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid request` (missing `plan_slug`), `invalid deployment plan`,\n`deployment plan is not available`, `This deployment is already on the Tiny plan.`,\n`A build is in progress. Try again once it finishes.`,\n`This deployment is managed by a one-click app and cannot change plans directly.`, or\nthe Free app limit message.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "A build is in progress. Try again once it finishes.",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DeploymentIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/{uid}/custom-domains": {
      "get": {
        "operationId": "listDeploymentCustomDomains",
        "summary": "List custom domains",
        "x-slug": "list-custom-domains",
        "description": "Returns the custom domains attached to the deployment, with their verification status.",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The deployment's custom domains.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DeploymentCustomDomain"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9b50-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
                      "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "domain_name": "api.acme.com",
                      "status": "active",
                      "verification_txt": "rumpty-verification-019a9b50",
                      "created_at": "2026-11-18T11:05:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      },
      "post": {
        "operationId": "addDeploymentCustomDomain",
        "summary": "Add a custom domain",
        "x-slug": "add-a-custom-domain",
        "description": "Registers a custom domain for the deployment. The domain starts as `pending`. Nothing is\nrouted until you verify it.\n\nTo verify, create two DNS records at your DNS provider, then call\n[Verify a custom domain](/api/deployments/verify-a-custom-domain):\n\n- A `CNAME` record for the domain pointing to the host of the deployment's\n  `default_public_url` (for example `acme-api.rumptycloud.app`).\n- A `TXT` record at `rumpty-challenge.<domain_name>` whose value is the returned\n  `verification_txt`.\n\nRoot (apex) domains such as `acme.com` are not supported yet. Use a subdomain such as\n`www.acme.com`. A domain can only be registered once across RumptyCloud.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain_name"
                ],
                "properties": {
                  "domain_name": {
                    "type": "string",
                    "description": "Hostname to attach. Lowercased, trimmed and stripped of leading and trailing dots. Must be a hostname, not a URL.",
                    "example": "api.acme.com"
                  }
                }
              },
              "example": {
                "domain_name": "api.acme.com"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The domain was added in `pending` state.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentCustomDomain"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "custom domain added",
                  "data": {
                    "uid": "019a9b50-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
                    "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                    "domain_name": "api.acme.com",
                    "status": "pending",
                    "verification_txt": "rumpty-verification-019a9b50",
                    "created_at": "2026-11-18T11:05:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request`, `custom_domain must be a hostname, not a URL`, `custom_domain must be a valid domain name`, or the domain is a root domain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "root domains are not supported yet; use a subdomain such as www.acme.com",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The domain is already registered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "domain name is already registered",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/{uid}/custom-domains/{domain_uid}/verify": {
      "post": {
        "operationId": "verifyDeploymentCustomDomain",
        "summary": "Verify a custom domain",
        "x-slug": "verify-a-custom-domain",
        "description": "Checks the domain's DNS records against its authoritative nameserver and, if they match,\nqueues a `verify_custom_domain` operation that issues a TLS certificate and routes the\ndomain to the deployment. The domain stays `pending` until that operation finishes and\nbecomes `active`.\n\nAs soon as the checks pass, the deployment's `custom_domain` and `public_url` switch to\nthis domain. Environment variables that were seeded from the public URL (as one-click apps\ndo) are rewritten to the new domain and re-applied if the app is live.\n\nIf a DNS check fails, the domain is marked `failed` with the reason in `last_error`, and\nthe request returns `400` with the same message. The app must have been deployed first.\n\nCalling this again is safe:\n\n- If the domain is already `active`, you get `status: succeeded` with an empty\n  `operation_id` and nothing is queued.\n- If a verification queued in the last 15 minutes is still running, that operation is\n  returned instead of a new one.\n\nOtherwise this is asynchronous and returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/CustomDomainUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeploymentCustomDomainOperationReplay"
          },
          "202": {
            "description": "DNS checks passed and the routing operation was queued, or an existing result was returned.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentCustomDomainOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "custom domain verification queued",
                  "data": {
                    "operation_id": "019a9b55-3d4e-7f5a-8b6c-7d8e9f0a1b2c",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9b55-3d4e-7f5a-8b6c-7d8e9f0a1b2c/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "DNS verification failed, the domain is a root domain, or the app is not deployed yet\n(`deploy the app before verifying a custom domain`,\n`deployment does not have a default hostname yet`). Example DNS messages:\n`CNAME record has not propagated or does not point to <hostname>`,\n`verification TXT record not found or does not match: <verification_txt>`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "CNAME record has not propagated or does not point to acme-api.rumptycloud.app",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DeploymentIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/{uid}/custom-domains/{domain_uid}": {
      "delete": {
        "operationId": "deleteDeploymentCustomDomain",
        "summary": "Delete a custom domain",
        "x-slug": "delete-a-custom-domain",
        "description": "Removes the custom domain. It disappears from\n[List custom domains](/api/deployments/list-custom-domains) immediately, and its route is\ntorn down by a `delete_custom_domain` operation. If it was the deployment's primary\ndomain, `public_url` goes back to the platform hostname, and URL-derived environment\nvariables are rewritten and re-applied.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/CustomDomainUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeploymentCustomDomainOperationReplay"
          },
          "202": {
            "description": "The domain was removed and the route teardown was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentCustomDomainOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "custom domain removal queued",
                  "data": {
                    "operation_id": "019a9b58-4e5f-7a6b-8c7d-8e9f0a1b2c3d",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9b58-4e5f-7a6b-8c7d-8e9f0a1b2c3d/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "The app has never been deployed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "deploy the app before removing a custom domain",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DeploymentIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/{uid}/env-vars": {
      "get": {
        "operationId": "listDeploymentEnvVars",
        "summary": "List environment variables",
        "x-slug": "list-environment-variables",
        "description": "Returns the deployment's environment variables, sorted by key. Values are never returned\nhere; `masked_value` is always `••••••••`. To read one value, use\n[Reveal an environment variable](/api/deployments/reveal-an-environment-variable).\n\nRequires a workspace role that can read secrets (viewers cannot).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The environment variables, without values.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DeploymentEnvVar"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9b60-5f6a-7b7c-8d8e-9f0a1b2c3d4e",
                      "key": "DATABASE_URL",
                      "scope": "build",
                      "is_secret": true,
                      "masked_value": "••••••••",
                      "created_at": "2026-11-18T10:24:00Z",
                      "updated_at": "2026-11-18T10:24:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      },
      "put": {
        "operationId": "upsertDeploymentEnvVar",
        "summary": "Set an environment variable",
        "x-slug": "set-an-environment-variable",
        "description": "Creates the variable, or replaces its value if a variable with the same `key` exists. The\nvalue is stored encrypted. Every variable is available both at build time and at runtime.\n\nChanges are staged: the running app keeps its old environment until the next deploy, and\n[Get a deployment](/api/deployments/get-a-deployment) reports `env_changes_pending: true`\nuntil then. Apply them with [Deploy a deployment](/api/deployments/deploy-a-deployment).\n\nRequires a workspace role that can manage secrets.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeploymentEnvVarInput"
              },
              "example": {
                "key": "STRIPE_SECRET_KEY",
                "value": "sk_live_51Hx9eXampleKey"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved variable, without its value.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentEnvVar"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "environment variable saved",
                  "data": {
                    "uid": "019a9b62-6a7b-7c8d-9e0f-1a2b3c4d5e6f",
                    "key": "STRIPE_SECRET_KEY",
                    "scope": "build",
                    "is_secret": true,
                    "masked_value": "••••••••",
                    "created_at": "2026-11-18T14:00:00Z",
                    "updated_at": "2026-11-18T14:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid request` (missing `key` or `value`), `key must start with a letter or underscore and contain only letters, numbers, and underscores`, `scope must be runtime or build`, or `value is required`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "key must start with a letter or underscore and contain only letters, numbers, and underscores",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/env-vars/{env_uid}/reveal": {
      "post": {
        "operationId": "revealDeploymentEnvVar",
        "summary": "Reveal an environment variable",
        "x-slug": "reveal-an-environment-variable",
        "description": "Returns the **decrypted plaintext value** of one environment variable. Treat the response\nas a secret: do not log it or store it in plain text.\n\nEvery call is recorded in the workspace audit log. Requires a workspace role that can\nmanage secrets.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentEnvVarUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The variable with its plaintext value.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentEnvVarReveal"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9b62-6a7b-7c8d-9e0f-1a2b3c4d5e6f",
                    "key": "STRIPE_SECRET_KEY",
                    "value": "sk_live_51Hx9eXampleKey"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/env-vars/{env_uid}": {
      "delete": {
        "operationId": "deleteDeploymentEnvVar",
        "summary": "Delete an environment variable",
        "x-slug": "delete-an-environment-variable",
        "description": "Deletes the environment variable. If it is part of the running app's environment, the\nremoval is staged and takes effect on the next deploy, like any other change. Requires a\nworkspace role that can manage secrets.\n\nThe response is `200` even if no variable with this UID exists on the deployment.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentEnvVarUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The variable was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "environment variable deleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/runs": {
      "get": {
        "operationId": "listDeploymentRuns",
        "summary": "List deployment runs",
        "x-slug": "list-deployment-runs",
        "description": "Returns the deployment's runs (builds and rollouts), newest first. `security_scan` carries\nonly the vulnerability counts here; get a single run for the full list.\n\nWithout query parameters, every run is returned. Send `page` or `page_size` to paginate;\na top-level `pagination` object is then added next to `data`.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Runs per page. Defaults to `10`, capped at `100`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "example": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deployment's runs. `pagination` is only present when `page` or `page_size` was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DeploymentRun"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/VmPagination"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                      "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "operation_id": "019a9a12-5c6e-7a1b-8c2d-3e4f5a6b7c8d",
                      "trigger": "git_push",
                      "status": "ready",
                      "branch": "main",
                      "commit_sha": "3f9c2a1b7d4e5f60718293a4b5c6d7e8f9012345",
                      "commit_message": "Fix login redirect",
                      "trigger_actor": "ada-lovelace",
                      "trigger_actor_url": "https://github.com/ada-lovelace",
                      "image_digest": "sha256:9b8d7c6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c",
                      "artifact_size_bytes": 187654321,
                      "created_at": "2026-11-18T10:24:00Z",
                      "started_at": "2026-11-18T10:24:05Z",
                      "finished_at": "2026-11-18T10:27:41Z",
                      "security_scan": {
                        "uid": "019a9a13-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
                        "status": "warning",
                        "critical_count": 0,
                        "high_count": 2,
                        "medium_count": 5,
                        "low_count": 11,
                        "unknown_count": 0,
                        "scanner": "trivy",
                        "started_at": "2026-11-18T10:27:00Z",
                        "finished_at": "2026-11-18T10:27:35Z",
                        "scanned_at": "2026-11-18T10:27:35Z"
                      }
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 20,
                    "total": 1,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/runs/{run_uid}": {
      "get": {
        "operationId": "getDeploymentRun",
        "summary": "Get a deployment run",
        "x-slug": "get-a-deployment-run",
        "description": "Returns one run, including the full vulnerability list of its security scan when there is one.",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentRunUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The run.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentRun"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                    "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                    "operation_id": "019a9a12-5c6e-7a1b-8c2d-3e4f5a6b7c8d",
                    "trigger": "manual",
                    "status": "ready",
                    "branch": "main",
                    "commit_sha": "3f9c2a1b7d4e5f60718293a4b5c6d7e8f9012345",
                    "trigger_actor": "ada",
                    "image_digest": "sha256:9b8d7c6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c",
                    "artifact_size_bytes": 187654321,
                    "created_at": "2026-11-18T10:24:00Z",
                    "started_at": "2026-11-18T10:24:05Z",
                    "finished_at": "2026-11-18T10:27:41Z",
                    "security_scan": {
                      "uid": "019a9a13-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
                      "status": "warning",
                      "critical_count": 0,
                      "high_count": 1,
                      "medium_count": 0,
                      "low_count": 0,
                      "unknown_count": 0,
                      "scanner": "trivy",
                      "finished_at": "2026-11-18T10:27:35Z",
                      "scanned_at": "2026-11-18T10:27:35Z",
                      "vulnerabilities": [
                        {
                          "id": "CVE-2026-31337",
                          "severity": "HIGH",
                          "package_name": "openssl",
                          "installed_version": "3.3.1-r0",
                          "fixed_version": "3.3.2-r0",
                          "title": "openssl: buffer over-read in X.509 parsing",
                          "source": "alpine 3.21.3",
                          "advisory_url": "https://avd.aquasec.com/nvd/cve-2026-31337"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/runs/{run_uid}/logs": {
      "get": {
        "operationId": "listDeploymentRunLogs",
        "summary": "List deployment run logs",
        "x-slug": "list-deployment-run-logs",
        "description": "Returns all stored log lines of a run (build and rollout output), oldest first. Old log\nlines are cleaned up after a retention period, so logs of old runs may be empty.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentRunUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The run's log lines.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DeploymentRunLog"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9a12-6a00-7b1c-8d2e-3f4a5b6c7d8e",
                      "run_uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                      "operation_id": "019a9a12-5c6e-7a1b-8c2d-3e4f5a6b7c8d",
                      "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "step": "build",
                      "stream": "stdout",
                      "message": "npm run build",
                      "occurred_at": "2026-11-18T10:24:31.482913Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/runs/{run_uid}/deploy": {
      "post": {
        "operationId": "redeployDeploymentRun",
        "summary": "Redeploy a run",
        "x-slug": "redeploy-a-run",
        "description": "Rolls the deployment back (or forward) to the image built by an earlier run, without\nrebuilding. A new run is created with the source run's commit details and the current\nenvironment variables and settings.\n\nThe source run must still have its build image (see `image_digest`), and it must not be\nthe version already being served. Images can be removed by `artifact_retention` or by\n[Delete a run artifact](/api/deployments/delete-a-run-artifact).\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id` and the new `run`.\nSee [Get an operation](/api/operations/get-an-operation).\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentRunUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeploymentOperationReplay"
          },
          "202": {
            "description": "The rollout was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "deployment update queued",
                  "data": {
                    "operation_id": "019a9b70-7b8c-7d9e-8f0a-1b2c3d4e5f6a",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9b70-7b8c-7d9e-8f0a-1b2c3d4e5f6a/events",
                    "is_replay": false,
                    "deployment": {
                      "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "name": "acme-api",
                      "slug": "acme-api",
                      "status": "active",
                      "display_status": "active",
                      "plan_slug": "deploy-tiny",
                      "repo_url": "https://github.com/acme/api.git",
                      "branch": "main",
                      "app_type": "service",
                      "build_method": "railpack",
                      "port": 3000,
                      "auto_deploy_enabled": true,
                      "security_scan_enabled": true,
                      "preview_apps_enabled": false,
                      "artifact_retention": 5,
                      "last_run_uid": "019a9b70-7b8a-7c1d-9e2f-3a4b5c6d7e8f",
                      "public_url": "https://acme-api.rumptycloud.app",
                      "default_public_url": "https://acme-api.rumptycloud.app",
                      "created_at": "2026-11-18T10:24:00Z"
                    },
                    "run": {
                      "uid": "019a9b70-7b8a-7c1d-9e2f-3a4b5c6d7e8f",
                      "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                      "operation_id": "019a9b70-7b8c-7d9e-8f0a-1b2c3d4e5f6a",
                      "trigger": "manual",
                      "status": "building",
                      "branch": "main",
                      "commit_sha": "3f9c2a1b7d4e5f60718293a4b5c6d7e8f9012345",
                      "commit_message": "Fix login redirect",
                      "trigger_actor": "ada",
                      "image_digest": "sha256:9b8d7c6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c",
                      "created_at": "2026-11-18T15:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`This run does not have a deployable artifact.` or `This run is already serving the current app version.`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "This run is already serving the current app version.",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DeploymentIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/deployments/{uid}/runs/{run_uid}/artifact": {
      "delete": {
        "operationId": "deleteDeploymentRunArtifact",
        "summary": "Delete a run artifact",
        "x-slug": "delete-a-run-artifact",
        "description": "Deletes the container image built by a run to free storage. The run stays in the history,\nbut it can no longer be redeployed. If the run has no image, the run is returned\nunchanged.\n\nYou cannot delete the image that is currently being served, or the image of the latest run\nwhile it is still in progress.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentRunUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The image was deleted. Returns the updated run, without `image_digest` and `artifact_size_bytes`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentRun"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "build artifact deleted",
                  "data": {
                    "uid": "019a9a12-5c6d-7e8f-9a01-2b3c4d5e6f70",
                    "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                    "operation_id": "019a9a12-5c6e-7a1b-8c2d-3e4f5a6b7c8d",
                    "trigger": "manual",
                    "status": "ready",
                    "branch": "main",
                    "commit_sha": "3f9c2a1b7d4e5f60718293a4b5c6d7e8f9012345",
                    "trigger_actor": "ada",
                    "created_at": "2026-11-18T10:24:00Z",
                    "started_at": "2026-11-18T10:24:05Z",
                    "finished_at": "2026-11-18T10:27:41Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`This artifact is serving the current app version.` or `This artifact belongs to an active deployment run.`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "This artifact is serving the current app version.",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/metrics/current": {
      "get": {
        "operationId": "getDeploymentCurrentMetrics",
        "summary": "Get current deployment metrics",
        "x-slug": "get-current-deployment-metrics",
        "description": "Returns the latest resource sample for the deployment: replicas, CPU, memory, network and\nvolume usage, summed across replicas. Percentages are relative to the plan's limits.\n\nIf no sample has been received yet, `available` is `false`, `unavailable_reason` explains\nwhy, and only the limits are filled in. `stale` is `true` when the latest sample is more\nthan two minutes old.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The latest metrics.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentMetricsCurrent"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                    "available": true,
                    "stale": false,
                    "replica_count": 1,
                    "ready_replica_count": 1,
                    "cpu_cores": 0.12,
                    "cpu_limit_cores": 1,
                    "cpu_percent": 12,
                    "memory_bytes": 167772160,
                    "memory_limit_bytes": 536870912,
                    "memory_percent": 31.25,
                    "network_rx_bytes_per_sec": 2048.5,
                    "network_tx_bytes_per_sec": 8192.25,
                    "sampled_at": "2026-11-18T15:29:30Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/metrics/history": {
      "get": {
        "operationId": "getDeploymentMetricHistory",
        "summary": "Get deployment metric history",
        "x-slug": "get-deployment-metric-history",
        "description": "Returns resource samples for the chosen time range, oldest first. At most the 2,000 most\nrecent samples in the range are returned. `step_seconds` is the suggested chart resolution\nfor the range; the points themselves are the raw samples.\n\nWhen no samples exist in the range, `available` is `false`, `points` is empty and `latest`\nis `null`.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentMetricsRange"
          }
        ],
        "responses": {
          "200": {
            "description": "The metric history.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentMetricsHistory"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                    "available": true,
                    "stale": false,
                    "range": "1h",
                    "step_seconds": 60,
                    "latest": {
                      "timestamp": "2026-11-18T15:29:30Z",
                      "replica_count": 1,
                      "ready_replica_count": 1,
                      "cpu_cores": 0.12,
                      "memory_bytes": 167772160,
                      "network_rx_bytes_per_sec": 2048.5,
                      "network_tx_bytes_per_sec": 8192.25
                    },
                    "points": [
                      {
                        "timestamp": "2026-11-18T15:28:30Z",
                        "replica_count": 1,
                        "ready_replica_count": 1,
                        "cpu_cores": 0.1,
                        "memory_bytes": 165675008,
                        "network_rx_bytes_per_sec": 1980,
                        "network_tx_bytes_per_sec": 7900.5
                      },
                      {
                        "timestamp": "2026-11-18T15:29:30Z",
                        "replica_count": 1,
                        "ready_replica_count": 1,
                        "cpu_cores": 0.12,
                        "memory_bytes": 167772160,
                        "network_rx_bytes_per_sec": 2048.5,
                        "network_tx_bytes_per_sec": 8192.25
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "`range` is not one of the allowed values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invalid metrics range",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/traffic": {
      "get": {
        "operationId": "getDeploymentTraffic",
        "summary": "Get deployment traffic",
        "x-slug": "get-deployment-traffic",
        "description": "Returns HTTP traffic served through the deployment's public route over the chosen range:\nrequest and 5xx error counts per time bucket, totals, the error rate and bytes in and\nout. Traffic on the platform hostname and on all custom domains is added together.\n\nWhen traffic data cannot be read (not available in this environment, the app has no public\nroute, or the metrics backend is temporarily down), the response is still `200` with\n`available: false` and a reason in `unavailable_reason`.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          },
          {
            "$ref": "#/components/parameters/DeploymentMetricsRange"
          }
        ],
        "responses": {
          "200": {
            "description": "The traffic summary.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DeploymentTraffic"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "deployment_uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                    "available": true,
                    "range": "1h",
                    "step_seconds": 60,
                    "requests_total": 1520,
                    "errors_total": 4,
                    "error_rate": 0.0026315789,
                    "rx_bytes": 1843200,
                    "tx_bytes": 52428800,
                    "points": [
                      {
                        "timestamp": "2026-11-18T15:28:00Z",
                        "requests": 26,
                        "errors": 0
                      },
                      {
                        "timestamp": "2026-11-18T15:29:00Z",
                        "requests": 31,
                        "errors": 1
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "`range` is not one of the allowed values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invalid metrics range",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/deployments/{uid}/firewall-policies": {
      "get": {
        "operationId": "listDeploymentFirewallPolicies",
        "summary": "List deployment firewall policies",
        "x-slug": "list-deployment-firewall-policies",
        "description": "Returns the firewall policies attached to the deployment, with their rules and every\nresource each policy is attached to. Inbound allow rules on public traffic are enforced at\nthe edge.\n",
        "tags": [
          "Deployments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DeploymentUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The attached firewall policies.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FirewallPolicy"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9b80-8c9d-7e0f-8a1b-2c3d4e5f6a7b",
                      "name": "Office only",
                      "slug": "office-only",
                      "description": "Allow HTTPS from the office network.",
                      "is_default": false,
                      "rules": [
                        {
                          "operation_id": "",
                          "uid": "019a9b80-8c9e-7f1a-9b2c-3d4e5f6a7b8c",
                          "direction": "inbound",
                          "action": "allow",
                          "protocol": "tcp",
                          "port_start": 443,
                          "port_end": 443,
                          "cidr": "203.0.113.0/24",
                          "description": "Office",
                          "is_default": false
                        }
                      ],
                      "attached_resources": [
                        {
                          "operation_id": "",
                          "uid": "019a9b81-9d0e-7a2b-8c3d-4e5f6a7b8c9d",
                          "resource_type": "deployment",
                          "resource": {
                            "uid": "019a9a10-3b4c-7d5e-8f60-1a2b3c4d5e6f",
                            "name": "acme-api",
                            "slug": "acme-api",
                            "status": "active"
                          }
                        }
                      ],
                      "created_at": "2026-11-10T09:00:00Z",
                      "updated_at": "2026-11-12T16:45:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/apps/templates": {
      "get": {
        "operationId": "listAppTemplates",
        "summary": "List app templates",
        "x-slug": "list-app-templates",
        "description": "Returns the catalog of enabled one-click app templates, sorted by name. Pass a template's\n`slug` as `template` when you [create an app](/api/apps/create-an-app).\n\n`from_monthly_cents` is the starting monthly price: the default web plan, each component's\npinned plan and the included persistent volumes.\n",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The app templates.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AppTemplate"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "slug": "wordpress",
                      "name": "WordPress",
                      "description": "Launch a blog, business site, or online store in minutes. Your site comes with its own private database and durable storage.",
                      "icon": "wordpress",
                      "category": "cms",
                      "default_plan_slug": "deploy-scale",
                      "recommended_plan_slug": "deploy-scale",
                      "components": [
                        "database",
                        "web"
                      ],
                      "component_details": [
                        {
                          "role": "database",
                          "suffix": "db",
                          "plan_slug": "deploy-tiny",
                          "name": "MariaDB"
                        },
                        {
                          "role": "web",
                          "name": "WordPress"
                        }
                      ],
                      "db_default_plan_slug": "deploy-tiny",
                      "versions": [
                        {
                          "name": "WordPress",
                          "version": "7.1"
                        },
                        {
                          "name": "MariaDB",
                          "version": "11.4"
                        }
                      ],
                      "setup_note": "Open it now to finish the WordPress setup wizard (site title, admin account). Do this right away: the first visitor to an unconfigured site could claim it.",
                      "env_docs_url": "https://hub.docker.com/_/wordpress",
                      "from_monthly_cents": 1070
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/apps": {
      "post": {
        "operationId": "createApp",
        "summary": "Create an app",
        "x-slug": "create-an-app",
        "description": "Installs an app from a template. The app and all of its component deployments are created\nat once and every component starts in parallel. The app's `status` moves from\n`provisioning_database` (templates with backing services) or `provisioning_app` to\n`active` once every component is ready, and `public_url` is then set.\n\nIf a component fails, the app becomes `failed` with the reason in `last_failure`, and the\ncomponents that were started are deleted, including their volumes, so nothing keeps\nbilling.\n\nThis is asynchronous. It returns `202 Accepted` with the `operation_id` of the\n`app_provision` operation, which is `running` from the start. Follow it with\n[Get an operation](/api/operations/get-an-operation) or poll\n[Get an app](/api/apps/get-an-app).\n\nThings to know:\n\n- You must accept the acceptable use policy first. Until then this endpoint returns `428`\n  with `action: accept_acceptable_use_policy`.\n- Each component is billed as its own deployment, plus its volume. Apps cannot use the\n  Free plan, because they must stay always on.\n- Component deployments are named after the app, with the template's suffix for backing\n  services (for example `blog` and `blog-db`).\n- Open the app soon after it is live and follow `setup_note`: many apps let the first\n  visitor create the admin account.\n- Send `X-Idempotency` to make retries safe. Repeating a create with the same key returns\n  the original `app_provision` operation with `200 OK` and `is_replay: true`, and no second\n  app is created. The key is checked before anything else, including the past-due check.\n  Reusing it for a different action returns `409` with `action: idempotency_key_reused`.\n",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/AppIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "template",
                  "name"
                ],
                "properties": {
                  "template": {
                    "type": "string",
                    "description": "Slug of an enabled template from [List app templates](/api/apps/list-app-templates). Case-insensitive.",
                    "example": "wordpress"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the app. Leading and trailing spaces are trimmed. The slug is derived from it, with a short suffix added if it is taken in the workspace.",
                    "example": "blog"
                  },
                  "plan_slug": {
                    "type": "string",
                    "description": "Plan for the `web` component (and for any component without a pinned plan), from [List deployment plans](/api/deployments/list-deployment-plans). Defaults to the template's `default_plan_slug`. Free plans are rejected.",
                    "example": "deploy-scale"
                  },
                  "db_plan_slug": {
                    "type": "string",
                    "description": "Plan for the primary database component (suffix `db`). Defaults to the template's `db_default_plan_slug`. Other backing services always use their pinned plan.",
                    "example": "deploy-tiny"
                  }
                }
              },
              "example": {
                "template": "wordpress",
                "name": "blog",
                "plan_slug": "deploy-scale"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replay. The `X-Idempotency` key was already used for a create, so the original `app_provision` operation is returned and nothing new is created. `status` is the operation's current status.",
            "headers": {
              "X-Idempotency-Replay": {
                "description": "Always `true` on a replay.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              },
              "X-Idempotency-Completed": {
                "description": "`true` when the original operation has already finished.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AppOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "existing operation still in progress; not queued again",
                  "data": {
                    "operation_id": "019a9d10-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                    "status": "running",
                    "events_url": "/v1/operations/019a9d10-1a2b-7c3d-8e4f-5a6b7c8d9e0f/events",
                    "is_replay": true,
                    "app": {
                      "uid": "019a9d0f-0a1b-7c2d-9e3f-4a5b6c7d8e9f",
                      "name": "blog",
                      "slug": "blog",
                      "template": "wordpress",
                      "status": "provisioning_app",
                      "created_at": "2026-11-18T16:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "The app was created and provisioning started.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AppOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "app provisioning started",
                  "data": {
                    "operation_id": "019a9d10-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                    "status": "running",
                    "events_url": "/v1/operations/019a9d10-1a2b-7c3d-8e4f-5a6b7c8d9e0f/events",
                    "is_replay": false,
                    "app": {
                      "uid": "019a9d0f-0a1b-7c2d-9e3f-4a5b6c7d8e9f",
                      "name": "blog",
                      "slug": "blog",
                      "template": "wordpress",
                      "status": "provisioning_database",
                      "created_at": "2026-11-18T16:00:00Z",
                      "components": [
                        {
                          "role": "database",
                          "deployment_uid": "019a9d0f-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
                          "name": "blog-db",
                          "status": "building",
                          "plan_slug": "deploy-tiny"
                        },
                        {
                          "role": "web",
                          "deployment_uid": "019a9d0f-2c3d-7e4f-9a5b-6c7d8e9f0a1b",
                          "name": "blog",
                          "status": "building",
                          "plan_slug": "deploy-scale"
                        }
                      ],
                      "public_url": "https://blog.rumptycloud.app",
                      "setup_note": "Open it now to finish the WordPress setup wizard (site title, admin account). Do this right away: the first visitor to an unconfigured site could claim it.",
                      "env_docs_url": "https://hub.docker.com/_/wordpress"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: `invalid request` (malformed JSON, or `template` or `name` missing),\n`unknown app template`, `name is required`, `invalid deployment plan`,\n`deployment plan is not available`, or\n`one-click apps cannot use the Free plan; choose Tiny or a larger plan so the app stays always on`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "unknown app template",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/AppIdempotencyKeyReused"
          },
          "428": {
            "description": "You have not accepted the acceptable use policy yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "acceptable use policy acceptance is required before creating an app",
                  "action": "accept_acceptable_use_policy"
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "409",
          "428"
        ]
      },
      "get": {
        "operationId": "listApps",
        "summary": "List apps",
        "x-slug": "list-apps",
        "description": "Returns the workspace's one-click apps, newest first, with their components. Deleted apps are not included.",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's apps.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/App"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9d0f-0a1b-7c2d-9e3f-4a5b6c7d8e9f",
                      "name": "blog",
                      "slug": "blog",
                      "template": "wordpress",
                      "status": "active",
                      "public_url": "https://blog.rumptycloud.app",
                      "created_at": "2026-11-18T16:00:00Z",
                      "components": [
                        {
                          "role": "database",
                          "deployment_uid": "019a9d0f-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
                          "name": "blog-db",
                          "status": "active",
                          "plan_slug": "deploy-tiny"
                        },
                        {
                          "role": "web",
                          "deployment_uid": "019a9d0f-2c3d-7e4f-9a5b-6c7d8e9f0a1b",
                          "name": "blog",
                          "status": "active",
                          "plan_slug": "deploy-scale"
                        }
                      ],
                      "setup_note": "Open it now to finish the WordPress setup wizard (site title, admin account). Do this right away: the first visitor to an unconfigured site could claim it.",
                      "env_docs_url": "https://hub.docker.com/_/wordpress"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/apps/{uid}": {
      "get": {
        "operationId": "getApp",
        "summary": "Get an app",
        "x-slug": "get-an-app",
        "description": "Returns one app with its components. `public_url` follows the web component, so it\nreflects a custom domain once one is verified on that deployment.\n",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/AppUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The app.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/App"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9d0f-0a1b-7c2d-9e3f-4a5b6c7d8e9f",
                    "name": "blog",
                    "slug": "blog",
                    "template": "wordpress",
                    "status": "active",
                    "public_url": "https://blog.acme.com",
                    "created_at": "2026-11-18T16:00:00Z",
                    "components": [
                      {
                        "role": "database",
                        "deployment_uid": "019a9d0f-1b2c-7d3e-8f4a-5b6c7d8e9f0a",
                        "name": "blog-db",
                        "status": "active",
                        "plan_slug": "deploy-tiny"
                      },
                      {
                        "role": "web",
                        "deployment_uid": "019a9d0f-2c3d-7e4f-9a5b-6c7d8e9f0a1b",
                        "name": "blog",
                        "status": "active",
                        "plan_slug": "deploy-scale"
                      }
                    ],
                    "setup_note": "Open it now to finish the WordPress setup wizard (site title, admin account). Do this right away: the first visitor to an unconfigured site could claim it.",
                    "env_docs_url": "https://hub.docker.com/_/wordpress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "deleteApp",
        "summary": "Delete an app",
        "x-slug": "delete-an-app",
        "description": "Deletes the app and all of its component deployments, **including their persistent\nvolumes and data**. The app and its components are marked deleted straight away (billing\nstops and custom domains are released), and each component's runtime is torn down by its\nown `delete_deployment` operation, web component first.\n\nThe response is `202 Accepted` with `status: deleted` and no `operation_id`. The\ncomponent operations are not returned; you can find them with\n[List operations](/api/operations/list-operations). Because\nthe components are already deleted, they appear in the response with only `role` and\n`deployment_uid`.\n\nConcurrent deletes of the same app are serialized: while one is in progress, another\nrequest returns `409` (`app deletion is already in progress`), unless it carries the same\n`X-Idempotency` key, in which case it gets the first request's result.\n\nSend `X-Idempotency` to make retries safe. The key is recorded when the delete starts,\nso repeating the request with the same key returns `200 OK` with `is_replay: true`,\n`is_completed: true` and `status: deleted` instead of `404`. On a replay the app is gone,\nso `app` only carries `uid`, `name` and `status`. Reusing the key for a different action\nor a different app returns `409` with `action: idempotency_key_reused`.\n",
        "tags": [
          "Apps"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/AppUid"
          },
          {
            "$ref": "#/components/parameters/AppIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Replay. The app was already deleted with this `X-Idempotency` key, so nothing is done again.",
            "headers": {
              "X-Idempotency-Replay": {
                "description": "Always `true` on a replay.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              },
              "X-Idempotency-Completed": {
                "description": "Always `true` for a replayed delete.",
                "schema": {
                  "type": "string",
                  "example": "true"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AppOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "existing operation already finished; not queued again",
                  "data": {
                    "status": "deleted",
                    "is_replay": true,
                    "is_completed": true,
                    "app": {
                      "uid": "019a9d0f-0a1b-7c2d-9e3f-4a5b6c7d8e9f",
                      "name": "blog",
                      "status": "deleted"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "The app was deleted and component teardown was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AppOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "app deletion started",
                  "data": {
                    "status": "deleted",
                    "is_replay": false,
                    "app": {
                      "uid": "019a9d0f-0a1b-7c2d-9e3f-4a5b6c7d8e9f",
                      "name": "blog",
                      "slug": "blog",
                      "template": "wordpress",
                      "status": "deleted",
                      "created_at": "2026-11-18T16:00:00Z",
                      "components": [
                        {
                          "role": "database",
                          "deployment_uid": "019a9d0f-1b2c-7d3e-8f4a-5b6c7d8e9f0a"
                        },
                        {
                          "role": "web",
                          "deployment_uid": "019a9d0f-2c3d-7e4f-9a5b-6c7d8e9f0a1b"
                        }
                      ],
                      "setup_note": "Open it now to finish the WordPress setup wizard (site title, admin account). Do this right away: the first visitor to an unconfigured site could claim it.",
                      "env_docs_url": "https://hub.docker.com/_/wordpress"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The `X-Idempotency` key was already used for a different action or app (`action: idempotency_key_reused`), or another delete of this app is in progress (`app deletion is already in progress`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "app deletion is already in progress",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/git-connections/github-app/install-url": {
      "get": {
        "operationId": "getGitHubAppInstallUrl",
        "summary": "Get the GitHub App install URL",
        "x-slug": "get-the-github-app-install-url",
        "description": "Returns a GitHub URL that installs the RumptyCloud GitHub App and connects it to this\nworkspace. Open the URL in a browser while signed in to GitHub, choose the account or\norganization and the repositories to grant, and confirm.\n\nGitHub then sends the browser back to RumptyCloud, which records the connection for this\nworkspace and redirects to the RumptyCloud console at the `return_to` path. The URL carries\na signed `state` that is valid for **10 minutes**, so request a new one if it expires.\n\nCompleting the install needs a browser. When it is done, the connection appears in\n[List GitHub App installations](/api/git-connections/list-github-app-installations).\n\nRequires the `secrets manage` permission (owner, admin or developer role).\n",
        "tags": [
          "Git Connections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "return_to",
            "in": "query",
            "required": false,
            "description": "Console path to return to after installing, for example `/deployments/new`. Must be a\nrelative path starting with `/`. `github=connected` is added to its query string.\nAbsolute URLs and invalid values are replaced with the default,\n`/deployments/new?github=connected`.\n",
            "schema": {
              "type": "string",
              "example": "/deployments/new"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The install URL.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/GitConnectionInstallUrl"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "url": "https://github.com/apps/rumptycloud/installations/new?state=eyJ1c2VyX3VpZCI6IjAxOWE3YjEwLi4uIn0.3kX9mQ2v8bN1pL7yH4cF6dJ0sA1gE3uR8iOq8Zr3mT1"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "description": "The GitHub App is not configured on the platform, or the install link could not be created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "GitHub App is not configured",
                  "code": 500
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "500"
        ]
      }
    },
    "/v1/git-connections/github-app/installations": {
      "get": {
        "operationId": "listGitHubAppInstallations",
        "summary": "List GitHub App installations",
        "x-slug": "list-github-app-installations",
        "description": "Returns the GitHub accounts and organizations connected to this workspace, most recently\nconnected first.\n\nEach connection lists `dependent_deployments`: the workspace's deployments that build from\nthat GitHub account's repositories and would stop building if the connection were removed.\n\nRequires the `secrets read` permission (owner, admin or developer role).\n",
        "tags": [
          "Git Connections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's GitHub connections. Empty when none are connected.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GitConnectionInstallation"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a8e01-4c5d-7e6f-8a9b-0c1d2e3f4a5b",
                      "provider": "github_app",
                      "installation_id": 58213904,
                      "account_login": "acme-inc",
                      "account_type": "Organization",
                      "repository_selection": "selected",
                      "connected_at": "2026-11-18T09:12:44Z",
                      "connected_by": "ada",
                      "dependent_deployments": [
                        "marketing-site",
                        "api"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/git-connections/github-app/installations/reusable": {
      "get": {
        "operationId": "listReusableGitHubAppInstallations",
        "summary": "List reusable GitHub App installations",
        "x-slug": "list-reusable-github-app-installations",
        "description": "Returns GitHub accounts **you** connected in your other workspaces that are not connected to\nthis workspace yet. Pass a result's `uid` to\n[Link a GitHub App installation](/api/git-connections/link-a-github-app-installation) to\nconnect it here without going through GitHub again.\n\nOnly connections you made yourself are listed, because connecting proved you control that\nGitHub account. Each GitHub installation appears once, even if it is connected to several\nof your workspaces.\n\nRequires the `secrets manage` permission (owner, admin or developer role).\n",
        "tags": [
          "Git Connections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "Connections you can link to this workspace. Empty when there are none.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GitConnectionReusableInstallation"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a5c22-7d8e-7f90-8a1b-2c3d4e5f6a7b",
                      "account_login": "ada-lovelace",
                      "account_type": "User",
                      "workspace_name": "Personal"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/git-connections/github-app/installations/{uid}/link": {
      "post": {
        "operationId": "linkGitHubAppInstallation",
        "summary": "Link a GitHub App installation",
        "x-slug": "link-a-github-app-installation",
        "description": "Connects a GitHub account you already connected in another workspace to this workspace,\nwithout visiting GitHub. Use a `uid` from\n[List reusable GitHub App installations](/api/git-connections/list-reusable-github-app-installations).\nSend no request body.\n\nThe connection is checked with GitHub first. If the app was uninstalled from that GitHub\naccount, the request fails with `409` and you need to connect again with\n[Get the GitHub App install URL](/api/git-connections/get-the-github-app-install-url).\nLinking an account that is already connected here refreshes the existing connection.\n\nRequires the `secrets manage` permission (owner, admin or developer role).\n",
        "tags": [
          "Git Connections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "The `uid` of a connection you made in another workspace, from [List reusable GitHub App installations](/api/git-connections/list-reusable-github-app-installations).",
            "schema": {
              "type": "string",
              "example": "019a5c22-7d8e-7f90-8a1b-2c3d4e5f6a7b"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The GitHub account is now connected to this workspace. No `data` is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "GitHub connected"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "You cannot access the workspace, or your role cannot connect GitHub in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "you don't have permission to connect GitHub in this workspace",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "description": "No GitHub connection with this `uid` was made by you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "GitHub connection was not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The GitHub App is no longer installed on that GitHub account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "this GitHub connection is no longer active; connect GitHub again",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/git-connections/github-app/installations/{uid}": {
      "delete": {
        "operationId": "deleteGitHubAppInstallation",
        "summary": "Disconnect a GitHub App installation",
        "x-slug": "disconnect-a-github-app-installation",
        "description": "Removes a GitHub connection from this workspace. Deployments that build from that GitHub\naccount's repositories (see `dependent_deployments` in\n[List GitHub App installations](/api/git-connections/list-github-app-installations)) can no\nlonger build from git.\n\n**If no other workspace uses the same GitHub installation, the RumptyCloud GitHub App is\nalso uninstalled from the GitHub account or organization.** When other workspaces still\nuse it, only this workspace's connection is removed.\n\nRequires the `workspace manage` permission (owner or admin role).\n",
        "tags": [
          "Git Connections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "The connection's `uid` from [List GitHub App installations](/api/git-connections/list-github-app-installations).",
            "schema": {
              "type": "string",
              "example": "019a8e01-4c5d-7e6f-8a9b-0c1d2e3f4a5b"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The connection was removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "GitHub App uninstalled"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The connection does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "GitHub App installation was not found",
                  "code": 404
                }
              }
            }
          },
          "500": {
            "description": "Uninstalling the app on GitHub or removing the connection failed. The connection is kept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "unable to uninstall GitHub App",
                  "code": 500
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404",
          "500"
        ]
      }
    },
    "/v1/git-connections/github-app/repositories": {
      "get": {
        "operationId": "listGitHubAppRepositories",
        "summary": "List GitHub repositories",
        "x-slug": "list-github-repositories",
        "description": "Returns every repository the GitHub App can access across all of the workspace's GitHub\nconnections. Repositories are grouped by connection, most recently connected first, and a\nrepository reachable through several connections is listed once.\n\nResults are cached for a few minutes. After you change which repositories the app can access\non GitHub, send `refresh=1` to bypass the cache.\n\nRequires the `secrets read` permission (owner, admin or developer role).\n",
        "tags": [
          "Git Connections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "description": "Send `1` or `true` to fetch fresh results from GitHub instead of the cache. Any other value is ignored.",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true"
              ],
              "example": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The repositories the GitHub App can access.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GitConnectionRepository"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "id": 712345678,
                      "name": "marketing-site",
                      "full_name": "acme-inc/marketing-site",
                      "owner": "acme-inc",
                      "private": true,
                      "default_branch": "main",
                      "clone_url": "https://github.com/acme-inc/marketing-site.git",
                      "html_url": "https://github.com/acme-inc/marketing-site",
                      "updated_at": "2026-11-17T16:42:05Z",
                      "installation_id": 58213904,
                      "installation_account": "acme-inc"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No GitHub account is connected to this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "GitHub App is not installed",
                  "code": 404
                }
              }
            }
          },
          "500": {
            "description": "GitHub could not be reached or refused the request for one of the connections.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "unable to load repositories",
                  "code": 500
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404",
          "500"
        ]
      }
    },
    "/v1/git-connections/github-app/branches": {
      "get": {
        "operationId": "listGitHubAppBranches",
        "summary": "List repository branches",
        "x-slug": "list-repository-branches",
        "description": "Returns the branches of a repository the GitHub App can access. The connection used is the\none whose GitHub account matches the repository's owner. Only the first 100 branches that\nGitHub returns are included.\n\nRequires the `secrets read` permission (owner, admin or developer role).\n",
        "tags": [
          "Git Connections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "repo",
            "in": "query",
            "required": true,
            "description": "Repository in `owner/name` form, as in `full_name` from [List GitHub repositories](/api/git-connections/list-github-repositories). Must not contain spaces.",
            "schema": {
              "type": "string",
              "example": "acme-inc/marketing-site"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The repository's branches.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GitConnectionBranch"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "name": "main",
                      "commit_sha": "9f2c4e1a7b3d5f6e8a0b1c2d3e4f5a6b7c8d9e0f",
                      "default": false
                    },
                    {
                      "name": "staging",
                      "commit_sha": "1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b",
                      "default": false
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`repo` is missing or contains spaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "repository is required",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No GitHub account is connected, or none matches the repository's owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "GitHub App is not installed for this repository owner",
                  "code": 404
                }
              }
            }
          },
          "500": {
            "description": "GitHub could not be reached, or the repository is not accessible to the app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "unable to load branches",
                  "code": 500
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "500"
        ]
      }
    },
    "/v1/git-connections/github-app/detect": {
      "get": {
        "operationId": "detectGitHubAppRepository",
        "summary": "Detect a repository's app type",
        "x-slug": "detect-a-repositorys-app-type",
        "description": "Inspects a repository branch's file list and suggests how to build and run it: whether it\nis a `static` site or a `service`, the framework, the root directory (for monorepos) and the\nrecommended build method. Only file names are inspected, not file contents.\n\nHow detection works:\n\n- The repository root and common app folders (`apps/web`, `frontend`, `web`, `api`,\n  `server`, `backend` and so on) are checked, along with every other folder. The best match\n  wins.\n- Framework config files are recognised first, for example Next.js, Nuxt, Remix and\n  SvelteKit (`service`), and Astro, Gatsby, Angular and Vite (`static`). Then Go, Rust,\n  Laravel, PHP, Rails, Ruby, Java, Elixir and Deno projects (`service`). Then generic\n  markers: `package.json`, `requirements.txt`, `pyproject.toml`, `index.php` and\n  `index.html`.\n- A `Dockerfile` in a folder makes `dockerfile` the recommended build method and sets\n  `dockerfile_path`. `railpack` is always supported.\n\nWhen nothing is recognised, `detected` is `false` and `recommended_build_method` is\nomitted.\n\nRequires the `secrets read` permission (owner, admin or developer role).\n",
        "tags": [
          "Git Connections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "repo",
            "in": "query",
            "required": true,
            "description": "Repository in `owner/name` form. Must not contain spaces.",
            "schema": {
              "type": "string",
              "example": "acme-inc/marketing-site"
            }
          },
          {
            "name": "branch",
            "in": "query",
            "required": false,
            "description": "Branch to inspect. Defaults to `main`.",
            "schema": {
              "type": "string",
              "default": "main",
              "example": "main"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The detection result.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/GitConnectionDetection"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "detected": true,
                    "app_type": "service",
                    "framework": "Next.js",
                    "recommended_build_method": "dockerfile",
                    "supported_build_methods": [
                      "railpack",
                      "dockerfile"
                    ],
                    "root_directory": "apps/web",
                    "dockerfile_path": "apps/web/Dockerfile",
                    "message": "Next.js app detected. It needs a server, so we'll run it as a service. We found a Dockerfile and will use it. Switch to Auto if you want Rumpty to pick the build."
                  }
                }
              }
            }
          },
          "400": {
            "description": "`repo` is missing or contains spaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "repository is required",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No GitHub account is connected, or none matches the repository's owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "GitHub App is not installed for this repository owner",
                  "code": 404
                }
              }
            }
          },
          "500": {
            "description": "GitHub could not be reached, or the repository or branch is not accessible to the app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "unable to inspect repository",
                  "code": 500
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "500"
        ]
      }
    },
    "/v1/databases/plans": {
      "get": {
        "operationId": "listDatabasePlans",
        "summary": "List database plans",
        "x-slug": "list-database-plans",
        "description": "Returns the database plans that are currently available, grouped by zone and sorted\ncheapest first. Plans are per engine: use a plan whose `engine` matches the engine you\ncreate. A plan with `monthly_price_cents` of `0` is a free plan and counts toward the\n[free database quota](/api/databases/get-the-free-database-quota).\n\nThis endpoint is public and needs no API key or workspace.\n",
        "tags": [
          "Databases"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The available database plans.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DatabasePlan"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "0199e0b4-6a7b-7c8d-9e0f-1a2b3c4d5e6f",
                      "name": "Playground",
                      "slug": "database-playground-olas-closet",
                      "product": "database",
                      "engine": "postgres",
                      "zone_slug": "olas-closet",
                      "vcpu": 1,
                      "cpu_request_millis": 50,
                      "cpu_limit_millis": 500,
                      "memory_mib": 256,
                      "included_disk_gib": 1,
                      "included_egress_gib": 10,
                      "network_ingress_mbit": 25,
                      "network_egress_mbit": 25,
                      "monthly_price_cents": 0,
                      "hourly_price_cents": 0,
                      "hourly_price_micros": 0,
                      "currency": "USD",
                      "available": true
                    },
                    {
                      "uid": "0199e0b4-6a7c-7d8e-9f01-2b3c4d5e6f70",
                      "name": "Seed",
                      "slug": "database-seed-olas-closet",
                      "product": "database",
                      "engine": "postgres",
                      "zone_slug": "olas-closet",
                      "vcpu": 1,
                      "cpu_request_millis": 100,
                      "cpu_limit_millis": 750,
                      "memory_mib": 512,
                      "included_disk_gib": 5,
                      "included_egress_gib": 50,
                      "network_ingress_mbit": 50,
                      "network_egress_mbit": 50,
                      "monthly_price_cents": 185,
                      "hourly_price_cents": 0,
                      "hourly_price_micros": 2534,
                      "currency": "USD",
                      "available": true
                    }
                  ]
                }
              }
            }
          }
        },
        "x-response-order": [
          "200"
        ]
      }
    },
    "/v1/databases/versions": {
      "get": {
        "operationId": "listDatabaseVersions",
        "summary": "List database versions",
        "x-slug": "list-database-versions",
        "description": "Returns the engine versions you can create a database with, one entry per engine and\nversion. Pass `engine` and `version` from this list to\n[Create a database](/api/databases/create-a-database).\n\nEngines are `postgres`, `mysql` and `redis`. The `redis` engine runs Valkey, a\nRedis-compatible server.\n\nThis endpoint is public and needs no API key or workspace.\n",
        "tags": [
          "Databases"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The available engine versions.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DatabaseVersion"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "0199e0b2-3c4d-7e5f-8a6b-7c8d9e0f1a2b",
                      "engine": "mysql",
                      "version": "8.4",
                      "architecture": "amd64",
                      "available": true
                    },
                    {
                      "uid": "0199e0b2-3c4e-7f60-9b7c-8d9e0f1a2b3c",
                      "engine": "postgres",
                      "version": "17",
                      "architecture": "amd64",
                      "available": true
                    },
                    {
                      "uid": "0199e0b2-3c4f-7071-8c8d-9e0f1a2b3c4d",
                      "engine": "redis",
                      "version": "8.1",
                      "architecture": "amd64",
                      "available": true
                    }
                  ]
                }
              }
            }
          }
        },
        "x-response-order": [
          "200"
        ]
      }
    },
    "/v1/databases": {
      "get": {
        "operationId": "listDatabases",
        "summary": "List databases",
        "x-slug": "list-databases",
        "description": "Returns the workspace's databases, newest first. Deleted databases are not included, but\ndatabases that are still `deleting` or that `failed` are.\n\nWithout query parameters, every database is returned in `data`. Send `page` or\n`page_size` to paginate. A top-level `pagination` object is then added next to `data`,\nand `q` filters the results. `q` is ignored unless `page` or `page_size` is present.\n\nList responses never include the password. Use\n[Get database credentials](/api/databases/get-database-credentials) for that.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1. Values below 1 (or non-numbers) are treated as `1`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Items per page. Defaults to `10`. Values above `100` are capped at `100`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "example": 20
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search across the database's name, slug, engine, version, host, status and display status. Only applied when paginating.",
            "schema": {
              "type": "string",
              "example": "orders"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's databases. `pagination` is only present when `page` or `page_size` was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Database"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/DatabasePagination"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "name": "orders-db",
                      "slug": "orders-db",
                      "engine": "postgres",
                      "version": "17",
                      "status": "ready",
                      "display_status": "ready",
                      "plan_slug": "database-seed-olas-closet",
                      "zone_slug": "olas-closet",
                      "storage_gib": 5,
                      "vcpu": 1,
                      "cpu_limit_millis": 750,
                      "memory_mib": 512,
                      "host": "pg-1c2d3e.ws-acme.db.rumptycloud.com",
                      "port": 5432,
                      "database_name": "orders_db",
                      "username": "postgres",
                      "connection_string": "postgresql://postgres@pg-1c2d3e.ws-acme.db.rumptycloud.com:5432/orders_db?sslmode=require",
                      "internal_host": "pg-1c2d3e.db.rumpty.internal",
                      "internal_connection_string": "postgresql://postgres@pg-1c2d3e.db.rumpty.internal:5432/orders_db?sslmode=require",
                      "public_access": true,
                      "created_at": "2026-11-18T09:12:44Z"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 20,
                    "total": 1,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      },
      "post": {
        "operationId": "createDatabase",
        "summary": "Create a database",
        "x-slug": "create-a-database",
        "description": "Queues a new database and returns `202 Accepted` with the `operation_id` of the create\noperation. The database starts in `provisioning` and becomes `ready` when the operation\nsucceeds. Poll [Get an operation](/api/operations/get-an-operation) or\n[Get a database](/api/databases/get-a-database) to follow it.\n\n**The response contains the generated password** in `database.password`, and in\n`database.connection_string` and `database.internal_connection_string`. You can read it\nagain later with [Get database credentials](/api/databases/get-database-credentials).\n\nThings to know:\n\n- Pick `engine` and `version` from [List database versions](/api/databases/list-database-versions)\n  and a `plan_slug` for the same engine from [List database plans](/api/databases/list-database-plans).\n  `engine` is case-insensitive and `postgresql` is accepted as `postgres`.\n- The engine's default user is created for you: `postgres` for PostgreSQL, `rumpty` for\n  MySQL and `default` for Redis. For PostgreSQL and MySQL the database name is the name's\n  slug with `-` replaced by `_` (for example `orders-db` becomes `orders_db`).\n- PostgreSQL databases always get a public hostname on port `5432`. MySQL and Redis\n  databases only get a public hostname when `public_access` is `true`. They are then\n  reached on a dedicated port, returned as `public_port`. Public Redis connections use TLS\n  (`rediss://`). Private databases are reachable only through `internal_host` from\n  workloads running on RumptyCloud.\n- Free plans (`monthly_price_cents` of `0`) are limited to 2 active databases per account,\n  across every engine and workspace. Check [Get the free database quota](/api/databases/get-the-free-database-quota).\n- Names are not required to be unique, but must contain at least one letter or digit.\n- To create a database from a snapshot, send `snapshot_uid`. The engine, version and plan\n  are then taken from the snapshot's source database (your `engine`, `version` and\n  `plan_slug` are ignored), as are the database name and user. Storage is at least the\n  source database's storage. Only snapshots of container-runtime databases can be used.\n\n`X-Idempotency` is optional. If you repeat a create with a key you already used for a\ndatabase create, the original operation is returned with `200 OK`, `is_replay: true` and\nthe `X-Idempotency-Replay` header, and nothing new is queued. The replay is checked before\nanything else (billing, validation, quota), so a retry still gets the original result.\nThe `name` is compared by slug: the same key with a different name returns `409` with\n`action: idempotency_key_reused`, as does using the key for another action. A replay does\nnot include the password.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name of the database. Leading and trailing spaces are trimmed. Its slug is used for the default database name.",
                    "example": "orders-db"
                  },
                  "engine": {
                    "type": "string",
                    "enum": [
                      "postgres",
                      "postgresql",
                      "mysql",
                      "redis"
                    ],
                    "description": "Database engine. Case-insensitive; `postgresql` is treated as `postgres`. `redis` runs Valkey. Required unless `snapshot_uid` is set.",
                    "example": "postgres"
                  },
                  "version": {
                    "type": "string",
                    "description": "Engine version from [List database versions](/api/databases/list-database-versions). Required unless `snapshot_uid` is set.",
                    "example": "17"
                  },
                  "plan_slug": {
                    "type": "string",
                    "description": "Slug of an available database plan for the same engine. Case-insensitive. Required unless `snapshot_uid` is set.",
                    "example": "database-seed-olas-closet"
                  },
                  "zone_slug": {
                    "type": "string",
                    "description": "Optional zone. When set it must match the plan's zone, otherwise the request fails. The database always runs in the plan's zone.",
                    "example": "olas-closet"
                  },
                  "public_access": {
                    "type": "boolean",
                    "default": false,
                    "description": "Give a MySQL or Redis database a public hostname and port. PostgreSQL databases always get a public hostname; the value is still stored and returned."
                  },
                  "snapshot_uid": {
                    "type": "string",
                    "description": "UID of an `available` database snapshot in this workspace to create the database from. See the notes above.",
                    "example": "019a9d40-2b3c-7d4e-8f5a-6b7c8d9e0f1a"
                  }
                }
              },
              "example": {
                "name": "orders-db",
                "engine": "postgres",
                "version": "17",
                "plan_slug": "database-seed-olas-closet"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DatabaseOperationReplay"
          },
          "202": {
            "description": "The create operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "database create request queued",
                  "data": {
                    "operation_id": "019a9b10-5c6f-7a01-8b2c-3d4e5f6a7b8c",
                    "database": {
                      "uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "name": "orders-db",
                      "slug": "orders-db",
                      "engine": "postgres",
                      "version": "17",
                      "status": "provisioning",
                      "display_status": "provisioning",
                      "plan_slug": "database-seed-olas-closet",
                      "zone_slug": "olas-closet",
                      "storage_gib": 5,
                      "vcpu": 1,
                      "cpu_limit_millis": 750,
                      "memory_mib": 512,
                      "host": "pg-1c2d3e.ws-acme.db.rumptycloud.com",
                      "port": 5432,
                      "database_name": "orders_db",
                      "username": "postgres",
                      "password": "Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ",
                      "connection_string": "postgresql://postgres:Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ@pg-1c2d3e.ws-acme.db.rumptycloud.com:5432/orders_db?sslmode=require",
                      "internal_host": "pg-1c2d3e.db.rumpty.internal",
                      "internal_connection_string": "postgresql://postgres:Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ@pg-1c2d3e.db.rumpty.internal:5432/orders_db?sslmode=require",
                      "public_access": false,
                      "created_at": "2026-11-18T09:12:44Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9b10-5c6f-7a01-8b2c-3d4e5f6a7b8c/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages: `invalid request` (malformed JSON or missing\n`name`), `name is required`, `name, engine, version, and plan_slug are required`,\n`that database engine isn't available yet`, `invalid database plan`,\n`selected plan is not available for that database engine`,\n`selected database plan is not available in that zone`, `invalid database version`,\n`that database version isn't available yet`,\n`database name must contain alphanumeric characters`, `invalid snapshot`,\n`snapshot source plan is unavailable`, or\n`create-from-snapshot is only supported for container-runtime database snapshots`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "name, engine, version, and plan_slug are required",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "description": "You cannot create resources in this workspace, or the account already has the maximum number of free databases.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "You've reached the limit of 2 free databases for your account. Delete one, or choose a paid plan to create another.",
                  "code": 403
                }
              }
            }
          },
          "409": {
            "description": "The snapshot is not `available` (`snapshot is not ready to restore`), or the `X-Idempotency` key was already used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "idempotency key was already used for a different operation; use a new X-Idempotency value",
                  "code": 409,
                  "action": "idempotency_key_reused"
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "409"
        ]
      }
    },
    "/v1/databases/free-quota": {
      "get": {
        "operationId": "getFreeDatabaseQuota",
        "summary": "Get the free database quota",
        "x-slug": "get-the-free-database-quota",
        "description": "Returns how many free-plan databases the account can still create. The limit is per\naccount (the workspace owner's account for workspace requests) and spans every engine\nand workspace. Databases that are `failed` or deleted do not count.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The free database quota.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseFreeQuota"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "limit": 2,
                    "used": 1,
                    "remaining": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/databases/{uid}": {
      "get": {
        "operationId": "getDatabase",
        "summary": "Get a database",
        "x-slug": "get-a-database",
        "description": "Returns one database. The password is never included; `connection_string` and\n`internal_connection_string` contain the user but no password. Use\n[Get database credentials](/api/databases/get-database-credentials) to read it.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The database.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Database"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9c22-1d2e-7f30-8a41-5b6c7d8e9f0a",
                    "name": "sessions-cache",
                    "slug": "sessions-cache",
                    "engine": "redis",
                    "version": "8.1",
                    "status": "ready",
                    "display_status": "ready",
                    "plan_slug": "database-redis-seed-olas-closet",
                    "zone_slug": "olas-closet",
                    "storage_gib": 2,
                    "vcpu": 1,
                    "cpu_limit_millis": 750,
                    "memory_mib": 512,
                    "host": "db-5b6c7d.ws-acme.db.rumptycloud.com",
                    "port": 6379,
                    "username": "default",
                    "connection_string": "rediss://default@db-5b6c7d.ws-acme.db.rumptycloud.com:31842",
                    "internal_host": "db-5b6c7d.db.rumpty.internal",
                    "internal_connection_string": "redis://default@db-5b6c7d.db.rumpty.internal:6379",
                    "public_access": true,
                    "public_port": 31842,
                    "created_at": "2026-11-17T15:40:02Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "deleteDatabase",
        "summary": "Delete a database",
        "x-slug": "delete-a-database",
        "description": "Queues deletion of the database and returns `202 Accepted`. The database moves to\n`deleting` straight away and is removed from listings once the operation succeeds. If the\ndelete fails, the database moves to `failed`. Follow the operation with\n[Get an operation](/api/operations/get-an-operation).\n\nAll data is destroyed. The database's snapshots are kept: they are detached from the\ndatabase and can still be listed with [List database snapshots](/api/databases/list-database-snapshots),\nused to create a new database, or deleted.\n\nThe database can be deleted in any status except already deleted. Without\n`X-Idempotency`, each call queues a new delete operation until the database is gone. With\na key, a retry returns the original operation with `200 OK` and `is_replay: true`, even\nafter the database has been deleted (`database.status` is then `deleted`).\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "$ref": "#/components/parameters/DatabaseIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DatabaseOperationReplay"
          },
          "202": {
            "description": "The delete operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "database delete request queued",
                  "data": {
                    "operation_id": "019a9e01-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                    "database": {
                      "uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "name": "orders-db",
                      "slug": "orders-db",
                      "engine": "postgres",
                      "version": "17",
                      "status": "deleting",
                      "display_status": "deleting",
                      "plan_slug": "database-seed-olas-closet",
                      "zone_slug": "olas-closet",
                      "storage_gib": 5,
                      "vcpu": 1,
                      "cpu_limit_millis": 750,
                      "memory_mib": 512,
                      "host": "pg-1c2d3e.ws-acme.db.rumptycloud.com",
                      "port": 5432,
                      "database_name": "orders_db",
                      "username": "postgres",
                      "connection_string": "postgresql://postgres@pg-1c2d3e.ws-acme.db.rumptycloud.com:5432/orders_db?sslmode=require",
                      "internal_host": "pg-1c2d3e.db.rumpty.internal",
                      "internal_connection_string": "postgresql://postgres@pg-1c2d3e.db.rumpty.internal:5432/orders_db?sslmode=require",
                      "public_access": false,
                      "created_at": "2026-11-18T09:12:44Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9e01-7a8b-7c9d-8e0f-1a2b3c4d5e6f/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DatabaseIdempotencyKeyReused"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/credentials": {
      "get": {
        "operationId": "getDatabaseCredentials",
        "summary": "Get database credentials",
        "x-slug": "get-database-credentials",
        "description": "**Returns secrets.** The response contains the database password in plain text and\nconnection strings with the password embedded. Treat it like the password itself: do\nnot log it or store it in plain text.\n\nRequires the `secrets read` permission (owner, admin or developer role). Viewers get\n`403`. Works in any status, including while the database is still provisioning.\n\n`connection_string` is the public endpoint and is an empty string for a private MySQL or\nRedis database. `internal_connection_string` only works from workloads running on\nRumptyCloud. `ca_certificate` is the PEM certificate to verify the server's TLS\ncertificate (for example `sslrootcert` for PostgreSQL or `--cacert` for `redis-cli`).\n\nAfter a successful [password rotation](/api/databases/rotate-the-database-password), this\nreturns the new password.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The database credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseCredentials"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "username": "postgres",
                    "password": "Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ",
                    "connection_string": "postgresql://postgres:Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ@pg-1c2d3e.ws-acme.db.rumptycloud.com:5432/orders_db?sslmode=require",
                    "internal_connection_string": "postgresql://postgres:Xq3vN8kR2mT7pL0wB5cY9sH4dF6gJ1aZ@pg-1c2d3e.db.rumpty.internal:5432/orders_db?sslmode=require",
                    "ca_certificate": "-----BEGIN CERTIFICATE-----\nMIIBszCCAVmgAwIBAgIQGx7bX1n0v6c3sQk2m9yZ4DAKBggqhkjOPQQDAjAWMRQw\n...\n-----END CERTIFICATE-----\n"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/databases/{uid}/data/tables": {
      "get": {
        "operationId": "listDatabaseTables",
        "summary": "List database tables",
        "x-slug": "list-database-tables",
        "description": "Lists the tables and views in a PostgreSQL or MySQL database, for use with\n[Browse table rows](/api/databases/browse-table-rows). Redis databases have no tables;\nuse [List keys](/api/databases/list-keys) instead.\n\n- PostgreSQL: tables, partitioned tables, views, materialized views and foreign tables\n  in every schema except the system schemas, limited to those the database user can\n  `SELECT`. Partitions are left out. Tables in `public` come first.\n- MySQL: tables and views in every schema except `mysql`, `information_schema`,\n  `performance_schema` and `sys`. Tables in the database's own schema come first.\n- At most 2000 entries are returned.\n\nThe database must be `ready`. Data browser calls share a small platform-wide pool of\nconnections; when it is full you get `409` and should retry shortly. Requires the\n`secrets read` permission (owner, admin or developer role).\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The tables and views.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DatabaseTable"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "schema": "public",
                      "name": "customers",
                      "kind": "table",
                      "estimated_rows": 1840
                    },
                    {
                      "schema": "public",
                      "name": "orders",
                      "kind": "table",
                      "estimated_rows": 12650
                    },
                    {
                      "schema": "public",
                      "name": "recent_orders",
                      "kind": "view",
                      "estimated_rows": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request failed. Possible messages: `this database has no tables, browse its keys\ninstead` (Redis), `the data viewer doesn't support this database engine`,\n`the database rejected the connection: <reason>`, or an error from the database.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "this database has no tables, browse its keys instead",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DatabaseDataUnavailable"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/data/rows": {
      "get": {
        "operationId": "browseDatabaseTable",
        "summary": "Browse table rows",
        "x-slug": "browse-table-rows",
        "description": "Returns one page of rows from a PostgreSQL or MySQL table or view, as\n`SELECT * FROM <schema>.<table> LIMIT <limit> OFFSET <offset>` in a read-only\ntransaction. Rows have no defined order.\n\n`truncated` is `true` when more rows exist after this page (or when the response hit the\n4 MiB size cap). The response shape and limits are the same as for\n[Run a read-only query](/api/databases/run-a-read-only-query).\n\nThe database must be `ready`. Requires the `secrets read` permission (owner, admin or\ndeveloper role).\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "name": "schema",
            "in": "query",
            "required": true,
            "description": "Schema of the table, as returned by [List database tables](/api/databases/list-database-tables). For MySQL this is the database (schema) name.",
            "schema": {
              "type": "string",
              "example": "public"
            }
          },
          {
            "name": "table",
            "in": "query",
            "required": true,
            "description": "Name of the table or view. Quoted for you, so pass it exactly as listed.",
            "schema": {
              "type": "string",
              "example": "orders"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows per page. Defaults to `50`. Values above `200` are capped at `200`. Zero, negative or non-numeric values use the default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "example": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Rows to skip. Defaults to `0`. Negative or non-numeric values are treated as `0`.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "example": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of rows.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseQueryResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "columns": [
                      {
                        "name": "id",
                        "type": "int8"
                      },
                      {
                        "name": "customer_id",
                        "type": "int8"
                      },
                      {
                        "name": "total_cents",
                        "type": "int4"
                      },
                      {
                        "name": "note",
                        "type": "text"
                      },
                      {
                        "name": "created_at",
                        "type": "timestamptz"
                      }
                    ],
                    "rows": [
                      [
                        "1",
                        "42",
                        "2599",
                        null,
                        "2026-11-02 08:15:00+00"
                      ],
                      [
                        "2",
                        "17",
                        "1250",
                        "gift wrap",
                        "2026-11-02 09:41:12+00"
                      ]
                    ],
                    "row_count": 2,
                    "truncated": true,
                    "duration_ms": 6
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation or query failed. Possible messages: `schema and table are required`, `invalid table name`, `this database has no tables, browse its keys instead`, or the database's own error, such as a missing table.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "relation \"public.order\" does not exist",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DatabaseDataUnavailable"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/data/query": {
      "post": {
        "operationId": "runDatabaseQuery",
        "summary": "Run a read-only query",
        "x-slug": "run-a-read-only-query",
        "description": "Runs **one** read-only statement against the database and returns the result as a grid.\nNothing you run here can change data.\n\n**PostgreSQL**\n\n- The statement runs in a `READ ONLY` transaction that is never committed, with\n  `default_transaction_read_only` on. Writes (`INSERT`, `UPDATE`, `DELETE`, DDL and so on)\n  fail with `400` and a message starting `the data viewer is read-only:`.\n- Only a single statement is accepted. A string with several statements is rejected by\n  the server.\n- `statement_timeout` is 15 seconds and `lock_timeout` 3 seconds.\n- Values are returned in PostgreSQL text format, and column `type` is the PostgreSQL type\n  name (for example `int4`, `text`, `timestamptz`).\n\n**MySQL**\n\n- The session and transaction are read-only and multi-statement strings are not allowed.\n  Writes fail with `400` and a message starting `the data viewer is read-only:`.\n- `max_execution_time` is 15 seconds and lock waits time out after 3 seconds.\n- Binary columns (`BINARY`, `VARBINARY`, `BLOB` types, `BIT`, `GEOMETRY`) are returned as\n  `0x`-prefixed hex. Column `type` is the lower-case MySQL type name.\n\n**Redis (Valkey)**\n\n- `sql` holds one command line, split like `redis-cli` does: words separated by spaces,\n  with `\"double\"` (supporting `\\n`, `\\t`, `\\\"` and `\\xHH`) or `'single'` quotes.\n- Only read-only commands are allowed: `PING`, `ECHO`, `TIME`, `DBSIZE`, `INFO`,\n  `LASTSAVE`, `TYPE`, `EXISTS`, `TTL`, `PTTL`, `EXPIRETIME`, `PEXPIRETIME`, `SCAN`,\n  `RANDOMKEY`, `OBJECT ENCODING|FREQ|IDLETIME|REFCOUNT|HELP`, `MEMORY USAGE|STATS|HELP`,\n  `GET`, `MGET`, `STRLEN`, `GETRANGE`, `SUBSTR`, `LCS`, `GETBIT`, `BITCOUNT`, `BITPOS`,\n  `BITFIELD_RO`, the read-only hash, list, set, sorted set and geo commands (`HGET`,\n  `HGETALL`, `HSCAN`, `LRANGE`, `LLEN`, `SMEMBERS`, `SSCAN`, `ZRANGE`, `ZSCORE`, `ZSCAN`,\n  `GEOSEARCH` and similar), `XRANGE`, `XREVRANGE`, `XLEN`, `XPENDING`,\n  `XINFO STREAM|GROUPS|CONSUMERS|HELP` and `SORT_RO`. Anything else returns `400`.\n- `db` selects the logical database, `0` to `15`.\n- Replies are shaped into columns: `INFO` becomes `section`, `key`, `value`; `HGETALL`\n  and `HSCAN` become `field`, `value`; `WITHSCORES` replies and `ZSCAN` become `member`,\n  `score`; other arrays become `#`, `value`; single values become one `value` row. For\n  `SCAN`-family commands, `command` is `next cursor <n>`. Nested arrays are returned as\n  JSON strings. Column `type` is an empty string.\n- The whole reply is capped at 8 MB. Larger replies fail with `400`; use a `SCAN` command\n  or a narrower range.\n\n**Limits for all engines**\n\n- `sql` can be at most 64 KiB.\n- At most 500 rows are returned. Results also stop once about 4 MiB of cell data has been\n  read (SQL engines). When either cap is hit, `truncated` is `true`.\n- Each cell is cut at 8 KiB, ending with `…`.\n- `null` in `rows` means SQL `NULL` (or a nil Redis reply).\n- The database must be `ready`, and data browser calls share a small platform-wide pool\n  of connections (`409` when busy).\n\nRequires the `secrets read` permission (owner, admin or developer role). Requests made with\nan `mcp`-scoped API key (AI assistants) return `403` unless command access is turned on in\nthe workspace settings. The first 1000 characters of `sql` are recorded in the workspace\naudit log.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sql"
                ],
                "properties": {
                  "sql": {
                    "type": "string",
                    "maxLength": 65536,
                    "description": "One SQL statement (PostgreSQL, MySQL) or one command line (Redis). Leading and trailing whitespace is trimmed.",
                    "example": "SELECT id, total_cents FROM orders ORDER BY created_at DESC LIMIT 2"
                  },
                  "db": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 15,
                    "default": 0,
                    "description": "Redis logical database to run the command against. Ignored for PostgreSQL and MySQL.",
                    "example": 0
                  }
                }
              },
              "examples": {
                "postgres": {
                  "summary": "PostgreSQL",
                  "value": {
                    "sql": "SELECT id, total_cents FROM orders ORDER BY created_at DESC LIMIT 2"
                  }
                },
                "redis": {
                  "summary": "Redis",
                  "value": {
                    "sql": "HGETALL session:8f2c",
                    "db": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The statement's result.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseQueryResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "columns": [
                      {
                        "name": "id",
                        "type": "int8"
                      },
                      {
                        "name": "total_cents",
                        "type": "int4"
                      }
                    ],
                    "rows": [
                      [
                        "12650",
                        "4999"
                      ],
                      [
                        "12649",
                        "1250"
                      ]
                    ],
                    "row_count": 2,
                    "truncated": false,
                    "command": "SELECT 2",
                    "duration_ms": 4
                  }
                }
              }
            }
          },
          "400": {
            "description": "The query was rejected or failed. Possible messages: `sql is required` (also sent for\nmalformed JSON), `query is too long`, `the data viewer is read-only: <reason>`,\n`the query was cancelled because it took too long`,\n`the command was cancelled because it took too long`,\n`<COMMAND> isn't available in the data viewer, which only runs read-only commands`,\n`unbalanced quotes in command`, `closing quote must be followed by a space`,\n`command is required`, `db must be between 0 and 15`,\n`the reply is larger than 8 MB, use a SCAN command or a narrower range`,\n`the database rejected the connection: <reason>`, or the database's own error message\n(PostgreSQL errors include the detail in brackets when there is one).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "the data viewer is read-only: cannot execute DELETE in a read-only transaction",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your role cannot read secrets, or the request used an `mcp`-scoped API key and command access is turned off for the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "running queries from AI assistants is turned off for this workspace; a workspace owner or admin can turn on command access in workspace settings"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DatabaseDataUnavailable"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/data/keys": {
      "get": {
        "operationId": "listDatabaseKeys",
        "summary": "List keys",
        "x-slug": "list-keys",
        "description": "Scans the keys of a Redis (Valkey) database with `SCAN` and returns their type and TTL.\nOnly available for Redis databases; other engines return `400`.\n\nOne call runs up to 20 `SCAN` rounds of 500 until at least 100 keys are found or the scan\ncompletes, so a page can hold more or fewer than 100 keys. Keys in a page are sorted by\nname. Pass the returned `cursor` back to continue; `\"0\"` means the whole keyspace has been\ncovered. As with any `SCAN`, a key may appear on more than one page.\n\nKey names that are not valid UTF-8 are shown escaped in `key` and given exactly in\n`raw_b64`. Use `raw_b64` with `key_b64` on [Get a key](/api/databases/get-a-key).\n\nThe database must be `ready`. Requires the `secrets read` permission (owner, admin or\ndeveloper role).\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "name": "pattern",
            "in": "query",
            "required": false,
            "description": "Glob-style `MATCH` pattern. Defaults to `*`. At most 1024 characters.",
            "schema": {
              "type": "string",
              "default": "*",
              "maxLength": 1024,
              "example": "session:*"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Cursor from a previous response. Omit (or send `0`) to start a new scan.",
            "schema": {
              "type": "string",
              "example": "1792"
            }
          },
          {
            "$ref": "#/components/parameters/DatabaseRedisDb"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of keys.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseKeyList"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "keys": [
                      {
                        "key": "session:8f2c",
                        "type": "hash",
                        "ttl_ms": 3542117
                      },
                      {
                        "key": "session:9a41",
                        "type": "hash",
                        "ttl_ms": 1208840
                      },
                      {
                        "key": "queue:emails",
                        "type": "list",
                        "ttl_ms": -1
                      }
                    ],
                    "cursor": "0",
                    "db": 0,
                    "keyspaces": [
                      {
                        "db": 0,
                        "keys": 3
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request failed. Possible messages: `key browsing is only available for Valkey databases`, `pattern is too long`, `invalid cursor`, `db must be between 0 and 15`, or an error from the server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "key browsing is only available for Valkey databases",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DatabaseDataUnavailable"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/data/key": {
      "get": {
        "operationId": "getDatabaseKey",
        "summary": "Get a key",
        "x-slug": "get-a-key",
        "description": "Returns one key of a Redis (Valkey) database with its type, TTL, size and value. Only\navailable for Redis databases.\n\n- `string`: `value` holds the first 64 KiB; `truncated` is `true` when the value is\n  longer. `length` is the size in bytes.\n- `hash`, `set`, `list`, `zset`, `stream`: `items` holds one page of about 200 entries\n  and `length` is the element count. When there is more, pass `next` back as the `next`\n  query parameter. `next` is an empty string on the last page.\n  Columns are `field`, `value` (hash), `member` (set), `index`, `value` (list),\n  `member`, `score` (zset) and `id`, `fields` (stream, with fields as a JSON object).\n- Values that are not valid UTF-8 are shown with `\\x` escapes. Each cell is cut at 8 KiB.\n\nThe database must be `ready`. Requires the `secrets read` permission (owner, admin or\ndeveloper role).\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "name": "key",
            "in": "query",
            "required": false,
            "description": "Key name. Required unless `key_b64` is sent.",
            "schema": {
              "type": "string",
              "example": "session:8f2c"
            }
          },
          {
            "name": "key_b64",
            "in": "query",
            "required": false,
            "description": "Key name as standard base64, for binary key names (see `raw_b64` in [List keys](/api/databases/list-keys)). Overrides `key`.",
            "schema": {
              "type": "string",
              "example": "c2Vzc2lvbjo4ZjJj"
            }
          },
          {
            "$ref": "#/components/parameters/DatabaseRedisDb"
          },
          {
            "name": "next",
            "in": "query",
            "required": false,
            "description": "The `next` value from the previous page of this key's value.",
            "schema": {
              "type": "string",
              "example": "200"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The key and one page of its value.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseKeyValue"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "key": "session:8f2c",
                    "type": "hash",
                    "ttl_ms": 3542117,
                    "length": 3,
                    "truncated": false,
                    "items": {
                      "columns": [
                        {
                          "name": "field",
                          "type": ""
                        },
                        {
                          "name": "value",
                          "type": ""
                        }
                      ],
                      "rows": [
                        [
                          "user_id",
                          "42"
                        ],
                        [
                          "csrf",
                          "7b1e0c9d"
                        ],
                        [
                          "created_at",
                          "2026-11-18T09:30:00Z"
                        ]
                      ],
                      "row_count": 3,
                      "truncated": false,
                      "duration_ms": 0
                    },
                    "next": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request failed. Possible messages: `key is required`, `invalid key_b64`, `invalid page`, `key browsing is only available for Valkey databases`, `db must be between 0 and 15`, or an error from the server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "key is required",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The database does not exist, or the key does not exist (`key not found, it may have expired`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "key not found, it may have expired",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/DatabaseDataUnavailable"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/rotate-password": {
      "post": {
        "operationId": "rotateDatabasePassword",
        "summary": "Rotate the database password",
        "x-slug": "rotate-the-database-password",
        "description": "Generates a new password for the database user and queues an operation that applies it\non the running database. Only PostgreSQL databases support rotation, and the database\nmust be `ready`.\n\nReturns `202 Accepted` once the operation is queued. The response does not contain the\nnew password. The stored password switches only after the operation\nsucceeds; if it fails, the old password keeps working. Follow the operation with\n[Get an operation](/api/operations/get-an-operation), then read the new password with\n[Get database credentials](/api/databases/get-database-credentials).\n\nRotation is a hard cutover: clients still using the old password fail when they next\nreconnect.\n\nRequires the `secrets manage` permission (owner, admin or developer role). `X-Idempotency`\nis optional. A retry with the same key returns the original operation with `200 OK` and\n`is_replay: true` instead of generating another password; the replay is checked before the\ndatabase's state, so it works after the rotation has finished.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "$ref": "#/components/parameters/DatabaseIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DatabaseOperationReplay"
          },
          "202": {
            "description": "The rotation was queued. `database` reflects the database before rotation and has no password.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "database password rotation queued",
                  "data": {
                    "operation_id": "019a9d02-4e5f-7a60-8b71-9c0d1e2f3a4b",
                    "database": {
                      "uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "name": "orders-db",
                      "slug": "orders-db",
                      "engine": "postgres",
                      "version": "17",
                      "status": "ready",
                      "display_status": "ready",
                      "plan_slug": "database-seed-olas-closet",
                      "zone_slug": "olas-closet",
                      "storage_gib": 5,
                      "vcpu": 1,
                      "cpu_limit_millis": 750,
                      "memory_mib": 512,
                      "host": "pg-1c2d3e.ws-acme.db.rumptycloud.com",
                      "port": 5432,
                      "database_name": "orders_db",
                      "username": "postgres",
                      "connection_string": "postgresql://postgres@pg-1c2d3e.ws-acme.db.rumptycloud.com:5432/orders_db?sslmode=require",
                      "internal_host": "pg-1c2d3e.db.rumpty.internal",
                      "internal_connection_string": "postgresql://postgres@pg-1c2d3e.db.rumpty.internal:5432/orders_db?sslmode=require",
                      "public_access": false,
                      "created_at": "2026-11-18T09:12:44Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9d02-4e5f-7a60-8b71-9c0d1e2f3a4b/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "The database engine does not support rotation (`password rotation is currently available for PostgreSQL databases only`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "password rotation is currently available for PostgreSQL databases only",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DatabaseNotReady"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/resize": {
      "post": {
        "operationId": "resizeDatabase",
        "summary": "Resize a database",
        "x-slug": "resize-a-database",
        "description": "Moves the database to another plan of the same engine and returns `202 Accepted`. The\ndatabase must be `ready`. It switches to `provisioning`, is restarted with the new CPU and\nmemory, and returns to `ready` when the operation succeeds (or `failed` if it fails).\nFollow it with [Get an operation](/api/operations/get-an-operation).\n\n- Billing switches to the new plan's rate straight away. Usage up to now is charged at the\n  old rate first.\n- Storage only grows. If the new plan includes more storage, the disk grows to match. A\n  plan with less included storage than the database already has is rejected.\n- Expect a short interruption while the database restarts.\n\n`X-Idempotency` is optional. A retry with the same key returns the original operation with\n`200 OK` and `is_replay: true`, even once the resize has finished. The body is not\ncompared, so a retry with another `plan_slug` also returns the original resize.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "$ref": "#/components/parameters/DatabaseIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "plan_slug"
                ],
                "properties": {
                  "plan_slug": {
                    "type": "string",
                    "description": "Slug of an available plan for the database's engine. Case-insensitive. Must differ from the current plan.",
                    "example": "database-sprout-olas-closet"
                  }
                }
              },
              "example": {
                "plan_slug": "database-sprout-olas-closet"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DatabaseOperationReplay"
          },
          "202": {
            "description": "The resize was queued. `database` already shows the new plan's size.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "database resize queued",
                  "data": {
                    "operation_id": "019a9d10-8c9d-7eaf-8b01-2c3d4e5f6a7b",
                    "database": {
                      "uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "name": "orders-db",
                      "slug": "orders-db",
                      "engine": "postgres",
                      "version": "17",
                      "status": "provisioning",
                      "display_status": "provisioning",
                      "plan_slug": "database-sprout-olas-closet",
                      "zone_slug": "olas-closet",
                      "storage_gib": 15,
                      "vcpu": 1,
                      "cpu_limit_millis": 1000,
                      "memory_mib": 1024,
                      "host": "pg-1c2d3e.ws-acme.db.rumptycloud.com",
                      "port": 5432,
                      "database_name": "orders_db",
                      "username": "postgres",
                      "connection_string": "postgresql://postgres@pg-1c2d3e.ws-acme.db.rumptycloud.com:5432/orders_db?sslmode=require",
                      "internal_host": "pg-1c2d3e.db.rumpty.internal",
                      "internal_connection_string": "postgresql://postgres@pg-1c2d3e.db.rumpty.internal:5432/orders_db?sslmode=require",
                      "public_access": false,
                      "created_at": "2026-11-18T09:12:44Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9d10-8c9d-7eaf-8b01-2c3d4e5f6a7b/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages: `invalid request` (malformed JSON or missing\n`plan_slug`), `plan_slug is required`, `invalid database plan`,\n`selected plan is not available for this database engine`,\n`This database is already on the <plan> plan.`, or the storage message\n(`The <plan> plan includes <n> GiB of storage but this database already has <m> GiB provisioned. Choose a plan with at least <m> GiB of storage.`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "This database is already on the Seed plan.",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/DatabaseNotReady"
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/metrics/current": {
      "get": {
        "operationId": "getDatabaseCurrentMetrics",
        "summary": "Get current database metrics",
        "x-slug": "get-current-database-metrics",
        "description": "Returns the latest CPU, memory, disk and network sample for the database. The response\nuses the same shape as VM metrics, so the database's UID is returned in `vm_uid`.\n\nIf no sample has arrived yet, `available` is `false`, the metric fields are left out and\n`unavailable_reason` explains why. `stale` is `true` when the latest sample is more than\ntwo minutes old.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The latest metrics sample. `vm_uid` is the database's UID.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmMetricsCurrent"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "vm_uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                    "available": true,
                    "stale": false,
                    "cpu_percent": 4.2,
                    "memory_percent": 38.7,
                    "disk_percent": 11.3,
                    "network_rx_bytes": 52428800,
                    "network_tx_bytes": 104857600,
                    "sampled_at": "2026-11-18T10:29:45Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/databases/{uid}/metrics/history": {
      "get": {
        "operationId": "getDatabaseMetricHistory",
        "summary": "Get database metric history",
        "x-slug": "get-database-metric-history",
        "description": "Returns a time series of the database's metrics over a time range. The response uses the\nsame shape as VM metrics, so the database's UID is returned in `vm_uid`. The step between\npoints depends on the range:\n\n| `range` | `step_seconds` |\n| ------- | -------------- |\n| `15m`   | 15             |\n| `1h`    | 60             |\n| `6h`    | 300            |\n| `24h`   | 900            |\n| `7d`    | 3600           |\n| `30d`   | 21600          |\n\nIf no samples exist in the range, `available` is `false` and `points` is empty.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Time window to return, ending now. Case-insensitive. Other values return `400` (`invalid metrics range`).",
            "schema": {
              "type": "string",
              "enum": [
                "15m",
                "1h",
                "6h",
                "24h",
                "7d",
                "30d"
              ],
              "default": "1h",
              "example": "6h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The metric history. `vm_uid` is the database's UID.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VmMetricsHistory"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "vm_uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                    "available": true,
                    "stale": false,
                    "range": "6h",
                    "step_seconds": 300,
                    "latest": {
                      "timestamp": "2026-11-18T10:25:00Z",
                      "cpu_percent": 4.2,
                      "memory_percent": 38.7,
                      "disk_percent": 11.3,
                      "network_rx_bytes": 52428800,
                      "network_tx_bytes": 104857600
                    },
                    "points": [
                      {
                        "timestamp": "2026-11-18T10:20:00Z",
                        "cpu_percent": 3.9,
                        "memory_percent": 38.5,
                        "disk_percent": 11.3,
                        "network_rx_bytes": 52101120,
                        "network_tx_bytes": 104202240
                      },
                      {
                        "timestamp": "2026-11-18T10:25:00Z",
                        "cpu_percent": 4.2,
                        "memory_percent": 38.7,
                        "disk_percent": 11.3,
                        "network_rx_bytes": 52428800,
                        "network_tx_bytes": 104857600
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The range is not supported (`invalid metrics range`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invalid metrics range",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/databases/{uid}/firewall-policies": {
      "get": {
        "operationId": "listDatabaseFirewallPolicies",
        "summary": "List a database's firewall policies",
        "x-slug": "list-a-databases-firewall-policies",
        "description": "Returns the firewall policies attached to the database, with their rules and every\nresource each policy is attached to. Returns an empty list when no policy is attached.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The attached firewall policies.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FirewallPolicy"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9a01-2b3c-7d4e-9f50-6a7b8c9d0e1f",
                      "name": "Office only",
                      "slug": "office-only",
                      "description": "Allow PostgreSQL from the office network.",
                      "is_default": false,
                      "rules": [
                        {
                          "operation_id": "",
                          "uid": "019a9a01-2b3d-7e4f-8a51-7b8c9d0e1f2a",
                          "direction": "inbound",
                          "action": "allow",
                          "protocol": "tcp",
                          "port_start": 5432,
                          "port_end": 5432,
                          "cidr": "203.0.113.0/24",
                          "description": "Office",
                          "is_default": false
                        }
                      ],
                      "attached_resources": [
                        {
                          "operation_id": "",
                          "uid": "019a9a05-6f70-7a81-9b92-0c1d2e3f4a5b",
                          "resource_type": "database",
                          "resource": {
                            "uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                            "name": "orders-db",
                            "slug": "orders-db",
                            "status": "ready"
                          }
                        }
                      ],
                      "created_at": "2026-11-10T12:00:00Z",
                      "updated_at": "2026-11-12T08:30:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/databases/{uid}/snapshots": {
      "get": {
        "operationId": "listDatabaseSnapshotsForDatabase",
        "summary": "List snapshots of a database",
        "x-slug": "list-snapshots-of-a-database",
        "description": "Returns the snapshots taken from this database, newest first, including ones still being\ncreated or deleted. To also see snapshots of deleted databases, use\n[List database snapshots](/api/databases/list-database-snapshots).\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The database's snapshots.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DatabaseSnapshot"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9d40-2b3c-7d4e-8f5a-6b7c8d9e0f1a",
                      "database_uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "source_database_name": "orders-db",
                      "source_engine": "postgres",
                      "source_version": "17",
                      "detached": false,
                      "name": "before-migration",
                      "slug": "before-migration",
                      "status": "available",
                      "consumed_bytes": 73400320,
                      "created_at": "2026-11-18T10:05:00Z",
                      "updated_at": "2026-11-18T10:06:12Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "post": {
        "operationId": "createDatabaseSnapshot",
        "summary": "Create a database snapshot",
        "x-slug": "create-a-database-snapshot",
        "description": "Queues a point-in-time snapshot of the database's data volume and returns `202 Accepted`.\nThe snapshot is listed straight away with status `creating` and becomes `available` when\nthe operation succeeds. If the operation fails, the snapshot is removed. Follow it with\n[Get an operation](/api/operations/get-an-operation).\n\n- The database must be `ready`.\n- Only container-runtime databases support snapshots. Others return `400`.\n- The new snapshot's UID is in `snapshot_uid`. The response's `name` is the\n  **database's** name.\n- Snapshots are kept when the database is deleted.\n\n`X-Idempotency` is optional. A retry with the same key and the same `name` returns the\noriginal operation with `200 OK`, before the database's state is checked. The same key with\na different `name`, or for a different database, returns `409`\n(`action: idempotency_key_reused`).\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "$ref": "#/components/parameters/DatabaseIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "Name of the snapshot.",
                    "example": "before-migration"
                  }
                }
              },
              "example": {
                "name": "before-migration"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DatabaseSnapshotOperationReplay"
          },
          "202": {
            "description": "The snapshot operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseSnapshotOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "database snapshot creation request queued",
                  "data": {
                    "operation_id": "019a9d40-2b3e-7f50-9a61-7c8d9e0f1a2b",
                    "database_uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                    "name": "orders-db",
                    "action": "database_snapshot.create",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9d40-2b3e-7f50-9a61-7c8d9e0f1a2b/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages: `invalid request payload` (malformed JSON, or `name` missing or longer than 100 characters) and `snapshots are only supported for container-runtime databases`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invalid request payload"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The database is not ready (`database must be ready before taking a snapshot`, `database is not available for snapshots`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "database must be ready before taking a snapshot",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/snapshots/{snapshot_uid}/restore": {
      "post": {
        "operationId": "restoreDatabaseSnapshot",
        "summary": "Restore a database snapshot",
        "x-slug": "restore-a-database-snapshot",
        "description": "Replaces the database's data with the contents of one of its snapshots and returns\n`202 Accepted`. **Everything written since the snapshot is lost.**\n\nThe snapshot must belong to this database and be `available`, and the database must use\nthe container runtime. During the restore the database is `provisioning` and the snapshot\nis `restoring`. When the operation succeeds the database is `ready` again. If it fails,\nthe database is marked `failed`. Follow it with\n[Get an operation](/api/operations/get-an-operation).\n\nTo restore into a new database instead, pass `snapshot_uid` to\n[Create a database](/api/databases/create-a-database).\n\n`X-Idempotency` is optional. A retry with the same key for the same snapshot returns the\noriginal operation with `200 OK`, before the snapshot's state is checked.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "$ref": "#/components/parameters/DatabaseSnapshotUid"
          },
          {
            "$ref": "#/components/parameters/DatabaseIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DatabaseSnapshotOperationReplay"
          },
          "202": {
            "description": "The restore operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseSnapshotOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "database snapshot restore request queued",
                  "data": {
                    "operation_id": "019a9d55-3c4d-7e5f-8a60-7b8c9d0e1f2a",
                    "database_uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                    "name": "orders-db",
                    "action": "database_snapshot.restore",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9d55-3c4d-7e5f-8a60-7b8c9d0e1f2a/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "The database does not support snapshots (`snapshots are only supported for container-runtime databases`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshots are only supported for container-runtime databases",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The database or the snapshot does not exist (`database not found`, `snapshot not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The snapshot is not `available` (`snapshot is not in available state for restore`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot is not in available state for restore",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/databases/{uid}/snapshots/{snapshot_uid}": {
      "delete": {
        "operationId": "deleteDatabaseSnapshotForDatabase",
        "summary": "Delete a snapshot of a database",
        "x-slug": "delete-a-snapshot-of-a-database",
        "description": "Queues deletion of one of the database's snapshots and returns `202 Accepted`. The\nsnapshot moves to `deleting` and disappears when the operation succeeds. If it fails, the\nsnapshot goes back to `available`.\n\nThe database must still exist. For snapshots of deleted databases, use\n[Delete a database snapshot](/api/databases/delete-a-database-snapshot).\n\n`X-Idempotency` is optional. A retry with the same key for the same snapshot returns the\noriginal operation with `200 OK`, even after the snapshot is gone. A replay's `name` is the\ndatabase's name, not the snapshot's.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseUid"
          },
          {
            "$ref": "#/components/parameters/DatabaseSnapshotUid"
          },
          {
            "$ref": "#/components/parameters/DatabaseIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DatabaseSnapshotOperationReplay"
          },
          "202": {
            "description": "The delete operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseSnapshotOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "database snapshot deletion request queued",
                  "data": {
                    "operation_id": "019a9d60-4d5e-7f60-9b71-8c9d0e1f2a3b",
                    "database_uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                    "name": "before-migration",
                    "action": "database_snapshot.delete",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9d60-4d5e-7f60-9b71-8c9d0e1f2a3b/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The database or the snapshot does not exist (`database not found`, `snapshot not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The snapshot is already being deleted (`snapshot is already being deleted`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot is already being deleted",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/database-snapshots": {
      "get": {
        "operationId": "listDatabaseSnapshots",
        "summary": "List database snapshots",
        "x-slug": "list-database-snapshots",
        "description": "Returns every database snapshot in the workspace, newest first, including snapshots whose\ndatabase has been deleted (`detached: true`).\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's database snapshots.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DatabaseSnapshot"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9d40-2b3c-7d4e-8f5a-6b7c8d9e0f1a",
                      "database_uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                      "source_database_name": "orders-db",
                      "source_engine": "postgres",
                      "source_version": "17",
                      "detached": false,
                      "name": "before-migration",
                      "slug": "before-migration",
                      "status": "available",
                      "consumed_bytes": 73400320,
                      "created_at": "2026-11-18T10:05:00Z",
                      "updated_at": "2026-11-18T10:06:12Z"
                    },
                    {
                      "uid": "019a8e77-0a1b-7c2d-9e3f-4a5b6c7d8e9f",
                      "database_uid": "019a8e70-9f0a-7b1c-8d2e-3f4a5b6c7d8e",
                      "source_database_name": "staging-cache",
                      "source_engine": "redis",
                      "source_version": "8.1",
                      "detached": true,
                      "name": "final",
                      "slug": "final",
                      "status": "available",
                      "consumed_bytes": 1048576,
                      "created_at": "2026-11-14T16:20:00Z",
                      "updated_at": "2026-11-14T16:20:41Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/database-snapshots/{snapshot_uid}": {
      "get": {
        "operationId": "getDatabaseSnapshot",
        "summary": "Get a database snapshot",
        "x-slug": "get-a-database-snapshot",
        "description": "Returns one database snapshot in the workspace, including snapshots of deleted databases.",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseSnapshotUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseSnapshot"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9d40-2b3c-7d4e-8f5a-6b7c8d9e0f1a",
                    "database_uid": "019a9b10-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
                    "source_database_name": "orders-db",
                    "source_engine": "postgres",
                    "source_version": "17",
                    "detached": false,
                    "name": "before-migration",
                    "slug": "before-migration",
                    "status": "available",
                    "consumed_bytes": 73400320,
                    "created_at": "2026-11-18T10:05:00Z",
                    "updated_at": "2026-11-18T10:06:12Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "deleteDatabaseSnapshot",
        "summary": "Delete a database snapshot",
        "x-slug": "delete-a-database-snapshot",
        "description": "Queues deletion of a database snapshot and returns `202 Accepted`. Works whether or not the\nsource database still exists, so use it to clean up snapshots of deleted databases. The\nsnapshot moves to `deleting` and disappears when the operation succeeds. If it fails, the\nsnapshot goes back to `available`.\n\n`database_uid` in the response is the snapshot's source database. On a replay it is empty\nonce the snapshot has been deleted.\n\n`X-Idempotency` is optional. A retry with the same key for the same snapshot returns the\noriginal operation with `200 OK`, even after the snapshot is gone.\n",
        "tags": [
          "Databases"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/DatabaseSnapshotUid"
          },
          {
            "$ref": "#/components/parameters/DatabaseIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DatabaseSnapshotOperationReplay"
          },
          "202": {
            "description": "The delete operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/DatabaseSnapshotOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "database snapshot deletion request queued",
                  "data": {
                    "operation_id": "019a9e20-5e6f-7a70-8b81-9d0e1f2a3b4c",
                    "database_uid": "019a8e70-9f0a-7b1c-8d2e-3f4a5b6c7d8e",
                    "name": "final",
                    "action": "database_snapshot.delete",
                    "status": "queued",
                    "events_url": "/v1/operations/019a9e20-5e6f-7a70-8b81-9d0e1f2a3b4c/events",
                    "is_replay": false,
                    "is_completed": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The snapshot is already being deleted (`snapshot is already being deleted`), or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "snapshot is already being deleted",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/volumes": {
      "get": {
        "operationId": "listVolumes",
        "summary": "List volumes",
        "x-slug": "list-volumes",
        "description": "Returns the workspace's volumes, newest first. Deleted volumes are not included.\n\nWithout query parameters, every volume is returned in `data`. Send `page` or `page_size` to\npaginate. A top-level `pagination` object is then added next to `data`, and `q` filters the\nresults. `q` is ignored unless `page` or `page_size` is present.\n",
        "tags": [
          "Volumes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1. Values below 1 (or non-numbers) are treated as `1`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Items per page. Defaults to `10`. Values above `100` are capped at `100`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "example": 20
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search across the volume's name, slug, filesystem, attached VM UID and status. Only applied when paginating.",
            "schema": {
              "type": "string",
              "example": "data"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's volumes. `pagination` is only present when `page` or `page_size` was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Volume"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/VmPagination"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                      "name": "data-1",
                      "slug": "data-1",
                      "description": "Postgres data for web-1",
                      "status": "in-use",
                      "zone_slug": "olas-closet",
                      "size_gib": 50,
                      "filesystem": "ext4",
                      "formatted": true,
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "vm_name": "web-1",
                      "device_name": "/dev/vdb",
                      "mount_path": "/mnt/rumpty/019a9c401a2b",
                      "usage": {
                        "total_bytes": 52710469632,
                        "used_bytes": 5368709120,
                        "available_bytes": 44655652864,
                        "used_percent": 10.7,
                        "sampled_at": "2026-11-18T11:29:30Z",
                        "stale": false
                      },
                      "created_at": "2026-11-18T10:40:00Z",
                      "attached_at": "2026-11-18T10:42:12Z"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 20,
                    "total": 1,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      },
      "post": {
        "operationId": "createVolume",
        "summary": "Create a volume",
        "x-slug": "create-a-volume",
        "description": "Queues a new, unattached volume and returns `202 Accepted` with the `operation_id` of the\ncreate operation. The volume starts in `creating` and becomes `available` when the\noperation succeeds. Then [attach it](/api/volumes/attach-a-volume) to a VM.\n\nThings to know:\n\n- `size_gib` must be between 1 and 1024.\n- Volume names do not have to be unique.\n- A volume that is not yet marked `formatted` is formatted with its `filesystem` the first\n  time it is attached.\n- The `X-Idempotency` header is optional. If you repeat a request with a key already used for\n  a volume create with the same name (compared by slug), the original operation is returned\n  with `200 OK`, `is_replay: true` and the `X-Idempotency-Replay` header, and nothing new is\n  queued. The same key with a different name returns `409`\n  (`action: idempotency_key_reused`). The replay is checked before billing and\n  validation, so a retry still gets the original operation after the account became past\n  due.\n",
        "tags": [
          "Volumes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VolumeIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "size_gib"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name of the volume. Leading and trailing spaces are trimmed.",
                    "example": "data-1"
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional free-text description. Leading and trailing spaces are trimmed.",
                    "example": "Postgres data for web-1"
                  },
                  "size_gib": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1024,
                    "description": "Size of the volume in GiB.",
                    "example": 50
                  },
                  "zone_slug": {
                    "type": "string",
                    "description": "Zone to create the volume in. Case-insensitive. Defaults to `olas-closet`, currently the only zone. The volume can only be attached to VMs in the same zone.",
                    "default": "olas-closet",
                    "example": "olas-closet"
                  },
                  "filesystem": {
                    "type": "string",
                    "enum": [
                      "ext4",
                      "xfs"
                    ],
                    "default": "ext4",
                    "description": "Filesystem to format the volume with. Case-insensitive.",
                    "example": "ext4"
                  },
                  "format": {
                    "type": "boolean",
                    "default": false,
                    "description": "Ask the provisioner to format the volume when it is created. Whatever you send, a volume that is not yet marked `formatted` is formatted on its first attach."
                  }
                }
              },
              "example": {
                "name": "data-1",
                "description": "Postgres data for web-1",
                "size_gib": 50,
                "filesystem": "ext4"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/VolumeOperationReplay"
          },
          "202": {
            "description": "The create operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VolumeOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "volume create request queued",
                  "data": {
                    "operation_id": "019a9c40-1a2c-7d4e-9f5a-6b7c8d9e0f1a",
                    "volume": {
                      "uid": "019a9c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                      "name": "data-1",
                      "slug": "data-1",
                      "description": "Postgres data for web-1",
                      "status": "creating",
                      "zone_slug": "olas-closet",
                      "size_gib": 50,
                      "filesystem": "ext4",
                      "formatted": false,
                      "created_at": "2026-11-18T10:40:00Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9c40-1a2c-7d4e-9f5a-6b7c8d9e0f1a/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages: `invalid request` (malformed JSON, or `name` or\n`size_gib` missing or `0`), `name is required` (blank name),\n`size_gib must be between 1 and 1024`, or `filesystem must be ext4 or xfs`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "size_gib must be between 1 and 1024",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The `X-Idempotency` key was already used for a different operation in the workspace (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "idempotency key was already used for a different operation; use a new X-Idempotency value",
                  "code": 409,
                  "action": "idempotency_key_reused"
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "409"
        ]
      }
    },
    "/v1/volumes/summary": {
      "get": {
        "operationId": "getVolumeSummary",
        "summary": "Get the volume summary",
        "x-slug": "get-the-volume-summary",
        "description": "Returns totals across the workspace's volumes. Volumes that are being deleted are not\ncounted.\n\nUsed space comes from the last filesystem usage reported by each VM's guest agent, so\nvolumes that have never been mounted count as empty.\n",
        "tags": [
          "Volumes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "Storage totals for the workspace's volumes.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VolumeSummary"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "total_volumes": 2,
                    "total_storage_bytes": 161061273600,
                    "used_storage_bytes": 5368709120,
                    "available_storage_bytes": 155692564480,
                    "total_used_percent": 3.3333333333333335
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/volumes/{uid}": {
      "get": {
        "operationId": "getVolume",
        "summary": "Get a volume",
        "x-slug": "get-a-volume",
        "description": "Returns one volume, including the VM it is attached to and its latest reported disk usage.",
        "tags": [
          "Volumes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VolumeUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The volume.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Volume"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                    "name": "data-1",
                    "slug": "data-1",
                    "description": "Postgres data for web-1",
                    "status": "in-use",
                    "zone_slug": "olas-closet",
                    "size_gib": 50,
                    "filesystem": "ext4",
                    "formatted": true,
                    "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                    "vm_name": "web-1",
                    "device_name": "/dev/vdb",
                    "mount_path": "/mnt/rumpty/019a9c401a2b",
                    "usage": {
                      "total_bytes": 52710469632,
                      "used_bytes": 5368709120,
                      "available_bytes": 44655652864,
                      "used_percent": 10.7,
                      "sampled_at": "2026-11-18T11:29:30Z",
                      "stale": false
                    },
                    "created_at": "2026-11-18T10:40:00Z",
                    "attached_at": "2026-11-18T10:42:12Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/VolumeNotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "deleteVolume",
        "summary": "Delete a volume",
        "x-slug": "delete-a-volume",
        "description": "Queues deletion of the volume and everything stored on it. The volume moves to `deleting`\nstraight away and disappears from listings once the operation finishes. If deletion fails,\nthe volume moves to `failed` and you can try again.\n\nDetach the volume first. A volume that is attached, or being attached or detached, cannot be\ndeleted.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). The `X-Idempotency` header is\noptional. A retry with the same key returns the original operation with `200 OK`, even\nafter the volume has been deleted (`volume.status` is then `deleted`). Without a key, a\nretry returns `409` because the deletion is already in progress.\n",
        "tags": [
          "Volumes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VolumeUid"
          },
          {
            "$ref": "#/components/parameters/VolumeIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/VolumeOperationReplay"
          },
          "202": {
            "description": "The delete operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VolumeOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "volume delete request queued",
                  "data": {
                    "operation_id": "019a9d02-3e4f-7a5b-8c6d-7e8f9a0b1c2d",
                    "volume": {
                      "uid": "019a9c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                      "name": "data-1",
                      "slug": "data-1",
                      "description": "Postgres data for web-1",
                      "status": "deleting",
                      "zone_slug": "olas-closet",
                      "size_gib": 50,
                      "filesystem": "ext4",
                      "formatted": true,
                      "created_at": "2026-11-18T10:40:00Z",
                      "attached_at": "2026-11-18T10:42:12Z",
                      "detached_at": "2026-11-18T14:05:40Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9d02-3e4f-7a5b-8c6d-7e8f9a0b1c2d/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "The volume is still attached to a VM (or being attached or detached).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "volume is in use; detach it before deleting",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/VolumeNotFound"
          },
          "409": {
            "description": "The volume is already being deleted, or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "volume deletion is already in progress",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/volumes/{uid}/attach": {
      "post": {
        "operationId": "attachVolume",
        "summary": "Attach a volume",
        "x-slug": "attach-a-volume",
        "description": "Queues attaching an `available` volume to a VM. The volume moves to `attaching` straight\naway and to `in-use` when the operation succeeds. If attaching fails, the volume goes back\nto `available` and `last_failure` explains why.\n\nRequirements:\n\n- The volume must be `available`.\n- The VM must be in this workspace, `running`, and in the same zone as the volume.\n\nOn its first attach, a volume that is not yet `formatted` is formatted with its\n`filesystem`. Once the VM's guest agent reports the mounted filesystem, `device_name`,\n`mount_path` and `usage` appear on the volume. Volumes are mounted under `/mnt/rumpty/`.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). The `X-Idempotency` header is\noptional. A retry with the same key for the same volume returns the original operation with\n`200 OK`, before the volume's state is checked. The same key with a different `vm_uid`\nreturns `409` with `action: idempotency_key_reused`.\n",
        "tags": [
          "Volumes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VolumeUid"
          },
          {
            "$ref": "#/components/parameters/VolumeIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "vm_uid"
                ],
                "properties": {
                  "vm_uid": {
                    "type": "string",
                    "description": "UID of the VM to attach the volume to. See [List VMs](/api/virtual-machines/list-vms).",
                    "example": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90"
                  }
                }
              },
              "example": {
                "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/VolumeOperationReplay"
          },
          "202": {
            "description": "The attach operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VolumeOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "volume attach request queued",
                  "data": {
                    "operation_id": "019a9c41-2b3c-7d4e-8f5a-6b7c8d9e0f1b",
                    "volume": {
                      "uid": "019a9c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                      "name": "data-1",
                      "slug": "data-1",
                      "description": "Postgres data for web-1",
                      "status": "attaching",
                      "zone_slug": "olas-closet",
                      "size_gib": 50,
                      "filesystem": "ext4",
                      "formatted": false,
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "vm_name": "web-1",
                      "created_at": "2026-11-18T10:40:00Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9c41-2b3c-7d4e-8f5a-6b7c8d9e0f1b/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid or the volume or VM is in the wrong state. Possible messages:\n`invalid request` (malformed JSON or missing `vm_uid`), `vm_uid is required`,\n`volume is already attached; detach it first`, `volume is not available for attachment`,\n`vm must be running to attach a volume`, or `volume and vm must be in the same zone`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm must be running to attach a volume",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The volume or the VM does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "An attach is already in progress for this volume, or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "volume attach is already in progress",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/volumes/{uid}/detach": {
      "post": {
        "operationId": "detachVolume",
        "summary": "Detach a volume",
        "x-slug": "detach-a-volume",
        "description": "Queues detaching an `in-use` volume from its VM. The volume moves to `detaching` straight\naway and back to `available` when the operation succeeds. Its data is kept. If detaching\nfails, the volume stays `in-use` and `last_failure` explains why.\n\nUnmount the filesystem inside the VM first to avoid losing unwritten data.\n\nThis is asynchronous. It returns `202 Accepted` with an `operation_id`. See\n[Get an operation](/api/operations/get-an-operation). The `X-Idempotency` header is\noptional. A retry with the same key for the same volume returns the original operation with\n`200 OK`, before the volume's state is checked.\n",
        "tags": [
          "Volumes"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/VolumeUid"
          },
          {
            "$ref": "#/components/parameters/VolumeIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/VolumeOperationReplay"
          },
          "202": {
            "description": "The detach operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/VolumeOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "volume detach request queued",
                  "data": {
                    "operation_id": "019a9cf0-4d5e-7f6a-9b7c-8d9e0f1a2b3c",
                    "volume": {
                      "uid": "019a9c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                      "name": "data-1",
                      "slug": "data-1",
                      "description": "Postgres data for web-1",
                      "status": "detaching",
                      "zone_slug": "olas-closet",
                      "size_gib": 50,
                      "filesystem": "ext4",
                      "formatted": true,
                      "vm_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "vm_name": "web-1",
                      "device_name": "/dev/vdb",
                      "mount_path": "/mnt/rumpty/019a9c401a2b",
                      "usage": {
                        "total_bytes": 52710469632,
                        "used_bytes": 5368709120,
                        "available_bytes": 44655652864,
                        "used_percent": 10.7,
                        "sampled_at": "2026-11-18T14:04:30Z",
                        "stale": false
                      },
                      "created_at": "2026-11-18T10:40:00Z",
                      "attached_at": "2026-11-18T10:42:12Z"
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9cf0-4d5e-7f6a-9b7c-8d9e0f1a2b3c/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "The volume is not attached to a VM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "volume is not attached",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The volume, or the VM it is attached to, no longer exists in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "volume not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "A detach is already in progress for this volume, or the `X-Idempotency` key was used for a different operation (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "volume detach is already in progress",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/storage/pricing": {
      "get": {
        "operationId": "getStoragePricing",
        "summary": "Get storage pricing",
        "x-slug": "get-storage-pricing",
        "description": "Returns the current storage price sheet: the monthly price per GiB and the free allowance\nfor block volumes, snapshots, object storage (buckets) and build artifact storage.\n\nThis endpoint is public and needs no API key or workspace.\n",
        "tags": [
          "Buckets"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The storage price sheet.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BucketStoragePricing"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "currency": "USD",
                    "volume": {
                      "price_per_gib_month_micros": 70000,
                      "price_per_gib_month_usd": 0.07,
                      "free_gib": 0
                    },
                    "snapshot": {
                      "price_per_gib_month_micros": 70000,
                      "price_per_gib_month_usd": 0.07,
                      "free_gib": 0
                    },
                    "object_storage": {
                      "price_per_gib_month_micros": 20000,
                      "price_per_gib_month_usd": 0.02,
                      "free_gib": 10
                    },
                    "artifact_storage": {
                      "price_per_gib_month_micros": 20000,
                      "price_per_gib_month_usd": 0.02,
                      "free_gib": 1
                    }
                  }
                }
              }
            }
          }
        },
        "x-response-order": [
          "200"
        ]
      }
    },
    "/v1/storage/usage": {
      "get": {
        "operationId": "getStorageUsage",
        "summary": "Get account storage usage",
        "x-slug": "get-account-storage-usage",
        "description": "Returns how much storage your account uses across **all** your workspaces, split into file\nstorage (bucket objects) and build artifacts (deployment builds), compared with the free\nallowance.\n\nThis endpoint is account-level, so it does not take an `X-Workspace-Slug` header. For a\nsingle workspace's bucket usage, use\n[Get workspace bucket usage](/api/buckets/get-workspace-bucket-usage).\n\nOnly objects whose upload has been completed (status `ready`) count towards usage.\n",
        "tags": [
          "Buckets"
        ],
        "responses": {
          "200": {
            "description": "Your account's storage usage.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BucketStorageUsage"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "used_bytes": 2684354560,
                    "free_bytes": 11811160064,
                    "billable_bytes": 0,
                    "max_upload_bytes": 1073741824,
                    "usage_percentage": 22,
                    "file_storage": {
                      "used_bytes": 2147483648,
                      "free_bytes": 10737418240,
                      "billable_bytes": 0,
                      "usage_percentage": 20
                    },
                    "build_artifacts": {
                      "used_bytes": 536870912,
                      "free_bytes": 1073741824,
                      "billable_bytes": 0,
                      "usage_percentage": 50
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/asset-buckets": {
      "get": {
        "operationId": "listBuckets",
        "summary": "List buckets",
        "x-slug": "list-buckets",
        "description": "Returns the workspace's buckets, newest first. Deleted buckets are not included, but\nbuckets that are still `provisioning`, `deleting` or `failed` are.\n\nWithout query parameters, every bucket is returned in `data`. Send `page` or `page_size` to\npaginate. A top-level `pagination` object is then added next to `data`, and `q` filters the\nresults. `q` is ignored unless `page` or `page_size` is present.\n\nRequires read access to the workspace (any role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1. Values below 1 (or non-numbers) are treated as `1`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Items per page. Defaults to `10`. Values above `100` are capped at `100`. Sending this enables pagination.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "example": 20
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search across the bucket's name, slug, storage bucket name, status and visibility. Only applied when paginating.",
            "schema": {
              "type": "string",
              "example": "marketing"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's buckets. `pagination` is only present when `page` or `page_size` was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Bucket"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/VmPagination"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b",
                      "name": "Marketing assets",
                      "slug": "marketing-assets",
                      "status": "ready",
                      "visibility": "public",
                      "public_base_url": "https://assets.rumptycloud.com/projects/019a1111-2222-7333-8444-555566667777/marketing-assets",
                      "s3_bucket_name": "assets-acme-6c7d8e",
                      "key_prefix": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets",
                      "storage_used_bytes": 52428800,
                      "free_storage_bytes": 10737418240,
                      "max_image_size_bytes": 1073741824,
                      "created_at": "2026-11-18T10:24:00Z",
                      "cors_origins": [
                        "https://www.acme.com"
                      ]
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 20,
                    "total": 1,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      },
      "post": {
        "operationId": "createBucket",
        "summary": "Create a bucket",
        "x-slug": "create-a-bucket",
        "description": "Queues a new bucket and returns `202 Accepted` with the `operation_id` of the create\noperation. The bucket starts in `provisioning` and moves to `ready` (or `failed`) when the\noperation finishes. Poll [Get an operation](/api/operations/get-an-operation) or\n[List buckets](/api/buckets/list-buckets) to see when it is `ready`. Uploads, access keys\nand CORS changes are only accepted once the bucket is `ready`.\n\nThings to know:\n\n- Bucket names must be unique in the workspace. Uniqueness is checked on the slug of the\n  name, so `Marketing Assets` and `marketing-assets` clash.\n- `visibility` defaults to `public`. It cannot be changed after creation.\n- The underlying S3 bucket name (`s3_bucket_name`) is generated for you from the workspace\n  slug and the bucket's ID.\n- Send `X-Idempotency` to make retries safe. Repeating a create with the same key returns\n  the original operation with `200 OK` and `is_replay: true`, and no second bucket is\n  created. The key is checked first, before the past-due check and validation. Reusing it\n  for a different action returns `409` with `action: idempotency_key_reused`.\n- Past-due or suspended accounts cannot create buckets (`402`, `action: past_due`).\n\nRequires the `resource write` permission (owner, admin or developer role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name of the bucket. Leading and trailing spaces are trimmed. Its slug must be unique among the workspace's buckets.",
                    "example": "Marketing assets"
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private"
                    ],
                    "default": "public",
                    "description": "`public` serves objects from a public URL. `private` requires a signed URL to read objects. Case-insensitive.",
                    "example": "public"
                  }
                }
              },
              "example": {
                "name": "Marketing assets",
                "visibility": "public"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/BucketOperationReplay"
          },
          "202": {
            "description": "The create operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BucketOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "asset bucket create request queued",
                  "data": {
                    "operation_id": "019a9b3c-1d30-7a11-9b22-3c4d5e6f7a8b",
                    "bucket": {
                      "uid": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b",
                      "name": "Marketing assets",
                      "slug": "marketing-assets",
                      "status": "provisioning",
                      "visibility": "public",
                      "public_base_url": "https://assets.rumptycloud.com/projects/019a1111-2222-7333-8444-555566667777/marketing-assets",
                      "s3_bucket_name": "assets-acme-6c7d8e",
                      "key_prefix": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets",
                      "free_storage_bytes": 10737418240,
                      "max_image_size_bytes": 1073741824,
                      "created_at": "2026-11-18T10:24:00Z",
                      "cors_origins": []
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9b3c-1d30-7a11-9b22-3c4d5e6f7a8b/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages: `invalid request` (malformed JSON or missing `name`), `name is required` (blank after trimming), `visibility must be public or private`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "visibility must be public or private",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A bucket with the same name (slug) already exists in this workspace, or the `X-Idempotency` key was already used for a different action (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "a bucket named \"Marketing assets\" already exists in this workspace",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "400",
          "401",
          "402",
          "403",
          "409"
        ]
      }
    },
    "/v1/asset-buckets/usage": {
      "get": {
        "operationId": "getWorkspaceBucketUsage",
        "summary": "Get workspace bucket usage",
        "x-slug": "get-workspace-bucket-usage",
        "description": "Returns how many bytes the workspace's bucket objects use, compared with the account's free\nfile storage allowance, plus the maximum size of a single upload.\n\nOnly objects whose upload has been completed (status `ready`) are counted. The free\nallowance is shared across all your workspaces. See\n[Get account storage usage](/api/buckets/get-account-storage-usage) for the account-wide\ntotal.\n\nRequires read access to the workspace (any role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's bucket usage.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BucketUsage"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "used_bytes": 52428800,
                    "free_bytes": 10737418240,
                    "billable_bytes": 0,
                    "max_upload_bytes": 1073741824,
                    "usage_percentage": 0
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/asset-buckets/{uid}": {
      "delete": {
        "operationId": "deleteBucket",
        "summary": "Delete a bucket",
        "x-slug": "delete-a-bucket",
        "description": "Queues deletion of the bucket and returns `202 Accepted` with the `operation_id` of the\ndelete operation. The bucket moves to `deleting` straight away. Poll\n[Get an operation](/api/operations/get-an-operation) to follow it.\n\nWhen the operation succeeds, **every object in the bucket is deleted** and all of the\nbucket's access keys are revoked. This cannot be undone. If deletion fails, the bucket's\nstatus becomes `failed` and `last_failure` explains why.\n\nSend `X-Idempotency` to make retries safe. The key is checked before the bucket's state, so\nrepeating a delete with the same key returns the original operation with `200 OK` and\n`is_replay: true` instead of `409` or `404`. Reusing it for a different action or bucket\nreturns `409` with `action: idempotency_key_reused`.\n\nThe returned `bucket` omits `free_storage_bytes` and `max_image_size_bytes`.\n\nRequires the `resource write` permission (owner, admin or developer role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketUid"
          },
          {
            "$ref": "#/components/parameters/BucketIdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/BucketOperationReplay"
          },
          "202": {
            "description": "The delete operation was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BucketOperationResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "asset bucket delete request queued",
                  "data": {
                    "operation_id": "019a9f42-6a7b-7c8d-9e0f-1a2b3c4d5e6f",
                    "bucket": {
                      "uid": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b",
                      "name": "Marketing assets",
                      "slug": "marketing-assets",
                      "status": "deleting",
                      "visibility": "public",
                      "public_base_url": "https://assets.rumptycloud.com/projects/019a1111-2222-7333-8444-555566667777/marketing-assets",
                      "s3_bucket_name": "assets-acme-6c7d8e",
                      "key_prefix": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets",
                      "storage_used_bytes": 52428800,
                      "created_at": "2026-11-18T10:24:00Z",
                      "cors_origins": [
                        "https://www.acme.com"
                      ]
                    },
                    "status": "queued",
                    "events_url": "/v1/operations/019a9f42-6a7b-7c8d-9e0f-1a2b3c4d5e6f/events",
                    "is_replay": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The bucket does not exist in this workspace or was already deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset bucket not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The bucket is already being deleted, or the `X-Idempotency` key was already used for a different action or bucket (`action: idempotency_key_reused`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "bucket is already being deleted",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "202",
          "200",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/asset-buckets/{uid}/cors": {
      "put": {
        "operationId": "updateBucketCors",
        "summary": "Set bucket allowed origins",
        "x-slug": "set-bucket-allowed-origins",
        "description": "Replaces the browser origins allowed to make cross-origin (CORS) requests to the bucket,\nfor example so a web app can upload directly to a presigned URL or fetch objects with\n`fetch()`. The RumptyCloud console's own origin is always allowed and is not listed.\n\nThe list you send replaces the current one. Send an empty array to remove all custom\norigins. The change is saved immediately and pushed to storage. If that push fails, a\nbackground sync applies it shortly afterwards.\n\nRules for each origin:\n\n- Must be `scheme://host[:port]` with `https://` or `http://`, for example\n  `https://app.example.com`. Paths, queries, fragments and credentials are rejected.\n- `*` allows any site. A leading `*.` wildcard in the host (for example\n  `https://*.example.com`) allows subdomains. `*` is not allowed anywhere else in the host.\n- At most 255 characters each and at most 20 origins. Blank entries are ignored, and origins\n  are lower-cased and de-duplicated.\n\nThe bucket must be `ready`. Requires the `resource write` permission (owner, admin or\ndeveloper role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "origins": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "description": "The full list of allowed browser origins. Replaces the current list. An empty array or omitted field clears it.",
                    "example": [
                      "https://www.acme.com",
                      "https://*.acme.dev"
                    ]
                  }
                }
              },
              "example": {
                "origins": [
                  "https://www.acme.com",
                  "https://*.acme.dev"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The allowed origins were updated. Returns the bucket with the normalised `cors_origins`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Bucket"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "allowed origins updated",
                  "data": {
                    "uid": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b",
                    "name": "Marketing assets",
                    "slug": "marketing-assets",
                    "status": "ready",
                    "visibility": "public",
                    "public_base_url": "https://assets.rumptycloud.com/projects/019a1111-2222-7333-8444-555566667777/marketing-assets",
                    "s3_bucket_name": "assets-acme-6c7d8e",
                    "key_prefix": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets",
                    "storage_used_bytes": 52428800,
                    "created_at": "2026-11-18T10:24:00Z",
                    "cors_origins": [
                      "https://www.acme.com",
                      "https://*.acme.dev"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "An origin is invalid, or there are more than 20. Possible messages include\n`\"<origin>\" needs https:// (or http://) at the start`,\n`\"<origin>\" must start with https:// or http://`,\n`\"<origin>\" should be just the scheme, host and port, e.g. https://app.example.com`,\n`\"<origin>\" can only use * at the start of the host, e.g. https://*.example.com`,\n`\"<origin>\" is too long`, `\"<origin>\" is not a valid origin, e.g. https://app.example.com`,\n`a bucket can have at most 20 allowed origins` and `invalid request` (malformed JSON).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "\"www.acme.com\" needs https:// (or http://) at the start",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The bucket does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset bucket not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The bucket is not `ready` yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "allowed origins can be changed once the bucket is ready",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/asset-buckets/{uid}/objects": {
      "get": {
        "operationId": "listBucketObjects",
        "summary": "List bucket objects",
        "x-slug": "list-bucket-objects",
        "description": "Returns every object in the bucket, newest first. Deleted objects are not included. Objects\nwhose upload has not been completed yet are listed with status `pending_upload`.\n\nThis endpoint is not paginated. For private buckets each object includes a freshly signed\n`read_url` and its `read_url_expires_at`. For public buckets `read_url` is the public URL.\n\nObjects written directly to the bucket with an S3 client (for example with a\n[bucket access key](/api/buckets/create-a-bucket-access-key)) also appear here once storage\nreports them.\n\nRequires read access to the workspace (any role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The bucket's objects.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/BucketObject"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9c01-aa22-7b33-9c44-d5e6f7a8b9c0",
                      "bucket_uid": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b",
                      "key": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf",
                      "filename": "report.pdf",
                      "content_type": "application/pdf",
                      "size_bytes": 248331,
                      "status": "ready",
                      "public_url": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf",
                      "read_url": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf",
                      "read_url_is_signed": false,
                      "created_at": "2026-11-18T10:31:12Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The bucket does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset bucket not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/asset-buckets/{uid}/uploads": {
      "post": {
        "operationId": "createBucketUpload",
        "summary": "Create an upload",
        "x-slug": "create-an-upload",
        "description": "Starts an upload by reserving an object and returning a presigned URL to send the file to.\nNo file data goes through this endpoint.\n\n**Upload flow:**\n\n1. Call this endpoint with the file's name, content type and size. The object is created\n   with status `pending_upload`.\n2. Send the file's bytes with an HTTP `PUT` to `upload_url` (`method` is always `PUT`),\n   setting **every header in `headers`** exactly as returned. For public buckets these\n   include `x-amz-acl: public-read` and a `Cache-Control` header. The URL expires at\n   `expires_at` (10 minutes by default).\n3. Call [Complete an upload](/api/buckets/complete-an-upload) with `object_id` to mark the\n   object `ready`. Only `ready` objects count towards storage usage and can be read with\n   [Create an object read URL](/api/buckets/create-an-object-read-url).\n\n```bash\ncurl -X PUT \"$UPLOAD_URL\" \\\n  -H \"Content-Type: application/pdf\" \\\n  -H \"x-amz-acl: public-read\" \\\n  -H \"Cache-Control: public, max-age=31536000, immutable\" \\\n  --data-binary @report.pdf\n```\n\nThe object's `key` is generated for you. It is the bucket's key prefix, then `key_prefix`\n(if sent), then a slug of the file name with a short unique suffix, for example\n`report-d5e6f7.pdf`.\n\nThings to know:\n\n- Allowed content types and extensions: `application/pdf` (`.pdf`), Word `.docx`\n  (`application/vnd.openxmlformats-officedocument.wordprocessingml.document`), `image/gif`,\n  `image/jpeg` (`.jpg`, `.jpeg`), `image/png`, `image/svg+xml`, `image/webp`, `text/csv`,\n  `text/html` (`.html`, `.htm`), `text/markdown` and `text/x-markdown` (`.md`), `text/plain`\n  (`.txt`, `.md`, `.csv`), `application/vnd.apple.mpegurl` and `application/x-mpegurl`\n  (`.m3u8`), `video/mp2t` (`.ts`), `video/mp4`, `video/quicktime` (`.mov`, `.qt`),\n  `video/webm`, `video/x-matroska` (`.mkv`) and `video/x-msvideo` (`.avi`).\n- If `filename` has an extension, it must match `content_type`.\n- `size_bytes` must be above zero and no larger than the maximum upload size (1 GiB by\n  default, shown as `max_upload_bytes` in\n  [Get workspace bucket usage](/api/buckets/get-workspace-bucket-usage)).\n- The upload is rejected with `403` if it would take your account's file storage past the\n  free allowance.\n- The bucket must be `ready`.\n\nRequires the `resource write` permission (owner, admin or developer role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename",
                  "content_type",
                  "size_bytes"
                ],
                "properties": {
                  "filename": {
                    "type": "string",
                    "description": "Original file name. Used for the object's `filename` and to build its key. Its extension must match `content_type`.",
                    "example": "report.pdf"
                  },
                  "content_type": {
                    "type": "string",
                    "description": "MIME type of the file. Case-insensitive. Must be one of the allowed types listed above.",
                    "example": "application/pdf"
                  },
                  "size_bytes": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 1,
                    "description": "Size of the file in bytes. Must be above zero and within the maximum upload size.",
                    "example": 248331
                  },
                  "key_prefix": {
                    "type": "string",
                    "maxLength": 512,
                    "description": "Optional folder path to place the object in, for example `invoices/2026`.\nLeading and trailing slashes are ignored. Each folder name must start with a\nletter or number and may contain only letters, numbers, spaces, dots, dashes and\nunderscores.\n",
                    "example": "invoices/2026"
                  }
                }
              },
              "example": {
                "filename": "report.pdf",
                "content_type": "application/pdf",
                "size_bytes": 248331,
                "key_prefix": "invoices/2026"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The object was reserved and a presigned upload URL was created.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BucketUpload"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "upload created",
                  "data": {
                    "object_id": "019a9c01-aa22-7b33-9c44-d5e6f7a8b9c0",
                    "key": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf",
                    "upload_url": "https://uploads.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Date=20261118T103000Z&X-Amz-Expires=600&X-Amz-SignedHeaders=cache-control%3Bcontent-type%3Bhost%3Bx-amz-acl&X-Amz-Signature=...",
                    "public_url": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf",
                    "read_url": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf",
                    "read_url_is_signed": false,
                    "method": "PUT",
                    "headers": {
                      "Content-Type": "application/pdf",
                      "x-amz-acl": "public-read",
                      "Cache-Control": "public, max-age=31536000, immutable"
                    },
                    "expires_at": "2026-11-18T10:40:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages: `invalid request` (malformed JSON or a missing\nrequired field), `filename is required`, `size_bytes must be greater than zero`,\n`file exceeds max upload size`, `unsupported file content_type`,\n`filename extension does not match content_type`,\n`filename must include a supported file extension`,\n`folder path is too long (max 512 characters)` and\n`folder names may only contain letters, numbers, spaces, dots, dashes, and underscores`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "filename extension does not match content_type",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your role cannot upload, you cannot access the workspace, or the upload would exceed your account's free file storage allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset storage free tier exceeded; billing must be enabled to continue",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "description": "The bucket does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset bucket not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The bucket is not `ready`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset bucket is not ready",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/asset-objects/{uid}/complete": {
      "post": {
        "operationId": "completeBucketUpload",
        "summary": "Complete an upload",
        "x-slug": "complete-an-upload",
        "description": "Marks an object created with [Create an upload](/api/buckets/create-an-upload) as `ready`\nafter you have `PUT` its bytes to the presigned `upload_url`. Send no request body.\n\nThe file is checked in storage first. If it is not there yet, the call fails with `409`\n(`the file has not been uploaded yet; upload it to upload_url before completing`) and the\nobject stays `pending_upload`, so you can upload and complete again. The object's\n`size_bytes` and ETag are then taken from storage, not from the `size_bytes` you sent when\ncreating the upload.\n\nCompleting an object that is already `ready` is safe and returns it unchanged. The storage\nallowance is checked again here with the stored size. If completing the upload would take\nyour account past its free file storage, the call fails with `403` and the uploaded file\nis removed from storage; the object stays `pending_upload`.\n\nRequires the `resource write` permission (owner, admin or developer role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketObjectUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The object is ready.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BucketObject"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "upload completed",
                  "data": {
                    "uid": "019a9c01-aa22-7b33-9c44-d5e6f7a8b9c0",
                    "bucket_uid": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b",
                    "key": "projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf",
                    "filename": "report.pdf",
                    "content_type": "application/pdf",
                    "size_bytes": 248331,
                    "status": "ready",
                    "public_url": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf",
                    "read_url": "https://assets.rumptycloud.com/assets-acme-6c7d8e/projects/019a1111-2222-7333-8444-555566667777/marketing-assets/invoices/2026/report-d5e6f7.pdf",
                    "read_url_is_signed": false,
                    "created_at": "2026-11-18T10:30:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your role cannot upload, you cannot access the workspace, or completing the upload would exceed your account's free file storage allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset storage free tier exceeded; billing must be enabled to continue",
                  "code": 403
                }
              }
            }
          },
          "404": {
            "description": "The object (or its bucket) does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset object not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The object is neither `pending_upload` nor `ready` (`asset upload cannot be completed`), or the file has not reached storage yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "the file has not been uploaded yet; upload it to upload_url before completing",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/asset-objects/{uid}/read-url": {
      "post": {
        "operationId": "createBucketObjectReadUrl",
        "summary": "Create an object read URL",
        "x-slug": "create-an-object-read-url",
        "description": "Returns a URL to download a `ready` object. Send no request body.\n\n- In a **private** bucket the URL is presigned. It works without authentication until\n  `expires_at` (10 minutes by default, never more than 7 days) and `is_signed` is `true`.\n- In a **public** bucket the object's permanent public URL is returned, `is_signed` is\n  `false` and `expires_at` is omitted.\n\nRequires read access to the workspace (any role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketObjectUid"
          }
        ],
        "responses": {
          "200": {
            "description": "A URL to read the object.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BucketReadUrl"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "read URL created",
                  "data": {
                    "read_url": "https://assets.rumptycloud.com/assets-acme-7a1b2c/projects/019a1111-2222-7333-8444-555566667777/contracts/signed-msa-e1f2a3.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Date=20261118T110000Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=...",
                    "expires_at": "2026-11-18T11:10:00Z",
                    "is_signed": true
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The object (or its bucket) does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset object not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The object is not `ready`, for example its upload has not been completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset object is not ready",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/asset-objects/{uid}": {
      "delete": {
        "operationId": "deleteBucketObject",
        "summary": "Delete an object",
        "x-slug": "delete-an-object",
        "description": "Deletes the object from storage and removes it from the bucket's object list. This happens\nimmediately (it is not an operation) and cannot be undone. Objects still in\n`pending_upload` can be deleted too, which cancels the upload.\n\nRequires the `resource write` permission (owner, admin or developer role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketObjectUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The object was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "asset object deleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The object (or its bucket) does not exist in this workspace, or was already deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset object not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The object's bucket is being deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "bucket is being deleted",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/asset-buckets/{uid}/access-keys": {
      "get": {
        "operationId": "listBucketAccessKeys",
        "summary": "List bucket access keys",
        "x-slug": "list-bucket-access-keys",
        "description": "Returns the bucket's S3 access keys, newest first. Revoked keys are not included. Secret\naccess keys are never returned, only the `access_key_id`.\n\nRequires the `secrets read` permission (owner, admin or developer role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The bucket's access keys.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/BucketAccessKey"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9d10-5e6f-7a80-9b1c-2d3e4f5a6b7c",
                      "bucket_uid": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b",
                      "name": "CI uploader",
                      "access_key_id": "RPTY3F9A1C2E7B4D8E0F6A5C",
                      "permissions": [
                        "read",
                        "write",
                        "list"
                      ],
                      "status": "active",
                      "endpoint": "https://s3.rumptycloud.com",
                      "region": "olas-closet",
                      "bucket": "assets-acme-6c7d8e",
                      "created_at": "2026-11-18T11:05:00Z",
                      "last_used_at": "2026-11-18T12:41:09Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The bucket does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset bucket not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      },
      "post": {
        "operationId": "createBucketAccessKey",
        "summary": "Create a bucket access key",
        "x-slug": "create-a-bucket-access-key",
        "description": "Creates an S3 access key scoped to this bucket, for use with any S3-compatible client (AWS\nCLI, SDKs, rclone and so on). Point the client at `endpoint` and `region`, and use `bucket`\nas the bucket name.\n\nThe `secret_access_key` appears **only in this response**. Store it securely, because it\ncannot be retrieved again.\n\nThe key starts in `provisioning` while it is granted on storage, and becomes `active` when\nthe operation finishes. Poll [Get an operation](/api/operations/get-an-operation) with\n`operation_id` before using the key. If provisioning fails the key's status is `failed`.\n\nThe bucket must be `ready`. Requires the `secrets manage` permission (owner, admin or\ndeveloper role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/BucketUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Label for the key. Leading and trailing spaces are trimmed.",
                    "example": "CI uploader"
                  },
                  "permissions": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "read",
                        "write",
                        "list",
                        "delete"
                      ]
                    },
                    "description": "What the key may do. Case-insensitive, duplicates are ignored. Defaults to all\nfour (`read`, `write`, `list`, `delete`) when omitted or empty.\n",
                    "example": [
                      "read",
                      "write",
                      "list"
                    ]
                  }
                }
              },
              "example": {
                "name": "CI uploader",
                "permissions": [
                  "read",
                  "write",
                  "list"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The key was created and its provisioning operation was queued. The response includes the one-time `secret_access_key`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BucketAccessKeyCreateResult"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "bucket access key created. Copy the secret now. It will not be shown again.",
                  "data": {
                    "uid": "019a9d10-5e6f-7a80-9b1c-2d3e4f5a6b7c",
                    "bucket_uid": "019a9b3c-1d2e-7f40-8a5b-6c7d8e9f0a1b",
                    "name": "CI uploader",
                    "access_key_id": "RPTY3F9A1C2E7B4D8E0F6A5C",
                    "permissions": [
                      "read",
                      "write",
                      "list"
                    ],
                    "status": "provisioning",
                    "endpoint": "https://s3.rumptycloud.com",
                    "region": "olas-closet",
                    "bucket": "assets-acme-6c7d8e",
                    "created_at": "2026-11-18T11:05:00Z",
                    "secret_access_key": "q8Zr3mT1vX9bN2kL5pW7yH4cF6dJ0sA1gE3uR8iO",
                    "operation_id": "019a9d10-5e70-7b91-8c2d-3e4f5a6b7c8d",
                    "operation_status": "queued",
                    "events_url": "/v1/operations/019a9d10-5e70-7b91-8c2d-3e4f5a6b7c8d/events"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed. Possible messages: `invalid request` (malformed JSON or missing `name`), `name is required`, `unsupported permission \"<value>\"`, `at least one permission is required` (only blank entries were sent).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "unsupported permission \"admin\"",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The bucket does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset bucket not found",
                  "code": 404
                }
              }
            }
          },
          "409": {
            "description": "The bucket is not `ready`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "asset bucket is not ready",
                  "code": 409
                }
              }
            }
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      }
    },
    "/v1/asset-bucket-access-keys/{uid}": {
      "delete": {
        "operationId": "revokeBucketAccessKey",
        "summary": "Revoke a bucket access key",
        "x-slug": "revoke-a-bucket-access-key",
        "description": "Revokes a bucket access key. The key is marked `revoked` immediately and drops out of\n[List bucket access keys](/api/buckets/list-bucket-access-keys). Its grant on storage is\nremoved by a background sync shortly afterwards. Revoking a key that is already revoked\nsucceeds and changes nothing.\n\nRequires the `secrets manage` permission (owner, admin or developer role).\n",
        "tags": [
          "Buckets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "The access key's `uid` (not its `access_key_id`).",
            "schema": {
              "type": "string",
              "example": "019a9d10-5e6f-7a80-9b1c-2d3e4f5a6b7c"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The key was revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "bucket access key revoked"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The access key does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "bucket access key not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/firewall-policies": {
      "get": {
        "operationId": "listFirewallPolicies",
        "summary": "List firewall policies",
        "x-slug": "list-firewall-policies",
        "description": "Returns the workspace's firewall policies, newest first, each with its rules and the\nresources it is attached to. This endpoint is not paginated.\n",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's firewall policies.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FirewallPolicy"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a9e10-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                      "name": "Web servers",
                      "slug": "web-servers",
                      "description": "Public HTTP and SSH from the office",
                      "is_default": false,
                      "rules": [
                        {
                          "operation_id": "",
                          "uid": "019a9e10-7a8c-7d0e-9f1a-2b3c4d5e6f7a",
                          "direction": "inbound",
                          "action": "allow",
                          "protocol": "tcp",
                          "port_start": 22,
                          "port_end": 22,
                          "cidr": "0.0.0.0/0",
                          "description": "Allow SSH access. Required for rumpty ssh and CLI connectivity.",
                          "is_default": true
                        },
                        {
                          "operation_id": "",
                          "uid": "019a9e10-7a8d-7e1f-8a2b-3c4d5e6f7a8b",
                          "direction": "inbound",
                          "action": "allow",
                          "protocol": "tcp",
                          "port_start": 8080,
                          "port_end": 8080,
                          "cidr": "0.0.0.0/0",
                          "description": "Allow HTTP traffic on the default app port used by all Rumpty VMs.",
                          "is_default": true
                        }
                      ],
                      "attached_resources": [
                        {
                          "operation_id": "",
                          "uid": "019a9e22-5b6c-7d7e-8f9a-0b1c2d3e4f5a",
                          "resource_type": "vm",
                          "resource": {
                            "uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                            "name": "web-1",
                            "slug": "web-1",
                            "status": "running"
                          }
                        }
                      ],
                      "created_at": "2026-11-18T10:50:00Z",
                      "updated_at": "2026-11-18T10:50:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      },
      "post": {
        "operationId": "createFirewallPolicy",
        "summary": "Create a firewall policy",
        "x-slug": "create-a-firewall-policy",
        "description": "Creates a firewall policy. The policy is not attached to anything yet, so it has no effect\nuntil you [attach it](/api/firewall-policies/attach-a-firewall-policy) to a resource.\n\nEvery new policy starts with two default rules, so attaching it does not lock you out:\n\n- TCP port `22` from `0.0.0.0/0` (SSH, needed by `rumpty ssh` and the CLI).\n- TCP port `8080` from `0.0.0.0/0` (the default VM app port).\n\nYou can update or delete these rules like any other.\n\nPolicy names must be unique in the workspace. A name already used by another policy is\nrejected with `409`. The check is on the exact name (after trimming spaces) and is\ncase-sensitive, so `Web servers` and `web servers` can both exist. Names of deleted\npolicies can be reused.\n",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the policy. Leading and trailing spaces are trimmed. Must be unique in the workspace.",
                    "example": "Web servers"
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional free-text description. Leading and trailing spaces are trimmed.",
                    "example": "Public HTTP and SSH from the office"
                  },
                  "is_default": {
                    "type": "boolean",
                    "default": false,
                    "description": "Marks the policy as a workspace default. This is a label only. The API does not attach default policies to resources automatically."
                  }
                }
              },
              "example": {
                "name": "Web servers",
                "description": "Public HTTP and SSH from the office"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The policy was created with its default rules. `attached_resources` is omitted because a new policy has no attachments.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/FirewallPolicy"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "firewall policy created",
                  "data": {
                    "uid": "019a9e10-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                    "name": "Web servers",
                    "slug": "web-servers",
                    "description": "Public HTTP and SSH from the office",
                    "is_default": false,
                    "rules": [
                      {
                        "operation_id": "",
                        "uid": "019a9e10-7a8c-7d0e-9f1a-2b3c4d5e6f7a",
                        "direction": "inbound",
                        "action": "allow",
                        "protocol": "tcp",
                        "port_start": 22,
                        "port_end": 22,
                        "cidr": "0.0.0.0/0",
                        "description": "Allow SSH access. Required for rumpty ssh and CLI connectivity.",
                        "is_default": true
                      },
                      {
                        "operation_id": "",
                        "uid": "019a9e10-7a8d-7e1f-8a2b-3c4d5e6f7a8b",
                        "direction": "inbound",
                        "action": "allow",
                        "protocol": "tcp",
                        "port_start": 8080,
                        "port_end": 8080,
                        "cidr": "0.0.0.0/0",
                        "description": "Allow HTTP traffic on the default app port used by all Rumpty VMs.",
                        "is_default": true
                      }
                    ],
                    "created_at": "2026-11-18T10:50:00Z",
                    "updated_at": "2026-11-18T10:50:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed: the body is not valid JSON (`invalid request`) or `name` is missing or blank (`policy name is required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "policy name is required",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/FirewallPolicyNameTaken"
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403",
          "409"
        ]
      }
    },
    "/v1/firewall-policies/{uid}": {
      "get": {
        "operationId": "getFirewallPolicy",
        "summary": "Get a firewall policy",
        "x-slug": "get-a-firewall-policy",
        "description": "Returns one firewall policy with its rules and the resources it is attached to.",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/FirewallPolicyUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The firewall policy.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/FirewallPolicy"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a9e10-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                    "name": "Web servers",
                    "slug": "web-servers",
                    "description": "Public HTTP and SSH from the office",
                    "is_default": false,
                    "rules": [
                      {
                        "operation_id": "",
                        "uid": "019a9e10-7a8c-7d0e-9f1a-2b3c4d5e6f7a",
                        "direction": "inbound",
                        "action": "allow",
                        "protocol": "tcp",
                        "port_start": 22,
                        "port_end": 22,
                        "cidr": "203.0.113.0/24",
                        "description": "SSH from the office",
                        "is_default": true
                      },
                      {
                        "operation_id": "",
                        "uid": "019a9e31-6c7d-7e8f-9a0b-1c2d3e4f5a6b",
                        "direction": "inbound",
                        "action": "allow",
                        "protocol": "tcp",
                        "port_start": 443,
                        "port_end": 443,
                        "cidr": "0.0.0.0/0",
                        "description": "HTTPS",
                        "is_default": false
                      }
                    ],
                    "attached_resources": [
                      {
                        "operation_id": "",
                        "uid": "019a9e22-5b6c-7d7e-8f9a-0b1c2d3e4f5a",
                        "resource_type": "vm",
                        "resource": {
                          "uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                          "name": "web-1",
                          "slug": "web-1",
                          "status": "running"
                        }
                      }
                    ],
                    "created_at": "2026-11-18T10:50:00Z",
                    "updated_at": "2026-11-18T10:50:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/FirewallPolicyNotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      },
      "patch": {
        "operationId": "updateFirewallPolicy",
        "summary": "Update a firewall policy",
        "x-slug": "update-a-firewall-policy",
        "description": "Changes a policy's name, description or default flag. Send only the fields you want to\nchange. Renaming the policy also changes its `slug`. This does not change any rules, so no\nfirewall operation is queued.\n\nA name that another policy in the workspace already uses (exact, case-sensitive match) is\nrejected with `409`.\n",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/FirewallPolicyUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New name. Leading and trailing spaces are trimmed. Cannot be blank.",
                    "example": "Public web"
                  },
                  "description": {
                    "type": "string",
                    "description": "New description. Send an empty string to clear it.",
                    "example": "Public HTTPS and office SSH"
                  },
                  "is_default": {
                    "type": "boolean",
                    "description": "Marks or unmarks the policy as a workspace default. This is a label only."
                  }
                }
              },
              "example": {
                "name": "Public web",
                "description": "Public HTTPS and office SSH"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated policy.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/FirewallPolicy"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "firewall policy updated",
                  "data": {
                    "uid": "019a9e10-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                    "name": "Public web",
                    "slug": "public-web",
                    "description": "Public HTTPS and office SSH",
                    "is_default": false,
                    "rules": [
                      {
                        "operation_id": "",
                        "uid": "019a9e10-7a8c-7d0e-9f1a-2b3c4d5e6f7a",
                        "direction": "inbound",
                        "action": "allow",
                        "protocol": "tcp",
                        "port_start": 22,
                        "port_end": 22,
                        "cidr": "203.0.113.0/24",
                        "description": "SSH from the office",
                        "is_default": true
                      }
                    ],
                    "created_at": "2026-11-18T10:50:00Z",
                    "updated_at": "2026-11-18T12:15:03Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (`invalid request`) or `name` is blank (`policy name cannot be empty`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "policy name cannot be empty",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/FirewallPolicyNotFound"
          },
          "409": {
            "$ref": "#/components/responses/FirewallPolicyNameTaken"
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404",
          "409"
        ]
      },
      "delete": {
        "operationId": "deleteFirewallPolicy",
        "summary": "Delete a firewall policy",
        "x-slug": "delete-a-firewall-policy",
        "description": "Deletes the policy, even if it is attached to resources. Its rules and all of its\nattachments are deleted with it in one step, so the policy stops applying straight away and\nno longer appears in any resource's policy list. A `firewall.apply` operation is queued for\nevery resource it was attached to, so their firewalls are rebuilt from their remaining\npolicies. A resource left with no policy is no longer filtered.\n",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/FirewallPolicyUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The policy was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "firewall policy deleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/FirewallPolicyNotFound"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/firewall-policies/{uid}/rules": {
      "post": {
        "operationId": "addFirewallRule",
        "summary": "Add a firewall rule",
        "x-slug": "add-a-firewall-rule",
        "description": "Adds an allow rule to the policy and queues a `firewall.apply` operation for every resource\nthe policy is attached to. The response's `operation_id` is the first of those operations,\nor an empty string when the policy is not attached to anything.\n\nDefaults and limits:\n\n- `direction` defaults to `inbound`, `action` to `allow` and `protocol` to `tcp`.\n- Leave out both ports (or send `0` for both) to match all ports.\n- Send only `port_start` to match a single port.\n- `cidr` is required. A single address needs a prefix length, such as `198.51.100.7/32`.\n",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/FirewallPolicyUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "cidr"
                ],
                "properties": {
                  "direction": {
                    "type": "string",
                    "enum": [
                      "inbound",
                      "outbound"
                    ],
                    "default": "inbound",
                    "description": "Traffic direction the rule applies to. Case-insensitive."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "allow"
                    ],
                    "default": "allow",
                    "description": "What to do with matching traffic. Only `allow` is supported."
                  },
                  "protocol": {
                    "type": "string",
                    "enum": [
                      "tcp",
                      "udp",
                      "all"
                    ],
                    "default": "tcp",
                    "description": "IP protocol to match. Case-insensitive.",
                    "example": "tcp"
                  },
                  "port_start": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535,
                    "description": "First port of the range, from 1 to 65535. `0` together with `port_end` `0` (or both omitted) matches all ports.",
                    "example": 443
                  },
                  "port_end": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535,
                    "description": "Last port of the range. Defaults to `port_start`. Must not be lower than `port_start`.",
                    "example": 443
                  },
                  "cidr": {
                    "type": "string",
                    "description": "Source address range in CIDR notation, IPv4 or IPv6. Use `0.0.0.0/0` to allow any IPv4 source.",
                    "example": "0.0.0.0/0"
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional note about what the rule is for. Leading and trailing spaces are trimmed.",
                    "example": "HTTPS"
                  }
                }
              },
              "example": {
                "protocol": "tcp",
                "port_start": 443,
                "cidr": "0.0.0.0/0",
                "description": "HTTPS"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The rule was created.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/FirewallRule"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "firewall rule created",
                  "data": {
                    "operation_id": "019a9e31-6c7e-7f80-8a1b-2c3d4e5f6a7b",
                    "uid": "019a9e31-6c7d-7e8f-9a0b-1c2d3e4f5a6b",
                    "direction": "inbound",
                    "action": "allow",
                    "protocol": "tcp",
                    "port_start": 443,
                    "port_end": 443,
                    "cidr": "0.0.0.0/0",
                    "description": "HTTPS",
                    "is_default": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/FirewallRuleInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/FirewallPolicyNotFound"
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/firewall-policies/{uid}/rules/{rule_uid}": {
      "patch": {
        "operationId": "updateFirewallRule",
        "summary": "Update a firewall rule",
        "x-slug": "update-a-firewall-rule",
        "description": "Changes a rule. Send only the fields you want to change. Values are validated the same way\nas in [Add a firewall rule](/api/firewall-policies/add-a-firewall-rule), and the policy's\ndefault rules can be changed too.\n\nIf you send either port, the range is rebuilt from the ports in this request only: a missing\n`port_end` becomes `port_start`, and a missing `port_start` is treated as `0`, which fails\nvalidation. To change a range, send both `port_start` and `port_end`.\n\nA `firewall.apply` operation is queued for every resource the policy is attached to. The\nresponse's `operation_id` is the first of those, or an empty string when the policy is not\nattached to anything.\n",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/FirewallPolicyUid"
          },
          {
            "$ref": "#/components/parameters/FirewallRuleUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "direction": {
                    "type": "string",
                    "enum": [
                      "inbound",
                      "outbound"
                    ],
                    "description": "Traffic direction. An empty string means `inbound`."
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "allow"
                    ],
                    "description": "Only `allow` is supported."
                  },
                  "protocol": {
                    "type": "string",
                    "enum": [
                      "tcp",
                      "udp",
                      "all"
                    ],
                    "description": "IP protocol to match. An empty string means `tcp`."
                  },
                  "port_start": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535,
                    "description": "First port of the range. See above for how ports are combined.",
                    "example": 22
                  },
                  "port_end": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535,
                    "description": "Last port of the range.",
                    "example": 22
                  },
                  "cidr": {
                    "type": "string",
                    "description": "Source address range in CIDR notation. Cannot be blank.",
                    "example": "203.0.113.0/24"
                  },
                  "description": {
                    "type": "string",
                    "description": "New note. Send an empty string to clear it.",
                    "example": "SSH from the office"
                  }
                }
              },
              "example": {
                "cidr": "203.0.113.0/24",
                "description": "SSH from the office"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated rule.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/FirewallRule"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "firewall rule updated",
                  "data": {
                    "operation_id": "019a9e40-8d9e-7f0a-9b1c-2d3e4f5a6b7c",
                    "uid": "019a9e10-7a8c-7d0e-9f1a-2b3c4d5e6f7a",
                    "direction": "inbound",
                    "action": "allow",
                    "protocol": "tcp",
                    "port_start": 22,
                    "port_end": 22,
                    "cidr": "203.0.113.0/24",
                    "description": "SSH from the office",
                    "is_default": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/FirewallRuleInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The policy, or the rule within it, does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "firewall rule not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "400",
          "401",
          "403",
          "404"
        ]
      },
      "delete": {
        "operationId": "deleteFirewallRule",
        "summary": "Delete a firewall rule",
        "x-slug": "delete-a-firewall-rule",
        "description": "Deletes a rule from the policy, including the default SSH and app-port rules. A\n`firewall.apply` operation is queued for every resource the policy is attached to, but its\nID is not returned.\n\nDeleting the SSH rule from a policy attached to a VM can block `rumpty ssh` unless another\nattached policy still allows port 22.\n",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/FirewallPolicyUid"
          },
          {
            "$ref": "#/components/parameters/FirewallRuleUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The rule was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "firewall rule deleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The policy, or the rule within it, does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "firewall rule not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/firewall-policies/{uid}/attachments": {
      "post": {
        "operationId": "attachFirewallPolicy",
        "summary": "Attach a firewall policy",
        "x-slug": "attach-a-firewall-policy",
        "description": "Attaches the policy to a VM, database or deployment in the workspace and queues a\n`firewall.apply` operation for that resource. From then on the resource only accepts\ntraffic allowed by its attached policies.\n\nAttaching a policy that is already attached to the resource changes nothing. It returns\nthe existing attachment with `201` and an empty `operation_id`.\n",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/FirewallPolicyUid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "resource_type",
                  "resource_uid"
                ],
                "properties": {
                  "resource_type": {
                    "type": "string",
                    "enum": [
                      "vm",
                      "database",
                      "deployment"
                    ],
                    "description": "Kind of resource to attach the policy to. Case-insensitive.",
                    "example": "vm"
                  },
                  "resource_uid": {
                    "type": "string",
                    "description": "UID of the VM, database or deployment.",
                    "example": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90"
                  }
                }
              },
              "example": {
                "resource_type": "vm",
                "resource_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The policy is attached to the resource.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/FirewallPolicyAttachment"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "firewall policy attached",
                  "data": {
                    "operation_id": "019a9e22-5b6d-7e8f-9a0b-1c2d3e4f5a6c",
                    "uid": "019a9e22-5b6c-7d7e-8f9a-0b1c2d3e4f5a",
                    "resource_type": "vm",
                    "resource": {
                      "uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                      "name": "web-1",
                      "slug": "web-1",
                      "status": "running"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (`invalid request`) or `resource_type` is not supported (`resource_type must be vm, database, or deployment`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "resource_type must be vm, database, or deployment",
                  "code": 400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The policy or the resource does not exist in this workspace. Messages: `firewall policy not found`, `vm not found`, `database not found` or `deployment not found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "vm not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "201",
          "400",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/firewall-policies/{uid}/attachments/{attachment_uid}": {
      "delete": {
        "operationId": "detachFirewallPolicy",
        "summary": "Detach a firewall policy",
        "x-slug": "detach-a-firewall-policy",
        "description": "Removes an attachment, so the policy no longer applies to that resource. A `firewall.apply`\noperation is queued for the resource, but its ID is not returned. If no other policy is\nattached, the resource is no longer filtered.\n\nFind the attachment's `uid` in `attached_resources` from\n[Get a firewall policy](/api/firewall-policies/get-a-firewall-policy).\n",
        "tags": [
          "Firewall Policies"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceSlug"
          },
          {
            "$ref": "#/components/parameters/FirewallPolicyUid"
          },
          {
            "name": "attachment_uid",
            "in": "path",
            "required": true,
            "description": "The attachment's `uid`.",
            "schema": {
              "type": "string",
              "example": "019a9e22-5b6c-7d7e-8f9a-0b1c2d3e4f5a"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The policy was detached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "firewall policy detached"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The policy, or the attachment on it, does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "firewall policy attachment not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/wallet": {
      "get": {
        "operationId": "getWallet",
        "summary": "Get your wallet balance",
        "x-slug": "get-your-wallet-balance",
        "description": "Returns your current wallet balance. Usage is charged against this balance. The balance is\nheld in USD. `display_balance_minor` is the same balance converted to `display_currency`\nfor display only.\n\nRequires a verified email address.\n",
        "tags": [
          "Billing"
        ],
        "responses": {
          "200": {
            "description": "Your wallet balance.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/WalletSummary"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "balance_cents": 2480,
                    "currency": "USD",
                    "display_currency": "USD",
                    "exchange_rate": 1,
                    "display_balance_minor": 2480
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/BillingForbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/wallet/entries": {
      "get": {
        "operationId": "listWalletEntries",
        "summary": "List wallet entries",
        "x-slug": "list-wallet-entries",
        "description": "Returns the 50 most recent movements on your wallet balance, newest first: top-ups, credits\nand usage charges. Each entry records the balance before and after it.\n\nFor the payment attempts behind top-ups, including failed ones, see\n[List payment transactions](/api/billing/list-payment-transactions).\n\nRequires a verified email address.\n",
        "tags": [
          "Billing"
        ],
        "responses": {
          "200": {
            "description": "Your recent wallet entries.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WalletEntry"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a4c20-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
                      "type": "debit",
                      "amount_cents": -1520,
                      "balance_before_cents": 4000,
                      "balance_after_cents": 2480,
                      "currency": "USD",
                      "reason": "Usage charge INV-2026-000123",
                      "created_at": "2026-11-01T00:05:12Z"
                    },
                    {
                      "uid": "019a3b10-2b3c-7d4e-9f50-6a7b8c9d0e1f",
                      "type": "credit",
                      "amount_cents": 2000,
                      "balance_before_cents": 2000,
                      "balance_after_cents": 4000,
                      "currency": "USD",
                      "reason": "wallet top-up",
                      "provider": "paystack",
                      "created_at": "2026-10-28T14:31:09Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/BillingForbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/wallet/transactions": {
      "get": {
        "operationId": "listPaymentTransactions",
        "summary": "List payment transactions",
        "x-slug": "list-payment-transactions",
        "description": "Returns your 50 most recent payment attempts, newest first: wallet top-ups, card\nverifications and automatic charges to settle usage. Pending, failed and abandoned attempts\nare included, so this is the place to check why a payment did not go through.\n\n`charge_minor` is what was charged at the payment provider, in `charge_currency`.\n`usd_cents` is the US dollar amount it was worth.\n\nRequires a verified email address.\n",
        "tags": [
          "Billing"
        ],
        "responses": {
          "200": {
            "description": "Your recent payment transactions.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WalletPaymentTransaction"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a3b0f-7e8f-7a90-8b1c-2d3e4f5a6b7c",
                      "reference": "topup_019a3b0f-7e8f-7a90-8b1c-2d3e4f5a6b7c",
                      "provider": "paystack",
                      "purpose": "wallet_topup",
                      "status": "success",
                      "charge_currency": "USD",
                      "charge_minor": 2000,
                      "usd_cents": 2000,
                      "exchange_rate": 1,
                      "fee_minor": 78,
                      "channel": "card",
                      "card_last4": "4081",
                      "created_at": "2026-10-28T14:29:51Z",
                      "paid_at": "2026-10-28T14:31:08Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/BillingForbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/wallet/cards": {
      "get": {
        "operationId": "listCards",
        "summary": "List saved cards",
        "x-slug": "list-saved-cards",
        "description": "Returns the cards you saved for payments, default card first, then newest first. Only display\ndetails are returned. Card numbers are never stored.\n\nCards are added through the browser checkout in the console.\n\nRequires a verified email address.\n",
        "tags": [
          "Billing"
        ],
        "responses": {
          "200": {
            "description": "Your saved cards.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WalletCard"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a3b11-3c4d-7e5f-8a6b-7c8d9e0f1a2b",
                      "provider": "paystack",
                      "last4": "4081",
                      "card_type": "visa",
                      "bank": "Test Bank",
                      "exp_month": "12",
                      "exp_year": "2028",
                      "is_default": true,
                      "created_at": "2026-10-28T14:31:09Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/BillingForbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/wallet/cards/{uid}": {
      "delete": {
        "operationId": "deleteCard",
        "summary": "Remove a saved card",
        "x-slug": "remove-a-saved-card",
        "description": "Removes a saved card. If it was your default card, your most recently added remaining card\nbecomes the default.\n\nRequires a verified email address.\n",
        "tags": [
          "Billing"
        ],
        "parameters": [
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "The card's `uid` from [List saved cards](/api/billing/list-saved-cards).",
            "schema": {
              "type": "string",
              "example": "019a3b11-3c4d-7e5f-8a6b-7c8d9e0f1a2b"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The card was removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "success": true,
                  "message": "ok"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/BillingForbidden"
          },
          "404": {
            "description": "You have no saved card with this `uid` (`card not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "card not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/billing/summary": {
      "get": {
        "operationId": "getBillingSummary",
        "summary": "Get billing summary",
        "x-slug": "get-billing-summary",
        "description": "Returns your usage and charges for the current billing cycle, across every workspace you own.\nUsage is brought up to date when you call this, so the totals include charges up to now.\n\n- `breakdown` groups this cycle's charges by resource type and metric, with each resource's\n  share in `resources`, including resources removed earlier in the cycle.\n- `current_resources` lists what is billable right now, grouped by resource type and plan,\n  with the hourly and monthly rate of each.\n- `free_allowances` shows how much of each free tier you have used, including the AI\n  inference token allowance.\n\nRequires a verified email address.\n",
        "tags": [
          "Billing"
        ],
        "responses": {
          "200": {
            "description": "Your billing summary for the current cycle.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BillingSummary"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "currency": "USD",
                    "display_currency": "USD",
                    "exchange_rate": 1,
                    "current_cycle": {
                      "mode": "calendar_month",
                      "starts_at": "2026-11-01T00:00:00Z",
                      "ends_at": "2026-12-01T00:00:00Z"
                    },
                    "total_amount_micros": 5869200,
                    "total_amount_cents": 587,
                    "current_hourly_amount_micros": 13973,
                    "current_monthly_amount_cents": 1020,
                    "current_resource_count": 1,
                    "usage_quantity": 420.04,
                    "usage_record_count": 18,
                    "resource_count": 1,
                    "breakdown": [
                      {
                        "resource_type": "vm",
                        "metric": "runtime",
                        "unit": "hour",
                        "currency": "USD",
                        "quantity": 420.04,
                        "amount_micros": 5869200,
                        "amount_cents": 587,
                        "usage_record_count": 18,
                        "resource_count": 1,
                        "resources": [
                          {
                            "resource_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                            "resource_name": "web-1",
                            "plan_slug": "small",
                            "quantity": 420.04,
                            "amount_micros": 5869200,
                            "still_active": true,
                            "last_period_end": "2026-11-18T12:02:24Z"
                          }
                        ]
                      }
                    ],
                    "free_allowances": [
                      {
                        "resource_type": "inference",
                        "plan_slug": "inference-tokens",
                        "plan_name": "AI inference tokens",
                        "included": 1000000,
                        "used": 15230,
                        "remaining": 984770
                      }
                    ],
                    "current_resources": [
                      {
                        "resource_type": "vm",
                        "plan_slug": "small",
                        "plan_name": "Small",
                        "currency": "USD",
                        "resource_count": 1,
                        "hourly_amount_micros": 13973,
                        "monthly_amount_cents": 1020,
                        "cycle_runtime_hours": 420.04,
                        "resources": [
                          {
                            "resource_uid": "019a8f2c-7d41-7b3e-9c55-4e2f1a6b8d90",
                            "resource_name": "web-1",
                            "status": "running",
                            "billing_started_at": "2026-11-01T00:00:00Z",
                            "hourly_amount_micros": 13973,
                            "monthly_amount_cents": 1020,
                            "free_allowance": false,
                            "cycle_runtime_hours": 420.04,
                            "cycle_amount_micros": 5869200
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/BillingForbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/invoices": {
      "get": {
        "operationId": "listInvoices",
        "summary": "List invoices",
        "x-slug": "list-invoices",
        "description": "Returns your 50 most recent invoices, newest first, each with its line items. Invoices are\ncreated for completed billing cycles.\n\nRequires a verified email address.\n",
        "tags": [
          "Billing"
        ],
        "responses": {
          "200": {
            "description": "Your invoices.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": [
                    {
                      "uid": "019a4c1f-8d9e-7f0a-8b1c-2d3e4f5a6b7c",
                      "number": "INV-2026-000123",
                      "status": "paid",
                      "period_start": "2026-10-01T00:00:00Z",
                      "period_end": "2026-11-01T00:00:00Z",
                      "issued_at": "2026-11-01T00:05:12Z",
                      "paid_at": "2026-11-01T00:05:12Z",
                      "base_currency": "USD",
                      "subtotal_net_cents": 1520,
                      "tax_total_cents": 0,
                      "total_gross_cents": 1520,
                      "currency": "USD",
                      "exchange_rate": 1,
                      "subtotal_net_minor": 1520,
                      "tax_total_minor": 0,
                      "total_gross_minor": 1520,
                      "tax_type": "VAT",
                      "tax_rate_bps": 0,
                      "tax_reason": "zero_rated_export",
                      "customer_name": "ada",
                      "customer_email": "ada@acme.dev",
                      "customer_country": "GB",
                      "customer_tax_id": "GB123456789",
                      "company": {
                        "name": "RumptyCloud"
                      },
                      "lines": [
                        {
                          "description": "vm (runtime)",
                          "resource_type": "vm",
                          "metric": "runtime",
                          "unit": "hour",
                          "quantity": 744,
                          "net_cents": 1020,
                          "tax_cents": 0,
                          "tax_rate_bps": 0,
                          "tax_type": "VAT",
                          "tax_reason": "zero_rated_export"
                        },
                        {
                          "description": "Snapshot storage (GiB-month)",
                          "resource_type": "snapshot",
                          "metric": "storage",
                          "unit": "gb_month",
                          "quantity": 10,
                          "net_cents": 500,
                          "tax_cents": 0,
                          "tax_rate_bps": 0,
                          "tax_type": "VAT",
                          "tax_reason": "zero_rated_export"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/BillingForbidden"
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403"
        ]
      }
    },
    "/v1/invoices/{uid}": {
      "get": {
        "operationId": "getInvoice",
        "summary": "Get an invoice",
        "x-slug": "get-an-invoice",
        "description": "Returns one of your invoices with its line items. To download it as a PDF, use\n[Download an invoice PDF](/api/billing/download-an-invoice-pdf).\n\nRequires a verified email address.\n",
        "tags": [
          "Billing"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/InvoiceUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The invoice.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Invoice"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "success": true,
                  "message": "ok",
                  "data": {
                    "uid": "019a4c1f-8d9e-7f0a-8b1c-2d3e4f5a6b7c",
                    "number": "INV-2026-000123",
                    "status": "paid",
                    "period_start": "2026-10-01T00:00:00Z",
                    "period_end": "2026-11-01T00:00:00Z",
                    "issued_at": "2026-11-01T00:05:12Z",
                    "paid_at": "2026-11-01T00:05:12Z",
                    "base_currency": "USD",
                    "subtotal_net_cents": 1020,
                    "tax_total_cents": 0,
                    "total_gross_cents": 1020,
                    "currency": "USD",
                    "exchange_rate": 1,
                    "subtotal_net_minor": 1020,
                    "tax_total_minor": 0,
                    "total_gross_minor": 1020,
                    "tax_type": "VAT",
                    "tax_rate_bps": 0,
                    "tax_reason": "zero_rated_export",
                    "customer_name": "ada",
                    "customer_email": "ada@acme.dev",
                    "customer_country": "GB",
                    "customer_tax_id": "GB123456789",
                    "company": {
                      "name": "RumptyCloud"
                    },
                    "lines": [
                      {
                        "description": "vm (runtime)",
                        "resource_type": "vm",
                        "metric": "runtime",
                        "unit": "hour",
                        "quantity": 744,
                        "net_cents": 1020,
                        "tax_cents": 0,
                        "tax_rate_bps": 0,
                        "tax_type": "VAT",
                        "tax_reason": "zero_rated_export"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/BillingForbidden"
          },
          "404": {
            "description": "You have no invoice with this `uid` (`invoice not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invoice not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    },
    "/v1/invoices/{uid}/pdf": {
      "get": {
        "operationId": "downloadInvoicePdf",
        "summary": "Download an invoice PDF",
        "x-slug": "download-an-invoice-pdf",
        "description": "Returns the invoice as a PDF tax invoice. Amounts are shown in the invoice's charge\ncurrency. The response is the raw PDF file, not JSON, with a `Content-Disposition` header\nnaming it `invoice-<number>.pdf`. Errors are still returned as JSON.\n\nRequires a verified email address.\n",
        "tags": [
          "Billing"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/InvoiceUid"
          }
        ],
        "responses": {
          "200": {
            "description": "The invoice PDF.",
            "headers": {
              "Content-Disposition": {
                "description": "Marks the response as a download, e.g. `attachment; filename=\"invoice-INV-2026-000123.pdf\"`.",
                "schema": {
                  "type": "string",
                  "example": "attachment; filename=\"invoice-INV-2026-000123.pdf\""
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "The PDF file."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/BillingForbidden"
          },
          "404": {
            "description": "You have no invoice with this `uid` (`invoice not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "message": "invoice not found",
                  "code": 404
                }
              }
            }
          }
        },
        "x-response-order": [
          "200",
          "401",
          "403",
          "404"
        ]
      }
    }
  }
}
