{
  "openapi": "3.1.0",
  "info": {
    "title": "Ample Computer API",
    "version": "0.1.46",
    "summary": "Deploy and operate AI-built applications.",
    "description": "REST API behind the Ample Computer CLI and remote MCP server. Agents normally drive Ample Computer through the remote MCP server or the CLI (ample plan, ample up, ample deploy); this description exists so an agent can understand the surface, authenticate and read state directly. Errors are JSON objects of the form {\"error\":{\"code\":\"...\",\"message\":\"...\"}}.",
    "contact": {
      "name": "Ample Computer",
      "url": "https://amplecomputer.co"
    },
    "termsOfService": "https://amplecomputer.co/terms"
  },
  "externalDocs": {
    "description": "Agent instructions",
    "url": "https://amplecomputer.co/AGENTS.md"
  },
  "servers": [
    {
      "url": "https://api.ample.computer",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "auth"
    },
    {
      "name": "email"
    },
    {
      "name": "servers"
    },
    {
      "name": "deployments"
    },
    {
      "name": "domains"
    },
    {
      "name": "operations"
    },
    {
      "name": "databases"
    },
    {
      "name": "buckets"
    },
    {
      "name": "volumes"
    },
    {
      "name": "jobs"
    },
    {
      "name": "workspaces"
    },
    {
      "name": "account"
    },
    {
      "name": "catalog"
    },
    {
      "name": "mcp"
    },
    {
      "name": "a2a"
    },
    {
      "name": "meta"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/email/apps/{app}": {
      "get": {
        "operationId": "getAppEmail",
        "summary": "Inspect app email",
        "description": "can_send says whether a real send would be tried now; when false, blocked_by names the first thing in the way (account_unclaimed, paid_plan_required, domain_pending, ...) and next_action says what to do. Also sender and domain state, allowance and runtime credential binding.",
        "tags": [
          "email"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "email:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "App name or deployment ID"
          }
        ],
        "responses": {
          "200": {
            "description": "App email status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Email status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "enableAppEmail",
        "summary": "Enable app email",
        "description": "Sets up the app sender; its domain is verified automatically once the account is on a paid plan. Sends no email. Returns the same status as GET (read can_send). Deploy afterward to bind server-only credentials.",
        "tags": [
          "email"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "email:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "App name or deployment ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Sender settings",
                "properties": {
                  "sender": {
                    "type": "string",
                    "description": "Local part on this app domain, for example hello"
                  },
                  "display_name": {
                    "type": "string"
                  },
                  "reply_to": {
                    "type": "string",
                    "description": "Existing inbox for replies; empty clears it"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "App email status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Email status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/email/apps/{app}/update": {
      "post": {
        "operationId": "updateAppEmail",
        "summary": "Update sender settings",
        "description": "Account-scoped email management. Provider credentials are never returned.",
        "tags": [
          "email"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "email:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "App name or deployment ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Sender settings",
                "properties": {
                  "sender": {
                    "type": "string",
                    "description": "Local part on this app domain, for example hello"
                  },
                  "display_name": {
                    "type": "string"
                  },
                  "reply_to": {
                    "type": "string",
                    "description": "Existing inbox for replies; empty clears it"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated email status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Email status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/email/apps/{app}/disable": {
      "post": {
        "operationId": "disableAppEmail",
        "summary": "Disable sending and revoke app credential",
        "description": "Account-scoped email management. Provider credentials are never returned.",
        "tags": [
          "email"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "email:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "App name or deployment ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Updated email status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Email status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/email/apps/{app}/rotate-token": {
      "post": {
        "operationId": "rotateAppEmailToken",
        "summary": "Rotate app credential; redeploy afterward",
        "description": "Account-scoped email management. Provider credentials are never returned.",
        "tags": [
          "email"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "email:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "App name or deployment ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Updated email status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Email status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/email/send": {
      "post": {
        "operationId": "sendAppEmail",
        "summary": "Send transactional email",
        "description": "Use an account token with email:write (email:* includes it) and app, or the server-only app email token. Live sends need an active paid subscription and consume one of 100 monthly account units per recipient. Preview sends nothing. Reuse the same payload and idempotency key after a timeout; inspect unknown outcomes.",
        "tags": [
          "email"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "App-rendered message",
                "properties": {
                  "app": {
                    "type": "string",
                    "description": "App name or deployment ID; omit with an app email token"
                  },
                  "to": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "type": "string",
                      "format": "email"
                    }
                  },
                  "subject": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "html": {
                    "type": "string"
                  },
                  "from": {
                    "type": "string",
                    "description": "Defaults to configured sender; must use this app domain"
                  },
                  "reply_to": {
                    "type": "string"
                  },
                  "idempotency_key": {
                    "type": "string"
                  },
                  "test": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "to",
                  "subject",
                  "text",
                  "idempotency_key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Recorded email outcome or test capture",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Recorded outcome, not proof of inbox placement",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "description": "Inspect unknown even when HTTP is 202. Never retry unknown with a new key."
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "live",
                        "test"
                      ]
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "delivered": {
                      "type": "boolean",
                      "description": "false when a requested real send was captured as a test instead"
                    },
                    "captured_because": {
                      "type": "string",
                      "enum": [
                        "account_unclaimed"
                      ],
                      "description": "Why a requested real send was captured; do not report it as sent"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "Paid plan required (email_paid_plan_required: error.details has owner account, billing_url and suggested_fix) or monthly recipient allowance exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Account not claimed (account_unclaimed), sender not allowed, or email disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "Recipient suppressed (error object), or provider rejected the message (recorded failed outcome)",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "description": "Recorded outcome, not proof of inbox placement",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "description": "Inspect unknown even when HTTP is 202. Never retry unknown with a new key."
                        },
                        "mode": {
                          "type": "string",
                          "enum": [
                            "live",
                            "test"
                          ]
                        },
                        "replayed": {
                          "type": "boolean"
                        },
                        "delivered": {
                          "type": "boolean",
                          "description": "false when a requested real send was captured as a test instead"
                        },
                        "captured_because": {
                          "type": "string",
                          "enum": [
                            "account_unclaimed"
                          ],
                          "description": "Why a requested real send was captured; do not report it as sent"
                        }
                      },
                      "additionalProperties": true
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          },
          "423": {
            "description": "Sending paused"
          },
          "429": {
            "description": "Account request or test-capture rate limit"
          },
          "503": {
            "description": "Live delivery unavailable"
          }
        }
      }
    },
    "/v1/email/preview": {
      "post": {
        "operationId": "previewAppEmail",
        "summary": "Capture a private email preview",
        "description": "Use an account token with email:write (email:* includes it) and app, or the server-only app email token. Live sends need an active paid subscription and consume one of 100 monthly account units per recipient. Preview sends nothing. Reuse the same payload and idempotency key after a timeout; inspect unknown outcomes.",
        "tags": [
          "email"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "App-rendered message",
                "properties": {
                  "app": {
                    "type": "string",
                    "description": "App name or deployment ID; omit with an app email token"
                  },
                  "to": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "type": "string",
                      "format": "email"
                    }
                  },
                  "subject": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "html": {
                    "type": "string"
                  },
                  "from": {
                    "type": "string",
                    "description": "Defaults to configured sender; must use this app domain"
                  },
                  "reply_to": {
                    "type": "string"
                  },
                  "idempotency_key": {
                    "type": "string"
                  },
                  "test": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "to",
                  "subject",
                  "text",
                  "idempotency_key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Recorded email outcome or test capture",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Recorded outcome, not proof of inbox placement",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "description": "Inspect unknown even when HTTP is 202. Never retry unknown with a new key."
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "live",
                        "test"
                      ]
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "delivered": {
                      "type": "boolean",
                      "description": "false when a requested real send was captured as a test instead"
                    },
                    "captured_because": {
                      "type": "string",
                      "enum": [
                        "account_unclaimed"
                      ],
                      "description": "Why a requested real send was captured; do not report it as sent"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "Paid plan required (email_paid_plan_required: error.details has owner account, billing_url and suggested_fix) or monthly recipient allowance exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Account not claimed (account_unclaimed), sender not allowed, or email disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "Recipient suppressed (error object), or provider rejected the message (recorded failed outcome)",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "description": "Recorded outcome, not proof of inbox placement",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "description": "Inspect unknown even when HTTP is 202. Never retry unknown with a new key."
                        },
                        "mode": {
                          "type": "string",
                          "enum": [
                            "live",
                            "test"
                          ]
                        },
                        "replayed": {
                          "type": "boolean"
                        },
                        "delivered": {
                          "type": "boolean",
                          "description": "false when a requested real send was captured as a test instead"
                        },
                        "captured_because": {
                          "type": "string",
                          "enum": [
                            "account_unclaimed"
                          ],
                          "description": "Why a requested real send was captured; do not report it as sent"
                        }
                      },
                      "additionalProperties": true
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          },
          "423": {
            "description": "Sending paused"
          },
          "429": {
            "description": "Account request or test-capture rate limit"
          },
          "503": {
            "description": "Live delivery unavailable"
          }
        }
      }
    },
    "/v1/email/messages": {
      "get": {
        "operationId": "listAppEmails",
        "summary": "List app email outcomes",
        "description": "Recent captures and delivery records for an owned app.",
        "tags": [
          "email"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "email:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Email records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Recent messages",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/email/messages/{id}": {
      "get": {
        "operationId": "getAppEmailMessage",
        "summary": "Inspect an email outcome",
        "description": "Delivery events and test content. Live message bodies are not retained.",
        "tags": [
          "email"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "email:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Message ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Message and events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Email record",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "API health",
        "description": "Returns 200 when the API is serving requests. No authentication.",
        "security": [],
        "tags": [
          "meta"
        ],
        "responses": {
          "200": {
            "description": "Healthy"
          }
        }
      }
    },
    "/v1/auth/signup": {
      "post": {
        "operationId": "signup",
        "summary": "Create a self-serve account",
        "description": "Creates an account and returns an access token, OAuth client credentials and a claim URL. Reusing the same request_key within ten minutes returns the same receipt. No authentication, no browser, no payment.",
        "security": [],
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account created or receipt replayed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "operationId": "issueToken",
        "summary": "Exchange client credentials for an access token",
        "description": "OAuth 2.0 client_credentials grant. Send the issued client_id and client_secret as form fields or with HTTP Basic authentication. Access tokens last at most 15 minutes and are bound to the resource.",
        "security": [],
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/auth/whoami": {
      "get": {
        "operationId": "whoami",
        "summary": "Describe the current credential",
        "description": "Returns the account and scopes behind the bearer token.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "responses": {
          "200": {
            "description": "Identity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Account identity and scopes",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/auth/claim": {
      "post": {
        "operationId": "claimAccount",
        "summary": "Email the person a claim link",
        "description": "Emails a link that makes the given address the owner of this unclaimed account. Needs the tokens:write scope, which tokens:* includes. The person must open it within 30 minutes. Ample Computer never returns a link it emailed, so only the owner of the address can accept. At most five claim emails per account and three per address per hour.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "tokens:*"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Claim request",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "email"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Claim email sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Claim started",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "verification_sent",
                        "verification_created"
                      ]
                    },
                    "email": {
                      "type": "string"
                    },
                    "email_sent": {
                      "type": "boolean"
                    },
                    "verification_url": {
                      "type": "string",
                      "description": "Only from a server that sends no email (local development)"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "description": "Too many claim emails for this account or address; retry in an hour"
          },
          "503": {
            "description": "Claim email cannot be sent right now"
          }
        }
      }
    },
    "/v1/auth/tokens/{id}": {
      "delete": {
        "operationId": "revokeToken",
        "summary": "Revoke an API token",
        "description": "Revokes a token issued to this account.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "tokens:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token id"
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/auth/agents": {
      "get": {
        "operationId": "listAgentCredentials",
        "summary": "List agent credentials",
        "description": "Lists agent credentials without exposing secrets.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "tokens:*"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Agent credential",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createAgentCredential",
        "summary": "Provision an agent credential",
        "description": "Creates a scoped credential whose secret is shown once.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "tokens:*"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Credential request",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string",
                    "description": "Space-separated scopes"
                  }
                },
                "required": [
                  "name",
                  "scope"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credential with one-time secret",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Agent credential",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Credential with one-time secret",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Agent credential",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/auth/agents/{id}": {
      "delete": {
        "operationId": "revokeAgentCredential",
        "summary": "Revoke an agent credential",
        "description": "Revokes the credential and every access token and descendant credential derived from it.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "tokens:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Credential id"
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers": {
      "get": {
        "operationId": "listServers",
        "summary": "List servers",
        "description": "Lists the account's servers, optionally filtered by status.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Servers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Server"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createServer",
        "summary": "Create a server",
        "description": "Boots a microVM from a build template. Most agents should use ample deploy or ample up instead, which create servers as needed.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "201": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}": {
      "get": {
        "operationId": "getServer",
        "summary": "Get a server",
        "description": "Returns one server.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id (srv_...)"
          }
        ],
        "responses": {
          "200": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "destroyServer",
        "summary": "Destroy a server",
        "description": "Destroys the server and its root disk. Attached volumes and databases survive.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "responses": {
          "204": {
            "description": "Destroyed"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/pause": {
      "put": {
        "operationId": "pauseServer",
        "summary": "Pause a server",
        "description": "Snapshots and pauses the VM. It wakes on the next request.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "responses": {
          "200": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/resume": {
      "put": {
        "operationId": "resumeServer",
        "summary": "Resume a server",
        "description": "Wakes a paused or cold server.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "responses": {
          "200": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/exec": {
      "post": {
        "operationId": "execCommand",
        "summary": "Run a command on a server",
        "description": "Runs a shell command inside the VM and returns its output, optionally streamed.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:exec"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Command",
                "properties": {
                  "command": {
                    "type": "string"
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "command"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Command output",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Exit code and output",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/upload": {
      "post": {
        "operationId": "uploadFile",
        "summary": "Upload a file to a server",
        "description": "Copies a file into the VM.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:exec"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Upload",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Upload result",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/download": {
      "post": {
        "operationId": "downloadFile",
        "summary": "Download a file from a server",
        "description": "Reads a file from the VM.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:exec"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Download",
                "properties": {
                  "path": {
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File contents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "File contents",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/deployments": {
      "get": {
        "operationId": "listServerDeployments",
        "summary": "List deployments of a server",
        "description": "Lists deployments that target this server.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "responses": {
          "200": {
            "description": "Deployments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Deployment"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deploy": {
      "post": {
        "operationId": "deploy",
        "summary": "Deploy an app over HTTP",
        "description": "Deploys an app from its source as a tar.gz (multipart/form-data) with no CLI: Ample Computer detects the stack, builds it and starts it, as ample deploy does. Waits up to 50 s; a longer deploy answers 202 with a poll URL. Send Idempotency-Key to retry safely; the same name updates the same app.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read",
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "8 to 96 characters of A-Z, a-z, 0-9, -, _ and :. A retry of the same request with the same key reattaches to the deploy it started; the same key with a different request answers 409 idempotency_conflict.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "source",
                  "name"
                ],
                "properties": {
                  "source": {
                    "type": "string",
                    "format": "binary",
                    "description": "The app as a tar.gz, up to 32 MiB"
                  },
                  "name": {
                    "type": "string",
                    "description": "App name: letters, digits, -, _ and ., up to 63 characters"
                  },
                  "public": {
                    "type": "boolean",
                    "description": "Public URL (web apps are public by default)"
                  },
                  "env": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "KEY=value, repeatable; stored encrypted"
                  },
                  "start": {
                    "type": "string",
                    "description": "The command that starts the app, listening on $PORT. Only needed when Ample Computer cannot tell from the source (status needs_input)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The deploy finished: status live, failed (error.details holds the failure handoff: owner, diagnosis, evidence, suggested_fix {change, confidence}) or needs_input (error.resolution says what to send)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Deploy result",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "live",
                        "failed",
                        "needs_input"
                      ]
                    },
                    "url": {
                      "type": "string"
                    },
                    "deployment_id": {
                      "type": "string"
                    },
                    "unchanged": {
                      "type": "boolean"
                    },
                    "execution_id": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "description": "code, message and resolution; on a failure, details with owner (app, account, platform or unknown), diagnosis, evidence and suggested_fix {change, confidence}"
                    }
                  },
                  "required": [
                    "status",
                    "execution_id"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "202": {
            "description": "Still deploying; GET the poll URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Deploy running",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "running"
                      ]
                    },
                    "execution_id": {
                      "type": "string"
                    },
                    "poll": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "execution_id",
                    "poll"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deploy/{id}": {
      "get": {
        "operationId": "getDeploy",
        "summary": "Get an HTTP deploy",
        "description": "Returns the deploy started by POST /v1/deploy, waiting up to wait_secs (at most 50, the default) for it to finish: 200 with the result, or 202 while it runs.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "execution_id from POST /v1/deploy"
          },
          {
            "name": "wait_secs",
            "in": "query",
            "required": false,
            "description": "Seconds to wait for the result, 0 to 50",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deploy finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Deploy result",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "202": {
            "description": "Still deploying",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Deploy running",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments": {
      "get": {
        "operationId": "listDeployments",
        "summary": "List deployments",
        "description": "Lists the account's deployments (apps).",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Deployments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Deployment"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createDeployment",
        "summary": "Create a deployment",
        "description": "Starts a synchronous, content-addressed deployment. The Ample Computer CLI builds this request from the repository (packaged files, detected build and start commands, environment). To deploy without the CLI, use POST /v1/deploy, which takes the source as a tar.gz. An unchanged source produces a no-op with unchanged=true.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Deployment request built by the Ample Computer CLI",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "App name"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                }
              }
            }
          },
          "201": {
            "description": "Deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}": {
      "get": {
        "operationId": "getDeployment",
        "summary": "Get a deployment",
        "description": "Returns the deployment, its status and live URL.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id (dep_...)"
          }
        ],
        "responses": {
          "200": {
            "description": "Deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteDeployment",
        "summary": "Delete an app",
        "description": "Deletes the app and its releases; shared servers and declared resources are preserved.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}/logs": {
      "get": {
        "operationId": "getDeploymentLogs",
        "summary": "Read build or runtime logs",
        "description": "Returns stored build or runtime log entries. For a running app the runtime kind falls back to a live journal tail.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "build",
                "runtime",
                "job"
              ]
            }
          },
          {
            "name": "tail",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            },
            "description": "Live runtime lines to tail"
          }
        ],
        "responses": {
          "200": {
            "description": "Log entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Log entries",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}/finalize": {
      "post": {
        "operationId": "finalizeDeployment",
        "summary": "Finalize a deployment",
        "description": "Completes the upload phase and activates the release. Used by the CLI.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "responses": {
          "200": {
            "description": "Deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}/domains": {
      "get": {
        "operationId": "listDomains",
        "summary": "List custom domains",
        "description": "Lists custom domains attached to the app.",
        "tags": [
          "domains"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "responses": {
          "200": {
            "description": "Domains",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Domain",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "addDomain",
        "summary": "Attach a custom domain",
        "description": "Attaches a domain and returns the DNS record to create before verification.",
        "tags": [
          "domains"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Domain",
                "properties": {
                  "domain": {
                    "type": "string"
                  }
                },
                "required": [
                  "domain"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain with DNS instructions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Domain",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Domain with DNS instructions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Domain",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/domains/{domain}/verify": {
      "post": {
        "operationId": "verifyDomain",
        "summary": "Verify a custom domain",
        "description": "Checks the DNS record and activates TLS routing when it resolves.",
        "tags": [
          "domains"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Fully qualified domain name"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Domain",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}/secrets": {
      "get": {
        "operationId": "listSecrets",
        "summary": "List secret names",
        "description": "Lists environment variable names stored for the app. Values are never returned.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "responses": {
          "200": {
            "description": "Secret names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Secret names",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "setSecret",
        "summary": "Set a secret",
        "description": "Stores an encrypted environment variable for future releases.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Secret",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Secret names",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/operations/{id}": {
      "get": {
        "operationId": "getOperation",
        "summary": "Get an operation",
        "description": "Returns a long-running operation such as a deployment.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Operation id"
          }
        ],
        "responses": {
          "200": {
            "description": "Operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Operation",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/operations/{id}/events": {
      "get": {
        "operationId": "listOperationEvents",
        "summary": "List operation events",
        "description": "Returns the event log of an operation.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Operation id"
          }
        ],
        "responses": {
          "200": {
            "description": "Events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Event",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/operations/{id}/watch": {
      "get": {
        "operationId": "watchOperation",
        "summary": "Wait for an operation",
        "description": "Long-polls until the operation finishes or wait_secs elapses.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Operation id"
          },
          {
            "name": "wait_secs",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Operation",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/operations/{id}/cancel": {
      "post": {
        "operationId": "cancelOperation",
        "summary": "Cancel an operation",
        "description": "Cancels a running deployment operation.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Operation id"
          }
        ],
        "responses": {
          "200": {
            "description": "Operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Operation",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/executions/{id}": {
      "get": {
        "operationId": "getExecution",
        "summary": "Get an MCP execution",
        "description": "Returns the status of an execution started through the remote MCP server.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Execution id"
          }
        ],
        "responses": {
          "200": {
            "description": "Execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Execution",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/executions/{id}/cancel": {
      "post": {
        "operationId": "cancelExecution",
        "summary": "Cancel an MCP execution",
        "description": "Cancels a running execution.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Execution id"
          }
        ],
        "responses": {
          "200": {
            "description": "Execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Execution",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/databases": {
      "get": {
        "operationId": "listDatabases",
        "summary": "List managed databases",
        "description": "Lists Postgres, MySQL, Redis and MongoDB databases in the account.",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "databases:*"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Databases",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Database",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createDatabase",
        "summary": "Create a managed database",
        "description": "Provisions a database microVM (about 15 seconds) and returns its connection details.",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "databases:*"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDatabaseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Database",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Database",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Database",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Database",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/databases/{id}": {
      "get": {
        "operationId": "getDatabase",
        "summary": "Get a managed database",
        "description": "Returns one database.",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "databases:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Database id"
          }
        ],
        "responses": {
          "200": {
            "description": "Database",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Database",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteDatabase",
        "summary": "Delete a managed database",
        "description": "Destroys the database and its data.",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "databases:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Database id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets": {
      "get": {
        "operationId": "listBuckets",
        "summary": "List buckets",
        "description": "Lists S3-compatible object storage buckets.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Buckets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Bucket",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createBucket",
        "summary": "Create a bucket",
        "description": "Creates a bucket and issues S3 credentials.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBucketRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}": {
      "get": {
        "operationId": "getBucket",
        "summary": "Get a bucket",
        "description": "Returns one bucket.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteBucket",
        "summary": "Delete a bucket",
        "description": "Deletes the bucket and its objects.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}/credentials": {
      "get": {
        "operationId": "getBucketCredentials",
        "summary": "Get bucket credentials",
        "description": "Returns the S3 endpoint and access keys.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "S3 credentials",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}/publish": {
      "post": {
        "operationId": "publishBucket",
        "summary": "Publish a bucket",
        "description": "Serves objects publicly through the CDN.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}/unpublish": {
      "post": {
        "operationId": "unpublishBucket",
        "summary": "Unpublish a bucket",
        "description": "Stops public serving.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}/rotate-key": {
      "post": {
        "operationId": "rotateBucketKey",
        "summary": "Rotate bucket keys",
        "description": "Issues new S3 access keys and revokes the old ones.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "S3 credentials",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/jobs": {
      "get": {
        "operationId": "listJobs",
        "summary": "List scheduled jobs",
        "description": "Lists the account's scheduled jobs and when each runs next.",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only jobs on this service (deployment id or app name)"
          }
        ],
        "responses": {
          "200": {
            "description": "Jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Job",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createJob",
        "summary": "Create or update a scheduled job",
        "description": "Runs a command (in the service's environment) or an HTTP request (to the service, with an Ample-Job-Token header) on a cron schedule in an IANA time zone or at a fixed interval. Creating a job that exists with the same settings changes nothing; different settings update it. Command jobs need servers:exec.",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Job request",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "service": {
                    "type": "string",
                    "description": "Deployment id or app name"
                  },
                  "schedule": {
                    "type": "string",
                    "description": "Five-field cron, e.g. 0 8 * * *"
                  },
                  "every_secs": {
                    "type": "integer",
                    "description": "Fixed interval instead of schedule"
                  },
                  "timezone": {
                    "type": "string",
                    "default": "UTC"
                  },
                  "command": {
                    "type": "string"
                  },
                  "request": {
                    "type": "string",
                    "description": "e.g. POST /tasks/report"
                  },
                  "timeout_secs": {
                    "type": "integer"
                  },
                  "retries": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5
                  }
                },
                "required": [
                  "name",
                  "service"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/jobs/{id}": {
      "get": {
        "operationId": "getJob",
        "summary": "Get a scheduled job",
        "description": "Returns the job, its plan limits and its last few runs.",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job id or name"
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteJob",
        "summary": "Delete a scheduled job",
        "description": "Deletes the job and its run history.",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job id or name"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Deleted job",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/jobs/{id}/pause": {
      "post": {
        "operationId": "pauseJob",
        "summary": "Pause a scheduled job",
        "description": "Stops scheduled runs; manual runs still work.",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job id or name"
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/jobs/{id}/resume": {
      "post": {
        "operationId": "resumeJob",
        "summary": "Resume a scheduled job",
        "description": "Resumes scheduled runs from now.",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job id or name"
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/jobs/{id}/runs": {
      "get": {
        "operationId": "listJobRuns",
        "summary": "List job runs",
        "description": "Recent runs, newest first, with status, exit code or HTTP status, output and, on failure, who should act and how.",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job id or name"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Runs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Job run",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "runJob",
        "summary": "Run a job now",
        "description": "Starts a run. With wait_secs (at most 50) the response waits for it to finish; 202 with a poll URL while it is still running.",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job id or name"
          },
          {
            "name": "wait_secs",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Run",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job run",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/jobs/{id}/runs/{run_id}": {
      "get": {
        "operationId": "getJobRun",
        "summary": "Get a job run",
        "description": "Returns one run; wait_secs (at most 50) waits for it to finish.",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job id or name"
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Run id"
          },
          {
            "name": "wait_secs",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Run",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job run",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/keep-awake": {
      "get": {
        "operationId": "getKeepAwake",
        "summary": "Show what keeps a server running",
        "description": "The manual hold, if any, and what last held the server from inside (ample-awake, running jobs or commands).",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id or name"
          }
        ],
        "responses": {
          "200": {
            "description": "Hold status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Hold status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "keepAwake",
        "summary": "Keep a server running",
        "description": "Keeps the server from being treated as idle for for_secs (at most the plan's hold limit), e.g. during a series of commands.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id or name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Hold",
                "properties": {
                  "for_secs": {
                    "type": "integer"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "for_secs"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Hold status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Hold status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "releaseKeepAwake",
        "summary": "Release a server hold",
        "description": "Drops the manual hold.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id or name"
          }
        ],
        "responses": {
          "200": {
            "description": "Hold status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Hold status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/volumes": {
      "get": {
        "operationId": "listVolumes",
        "summary": "List volumes",
        "description": "Lists persistent volumes.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Volumes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Volume",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createVolume",
        "summary": "Create a volume",
        "description": "Creates a persistent volume.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVolumeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/volumes/{id}": {
      "get": {
        "operationId": "getVolume",
        "summary": "Get a volume",
        "description": "Returns one volume.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Volume id"
          }
        ],
        "responses": {
          "200": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteVolume",
        "summary": "Delete a volume",
        "description": "Deletes a detached volume and its data.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Volume id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/volumes/{id}/attach/{server_id}": {
      "post": {
        "operationId": "attachVolume",
        "summary": "Attach a volume",
        "description": "Mounts the volume in a server at mount_path.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Volume id"
          },
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Mount",
                "properties": {
                  "mount_path": {
                    "type": "string"
                  }
                },
                "required": [
                  "mount_path"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/volumes/{id}/detach": {
      "post": {
        "operationId": "detachVolume",
        "summary": "Detach a volume",
        "description": "Unmounts the volume from its server.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Volume id"
          }
        ],
        "responses": {
          "200": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces": {
      "get": {
        "operationId": "listWorkspaces",
        "summary": "List workspaces",
        "description": "Lists account-owned workspaces used as the working directory for remote MCP and CLI-in-the-cloud runs.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "responses": {
          "200": {
            "description": "Workspaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Workspace",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createWorkspace",
        "summary": "Create a workspace",
        "description": "Creates an empty workspace.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Workspace",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}": {
      "get": {
        "operationId": "getWorkspace",
        "summary": "Get a workspace",
        "description": "Returns one workspace.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteWorkspace",
        "summary": "Delete a workspace",
        "description": "Deletes the workspace and its files.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/archive": {
      "get": {
        "operationId": "downloadWorkspaceArchive",
        "summary": "Download a workspace as tar.gz",
        "description": "Streams the workspace contents.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "responses": {
          "200": {
            "description": "tar.gz archive",
            "content": {
              "application/gzip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "put": {
        "operationId": "uploadWorkspaceArchive",
        "summary": "Upload a tar.gz into a workspace",
        "description": "Replaces the workspace contents.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/gzip": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/archive/base64": {
      "post": {
        "operationId": "uploadWorkspaceArchiveBase64",
        "summary": "Upload a base64 tar.gz into a workspace",
        "description": "JSON variant of the archive upload.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Archive",
                "properties": {
                  "data_base64": {
                    "type": "string"
                  }
                },
                "required": [
                  "data_base64"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/files/read": {
      "post": {
        "operationId": "readWorkspaceFile",
        "summary": "Read a workspace file",
        "description": "Returns one file.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Path",
                "properties": {
                  "path": {
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "File contents",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/files/write": {
      "post": {
        "operationId": "writeWorkspaceFile",
        "summary": "Write a workspace file",
        "description": "Writes text or base64 data to a path.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "File",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "data_base64": {
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Written",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Write result",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/import": {
      "post": {
        "operationId": "importWorkspace",
        "summary": "Import a repository into a workspace",
        "description": "Imports source from a public repository URL.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Import source",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Current usage",
        "description": "Returns compute, storage and egress usage for the account.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "responses": {
          "200": {
            "description": "Usage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Usage",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/quota": {
      "get": {
        "operationId": "getQuota",
        "summary": "Plan quotas",
        "description": "Returns the plan limits and how much of each is used. A null limit means unlimited.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "responses": {
          "200": {
            "description": "Quota",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Quota",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/budget": {
      "get": {
        "operationId": "getBudget",
        "summary": "Budget status",
        "description": "Returns the monthly and daily spend caps and current spend.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "budgets:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Budget",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Budget",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "setBudget",
        "summary": "Set a budget",
        "description": "Sets monthly and daily caps and whether to hard-stop at the cap.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetBudgetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Budget",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Budget",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog": {
      "get": {
        "operationId": "getCatalogIndex",
        "summary": "Recipe catalog index",
        "description": "Facets, counts and typed next actions for the deployment recipe catalog. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Catalog index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Catalog index",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/status": {
      "get": {
        "operationId": "getCatalogStatus",
        "summary": "Catalog publication status",
        "description": "Catalog revision and publication counts. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Catalog status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/nodes/{node_id}": {
      "get": {
        "operationId": "browseCatalogNode",
        "summary": "Browse a catalog facet node",
        "description": "Children, published recipes and dependents of one facet node. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "parameters": [
          {
            "name": "node_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Node id"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Node",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Catalog node",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/recipes/{recipe_id}": {
      "get": {
        "operationId": "inspectRecipe",
        "summary": "Inspect a recipe",
        "description": "Full recipe contract: framework, template, resources, constraints, evidence. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "parameters": [
          {
            "name": "recipe_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Recipe id"
          }
        ],
        "responses": {
          "200": {
            "description": "Recipe",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Recipe contract",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/search": {
      "post": {
        "operationId": "searchRecipes",
        "summary": "Search recipes",
        "description": "Ranked recipe search with filters, hard constraints and preferences. Recipes are worked examples; any app deploys with ample plan and ample deploy whether or not one matches. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogSearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Search results",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/plan": {
      "post": {
        "operationId": "planFromRecipe",
        "summary": "Plan a deployment from a recipe",
        "description": "Produces a side-effect-free deployment plan for a project from a recipe; deploying still goes through the authenticated deploy flow.",
        "tags": [
          "catalog"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Plan request",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Deployment plan",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Remote MCP endpoint",
        "description": "Model Context Protocol over Streamable HTTP. Tools mirror the CLI (ample_plan, ample_up, ample_deploy, ample_logs, ...). Authenticate with a bearer token from /v1/auth/signup or /oauth/token.",
        "tags": [
          "mcp"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "JSON-RPC 2.0 request",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON-RPC 2.0 response",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/mcp/catalog": {
      "get": {
        "operationId": "getMcpCatalog",
        "summary": "MCP tool catalog",
        "description": "Every MCP tool with its JSON schema. Public.",
        "tags": [
          "mcp"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Tool catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Tools",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/mcp/server.json": {
      "get": {
        "operationId": "getMcpServerJson",
        "summary": "MCP registry record",
        "description": "server.json for the MCP Registry. Public.",
        "tags": [
          "mcp"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "server.json",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "MCP server record",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/a2a": {
      "post": {
        "operationId": "a2a",
        "summary": "A2A endpoint",
        "description": "A2A 1.0 JSON-RPC binding (SendMessage, GetTask, CancelTask). Skills are the remote MCP tools; send a data part {\"skill\":\"<tool>\",\"arguments\":{...}} and the messageId is the execution key. The ample_auth_signup skill needs no credentials.",
        "tags": [
          "a2a"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "JSON-RPC 2.0 request",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON-RPC 2.0 response",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/.well-known/agent-card.json": {
      "get": {
        "operationId": "getAgentCard",
        "summary": "A2A agent card",
        "description": "A2A 1.0 agent card listing every skill. Public.",
        "tags": [
          "a2a"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Agent card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A2A agent card",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/mcp/setup": {
      "get": {
        "operationId": "getMcpSetup",
        "summary": "MCP setup guide",
        "description": "Markdown instructions for registering, authenticating and deploying through remote MCP. Public.",
        "tags": [
          "mcp"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Markdown",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "getOAuthMetadata",
        "summary": "OAuth authorization server metadata",
        "description": "RFC 8414 metadata: token endpoint, grant types and supported scopes. Public.",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "OAuth metadata",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "operationId": "getProtectedResourceMetadata",
        "summary": "OAuth protected resource metadata",
        "description": "RFC 9728 metadata for the MCP resource. Public.",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Protected resource metadata",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "BadRequest": {
        "description": "Malformed request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid credentials",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Credential lacks the required scope",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "No such resource in this account",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict with the current state (for example a quota, budget or busy resource)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Access token from POST /v1/auth/signup or POST /oauth/token, or a scoped API token issued by the CLI."
      },
      "oauthClientCredentials": {
        "type": "oauth2",
        "description": "Client credentials issued by POST /v1/auth/signup. Include resource=https://api.ample.computer/mcp when the token is for MCP.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://api.ample.computer/oauth/token",
            "scopes": {
              "servers:read": "Read servers, apps, deployments, logs and operations",
              "servers:write": "Create, deploy, pause, resume and destroy servers and apps",
              "servers:exec": "Run commands and transfer files on a server",
              "volumes:*": "Manage persistent volumes",
              "databases:*": "Manage managed databases",
              "buckets:*": "Manage object storage buckets and credentials",
              "email:*": "Manage app email, send messages and read delivery records",
              "tokens:*": "Manage API tokens and agent credentials",
              "budgets:read": "Read budget status"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "example": "authentication_required"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "SignupRequest": {
        "type": "object",
        "required": [
          "name",
          "request_key"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the agent or person creating the account"
          },
          "request_key": {
            "type": "string",
            "format": "uuid",
            "description": "Fresh UUID v4. Reuse it after a disconnect to fetch the same receipt for ten minutes."
          },
          "connect_code": {
            "type": "string",
            "description": "Connect code from the person's prompt (ample_connect_...). Gives credentials on their own account instead of a new one: no claim URL, no expiry. Works once, for an hour."
          }
        }
      },
      "SignupResponse": {
        "type": "object",
        "description": "Registration receipt: account identity, the claim URL to hand to the person, the fixed account expiry, an access token and reusable client credentials.",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "credentials": {
            "type": "object",
            "properties": {
              "client_id": {
                "type": "string"
              },
              "client_secret": {
                "type": "string"
              }
            }
          }
        },
        "additionalProperties": true
      },
      "TokenRequest": {
        "type": "object",
        "required": [
          "grant_type"
        ],
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "client_credentials"
            ]
          },
          "client_id": {
            "type": "string"
          },
          "client_secret": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "description": "Space-separated scopes; defaults to the credential's scopes"
          },
          "resource": {
            "type": "string",
            "format": "uri",
            "example": "https://api.ample.computer/mcp"
          }
        }
      },
      "TokenResponse": {
        "type": "object",
        "description": "OAuth 2.0 token response. Access tokens last at most 15 minutes.",
        "properties": {
          "access_token": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "Server": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "srv_8b9d0771"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Lifecycle state such as running, standby, paused, cold or stopped"
          },
          "region": {
            "type": "string"
          },
          "size": {
            "type": "string",
            "example": "s-1vcpu-1gb"
          },
          "template": {
            "type": "string",
            "description": "Build template (node, python, go, ...)"
          },
          "ipv4": {
            "type": [
              "string",
              "null"
            ]
          },
          "always_on": {
            "type": "boolean"
          },
          "auto_pause_secs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "wake_strategy": {
            "type": "string"
          },
          "root_disk_limit_mb": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "ready_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "additionalProperties": true
      },
      "CreateServerRequest": {
        "type": "object",
        "required": [
          "name",
          "size"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "size": {
            "type": "string",
            "example": "s-1vcpu-1gb"
          },
          "region": {
            "type": "string"
          },
          "template": {
            "type": "string"
          },
          "always_on": {
            "type": "boolean",
            "default": false,
            "description": "Operator privilege; non-admin requests receive always_on_unavailable"
          },
          "auto_pause_secs": {
            "type": "integer"
          },
          "wake_strategy": {
            "type": "string"
          },
          "root_disk_limit_mb": {
            "type": "integer"
          },
          "volume": {
            "type": "string",
            "description": "Volume id to attach"
          },
          "placement_node_id": {
            "type": "string"
          }
        }
      },
      "Deployment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "dep_48ed136b"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "live, failed, or an in-progress state"
          },
          "unchanged": {
            "type": "boolean",
            "description": "True when the source, config and env matched the live release and nothing was rebuilt"
          },
          "server_id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": true
      },
      "CreateDatabaseRequest": {
        "type": "object",
        "required": [
          "name",
          "engine"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "engine": {
            "type": "string",
            "enum": [
              "postgres",
              "mysql",
              "redis",
              "mongodb"
            ]
          },
          "version": {
            "type": "string"
          },
          "size": {
            "type": "string",
            "example": "s-1vcpu-1gb"
          },
          "region": {
            "type": "string"
          }
        }
      },
      "CreateBucketRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "size_quota_mb": {
            "type": "integer"
          },
          "region": {
            "type": "string"
          }
        }
      },
      "CreateVolumeRequest": {
        "type": "object",
        "required": [
          "name",
          "size_mb"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "size_mb": {
            "type": "integer"
          },
          "database_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SetBudgetRequest": {
        "type": "object",
        "properties": {
          "monthly_max": {
            "type": [
              "number",
              "null"
            ]
          },
          "daily_max": {
            "type": [
              "number",
              "null"
            ]
          },
          "hard_stop": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CatalogSearchRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          },
          "hard_constraints": {
            "type": "object",
            "additionalProperties": true,
            "description": "Region, runtime, capabilities and budget; a recipe they rule out is set aside"
          },
          "preferences": {
            "type": "object",
            "additionalProperties": true
          },
          "limit": {
            "type": "integer"
          },
          "cursor": {
            "type": "string"
          }
        }
      }
    }
  }
}
