{
  "openapi": "3.1.0",
  "info": {
    "title": "Pyo API",
    "description": "Everything the dashboard does, for scripts. Read with GET, and change things with one operation per POST to `/ops`.\n\nAuthenticate with an API key from the dashboard's API keys page: `Authorization: Bearer pyo_…`. A key acts as you, with your role in each team, and is limited further by its access: **read** (look, never change), **deploy** (also deploy, roll back, restart, stop and scale services), **sandboxes** (also create and use sandboxes) or **full** (everything you can do in its teams). Each endpoint and operation says the access it needs in `x-pyo-access`.\n\nErrors come back as `{\"error\": \"…\"}` with a status code. Times are milliseconds since 1970 unless they say otherwise.",
    "license": {
      "name": "Apache-2.0",
      "identifier": "Apache-2.0"
    },
    "version": "0.53.0"
  },
  "servers": [
    {
      "url": "https://{host}/api/v1",
      "description": "Your Pyo",
      "variables": {
        "host": {
          "default": "your-pyo.example.com",
          "description": "Where your Pyo runs."
        }
      }
    }
  ],
  "paths": {
    "/state": {
      "get": {
        "tags": [
          "State"
        ],
        "summary": "Everything you can see",
        "description": "One snapshot of every team you're in (or the API key's teams): their\nprojects, services and deployments, clusters and servers, domains,\ncertificates, volumes, backups, registry logins, builders and recent\nactivity. The dashboard renders from this, and scripts can read it too.\n\nAPI key access: **read**.",
        "operationId": "getState",
        "responses": {
          "200": {
            "description": "The snapshot: `user`, `teams`, `projects`, `services`, `deployments`, `clusters`, `servers` and the rest, each a list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "You",
        "description": "The account these credentials act as: an API key's owner, or the person\nwho connected an assistant.\n\nAPI key access: **read**.",
        "operationId": "getMe",
        "responses": {
          "200": {
            "description": "Your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/meta": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "What this Pyo is",
        "description": "Its version, and the features a hosted Pyo turned on (none when\nself-hosted). No API key needed.\n\nNo API key needed.",
        "operationId": "getMeta",
        "responses": {
          "200": {
            "description": "The version and features.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Meta"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-pyo-access": "none"
      }
    },
    "/can-add-server": {
      "get": {
        "tags": [
          "Servers"
        ],
        "summary": "Whether the team may add a server",
        "description": "The same check Pyo makes as a new server, cluster or builder server is\nadded. Always yes when self-hosted. On Pyo Cloud, no without a\nsubscription that covers one more server, with the reason.\n\nAPI key access: **read**.",
        "operationId": "getCanAddServer",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Whether it may, and why not.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanAddServer"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/ops": {
      "post": {
        "tags": [
          "Operations"
        ],
        "summary": "Make a change",
        "description": "Every change goes through here: one operation per request, named by\n`op`, with its fields. Ids of new things are chosen by you (the kind's\nprefix and `_`, then 4 to 40 lowercase letters, digits, dashes or\nunderscores), so a retried request can't create something twice. Each\noperation says which API key access it needs. Operations on your account\nand on this installation aren't open to API keys and aren't listed.\n\nAPI key access: each operation says what it needs (**deploy** or **full**).",
        "operationId": "runOp",
        "requestBody": {
          "description": "The operation: `op` and its fields.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Op"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Done. Always `ok: true`, and some operations add more, such as a new API key or a join command. A `warning` comes with a change that went through but won't fully take effect yet, such as more replicas than the servers have room for.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Not a known operation, a missing field, or a value Pyo can't accept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Your role in the team, or the API key's access, doesn't allow it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "The team or the thing it names doesn't exist, or isn't yours to see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "It conflicts with what's there, such as a name already taken.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "An outside service it needed (a secret store, a registry) refused or failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "This installation isn't set up to store the secret it would save.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "varies"
      }
    },
    "/services/{id}/logs": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "Recent logs",
        "description": "The last lines each of a service's replicas printed, read from its\ncluster on request. Takes up to 15 seconds. To follow them, open the\nWebSocket at `/services/{id}/logs/follow` with the same query: it sends\nthese lines, then new ones as they're printed, each text frame\n`{\"type\":\"lines\",\"lines\":[…]}` (or `{\"type\":\"error\",\"message\":…}`). It\ncloses after an hour, so open it again with `since` set to the newest\nline's time.\n\nAPI key access: **read**.",
        "operationId": "getServiceLogs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The service's id (`svc_…`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "Only lines since this time, in milliseconds since 1970 (at most a week back).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "replica",
            "in": "query",
            "description": "Only this replica, by name (a log line's `source`).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tail",
            "in": "query",
            "description": "How many lines of each replica, 1 to 2000. 300 by default.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The lines.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceLogs"
                }
              }
            }
          },
          "400": {
            "description": "Not a replica name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such service, or it isn't yours to see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "The cluster couldn't read them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "504": {
            "description": "The cluster didn't answer within 15 seconds (is it connected?).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/volumes/{id}/snapshots": {
      "get": {
        "tags": [
          "Volumes"
        ],
        "summary": "A volume's snapshots",
        "description": "Its backups in the team's restic repository, newest first, read from\nits cluster on request (a short job there). Takes up to two minutes.\n\nAPI key access: **read**.",
        "operationId": "listVolumeSnapshots",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The volume's id (`vol_…`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`snapshots`: each one's `id`, `shortId`, `time` and `sizeBytes`, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such volume, or it isn't yours to see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The team has no backups, or its backup store can't be reached from the volume's cluster.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "The cluster couldn't list them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "504": {
            "description": "The cluster didn't answer in time (is it connected?).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/volumes/{id}/snapshots/{snapshotId}": {
      "delete": {
        "tags": [
          "Volumes"
        ],
        "summary": "Delete a volume snapshot",
        "description": "Deletes one of a volume's backups from the team's restic repository,\nwith a short job on its cluster that waits for the volume's other\nbackups and restores. The space it held is freed shortly after. Deleting\none that's already gone succeeds. Owners and admins.\n\nAPI key access: **full**.",
        "operationId": "deleteVolumeSnapshot",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The volume's id (`vol_…`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "snapshotId",
            "in": "path",
            "description": "The snapshot's id, or its short id (see listVolumeSnapshots).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`ok`: deleted (or already gone).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Not a snapshot id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Only owners and admins, with an API key that has full access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such volume, or it isn't yours to see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The team has no backups, or its backup store can't be reached from the volume's cluster.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "The cluster couldn't delete it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "504": {
            "description": "The cluster didn't answer in time (is it connected?).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/services/{id}/preview": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "Can the site be previewed",
        "description": "Whether a service's site can be shown in the dashboard's preview frame:\nit answers, and doesn't forbid framing (X-Frame-Options, CSP\nframe-ancestors). Only the service's own first domain is asked, and never\na private address.\n\nAPI key access: **read**.",
        "operationId": "getServicePreview",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The service's id (`svc_…`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Whether it can be framed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preview"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such service, or it isn't yours to see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/services/{id}/traffic": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "How traffic reaches a service",
        "description": "Its domains and the addresses they point at, the servers that take\npublic traffic and their regions, where its replicas run, and anything\nthat keeps visitors from reaching it.\n\nAPI key access: **read**.",
        "operationId": "getServiceTraffic",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The service's id (`svc_…`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domains, entry servers, replicas and warnings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such service, or it isn't yours to see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/cron-runs": {
      "get": {
        "tags": [
          "Cron jobs"
        ],
        "summary": "Cron job runs",
        "description": "A cron job's recent runs, newest first: when each started and finished,\nhow it ended, and the end of what it printed.\n\nAPI key access: **read**.",
        "operationId": "listCronRuns",
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "description": "The service's id (`svc_…`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cron",
            "in": "query",
            "description": "The cron job's id. Empty for a service that is itself a cron job.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`runs`: each with `job`, `startedAt`, `finishedAt`, `status` (running, succeeded or failed), `exitCode`, `reason` and `output`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No `service`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such service, or it isn't yours to see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/metrics": {
      "get": {
        "tags": [
          "Observability"
        ],
        "summary": "Server and service usage",
        "description": "CPU, memory, disk and network over time for a team's servers and\nservices, sampled once a minute. Servers also get load and disk reads\nand writes. Each series lines up with `times`, with `null` where nothing\nwas measured.\n\nAPI key access: **read**.",
        "operationId": "getMetrics",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cluster",
            "in": "query",
            "description": "A cluster's id, or \"all\" (the default).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "\"1h\", \"24h\" (the default), \"7d\" or \"30d\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`times` (milliseconds) and `servers`, `services` and `ingress`, each with its series.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No `team`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "This installation doesn't store metrics.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/observability/settings": {
      "get": {
        "tags": [
          "Observability"
        ],
        "summary": "Observability settings",
        "description": "Whether observability is on for this installation (it's off on a new\ninstall on a server with under 3.5 GB of memory). For the installation's\nadmin also what it keeps of visitors' IP addresses, how long it keeps\ndata (`retention`: `analyticsMonths`, `metricsDays`, `buildLogDays`) and\n`small`: the server Pyo runs on has under 3.5 GB of memory now. The\ninstallation's admin turns it on or off with `setObservability`.\n\nAPI key access: **read**.",
        "operationId": "getObservabilitySettings",
        "responses": {
          "200": {
            "description": "`enabled`. For the installation's admin also `ipMode`, `retention` and `small`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/observability": {
      "get": {
        "tags": [
          "Observability"
        ],
        "summary": "Website traffic",
        "description": "Visitors, requests, errors, response times, countries, pages and\nreferrers for a team's websites: all of them, one project's, one\nservice's, or one domain. Read from per-minute totals each cluster\nsends (kept 12 months by default), so it works with a cluster offline.\nTop lists count page views (referrers, pages, devices, browsers) or\nrequests (paths, countries, query parameters).\n\nAPI key access: **read**.",
        "operationId": "getObservability",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "query",
            "description": "Only this project's sites: its id, or \"all\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "site",
            "in": "query",
            "description": "Only this domain: its id or hostname, or \"all\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "description": "Only this service's domains: its id or name.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "\"1h\", \"24h\", \"7d\" (the default) or \"30d\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`summary` (totals and top lists for the range), `series` (over time) and `previous` (the period before).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No `team`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "This installation doesn't store traffic.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/observability/domains": {
      "get": {
        "tags": [
          "Observability"
        ],
        "summary": "Domain traffic",
        "description": "Requests per domain of a team over a range, each with its series: a\npoint per minute for an hour, per half hour for a day, per four hours\nfor a week, per day for 30 days. Only domains that had requests are\nlisted, busiest first. No domains while observability is off.\n\nAPI key access: **read**.",
        "operationId": "getDomainTraffic",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "\"1h\", \"24h\" (the default), \"7d\" or \"30d\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`range`, `step` (seconds per point), `start` (ms, the first point) and `domains`: `host`, `requests` and `series` for each.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/access-logs": {
      "get": {
        "tags": [
          "Observability"
        ],
        "summary": "Request log",
        "description": "The web server's log of requests to a team's websites, newest first,\nfiltered like the traffic figures. Requests stay in each website's\ncluster (1 GB or 7 days by default, the team's `requestLogs`\npreference), which answers within seconds, up to 500 at a time.\n\nAPI key access: **read**.",
        "operationId": "getAccessLogs",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "query",
            "description": "Only this project's sites: its id, or \"all\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "site",
            "in": "query",
            "description": "Only this domain: its id or hostname, or \"all\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "description": "Only this service's domains: its id or name.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "\"1h\", \"24h\" (the default), \"7d\" or \"30d\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Only requests before this time, in milliseconds: for the next page.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "At most this many, 1 to 500 (100 by default).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Only one class of status: \"1xx\" to \"5xx\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "method",
            "in": "query",
            "description": "Only this method, such as \"POST\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Only requests whose URL or host contains this (any case).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "description": "Only requests whose path starts with this, such as \"/api\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`logs` (newest first: time, method, host, path, status, duration, size, country, device and address as the IP setting allows), `next` (the `before` for the next page, or null), `ipMode`, `unavailable` (clusters that didn't answer, with why), and on the first page without filters a `summary` of the range: requests, bytes, errors and response times, counted per minute from `summary.from` to `summary.to` (ms). A minute is counted once it's over and its cluster has sent it, so the newest requests in `logs` come after `summary.to`, which is null until a minute is counted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No `team`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Observability is off on this installation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "504": {
            "description": "No cluster answered in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/services/{id}/connections": {
      "get": {
        "tags": [
          "Observability"
        ],
        "summary": "Service connections",
        "description": "Connections to a service's public TCP and UDP ports through the\ngateway: per port, over time, by country and outcome (\"ok\", \"blocked\" by an\nIP rule, \"limited\" by the connection limit, \"unreachable\" when the service\ndidn't answer), and the latest 50. A connection is counted when it\ncloses (a UDP exchange after a minute without packets). Ports that bypass\nthe gateway aren't counted.\n\nAPI key access: **read**.",
        "operationId": "getServiceConnections",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The service's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "\"1h\", \"24h\", \"7d\" (the default) or \"30d\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`ports`, `series`, `countries`, `outcomes`, and from the cluster `recent` (address as the IP setting allows), `ipMode` and `recentError` when it couldn't answer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such service, or you can't see it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "This installation doesn't store traffic.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/firewall/blocked": {
      "get": {
        "tags": [
          "Firewall"
        ],
        "summary": "Firewall refusals",
        "description": "What a service's firewall turned away: website requests (a 403, or a\n429 over a rate limit) and connections to TCP ports through the gateway.\nIt shows them over time (`series`), per rule, per source, country and\nwebsite path, and the latest 50. A rule is its id, or \"blocked\" or\n\"rate-limit\" when no rule matches the source now. UDP ports and ports\nthat bypass the gateway aren't counted.\n\nAPI key access: **read**.",
        "operationId": "getFirewallBlocked",
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "description": "The service's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "\"1h\", \"24h\" (the default), \"7d\" or \"30d\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`total`, `series`, `rules`, `countries`, `paths`, and from the cluster `sources` (among the latest 500, address as the IP setting allows), `recent`, `ipMode` and `recentError` when it couldn't answer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such service, or you can't see it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "This installation doesn't store traffic.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/firewall/me": {
      "get": {
        "tags": [
          "Firewall"
        ],
        "summary": "Your address",
        "description": "The address (and its country) Pyo sees your requests come from, so the\ndashboard can warn before a firewall rule would shut you out.\n\nAPI key access: **read**.",
        "operationId": "getMyAddress",
        "responses": {
          "200": {
            "description": "`ip` and `country` (a two-letter code, or empty when unknown).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/waf/hits": {
      "get": {
        "tags": [
          "Firewall"
        ],
        "summary": "WAF findings",
        "description": "What a service's web application firewall found: requests it blocked,\nand ones it only logged in log-only mode. It shows them over time\n(`series`), per rule, domain, source, country and path, and the latest\n50 with the rules that matched. `custom` shows how often each custom\nrule matched, by its number. Query strings are kept with sensitive\nvalues redacted.\n\nAPI key access: **read**.",
        "operationId": "getWafHits",
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "description": "The service's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "\"1h\", \"24h\" (the default), \"7d\" or \"30d\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`blocked`, `logged`, `clients`, `series`, `rules`, `hosts`, `countries`, `paths`, `custom`, and from the cluster `sources` (among the latest 500), `recent`, `ipMode` and `recentError` when it couldn't answer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such service, or you can't see it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "This installation doesn't store traffic.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/images": {
      "get": {
        "tags": [
          "Images"
        ],
        "summary": "Images",
        "description": "Every image a team's services deployed, by repository, with each\nversion's deployments, the services that used it and whether one runs it\nnow.\n\nAPI key access: **read**.",
        "operationId": "listImages",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The images.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Images"
                }
              }
            }
          },
          "400": {
            "description": "No `team`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/registry": {
      "get": {
        "tags": [
          "Images"
        ],
        "summary": "Pyo registry",
        "description": "Pyo's registry, where the images it builds from Git and the team's own\npushes are kept, as one team sees it: its address, where it runs (when the team has that\ncluster), whether Pyo reaches it, the space the team's images take, the\nteam's repositories (tags, size, last build) and its cleanup: how many\ndeployments' images are kept per service, and when images were last\nremoved (within the last week). Read only.\n\nAPI key access: **read**.",
        "operationId": "getRegistry",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`address` (in the cluster only, where servers pull from), `location` (`clusterId` and `server`, or null), `reachable`, `usedBytes`, `repositories`, `retainDeployments`, `lastCleanupAt`, `pushAddress`, `teamPath` and `tokens`. Each of `repositories` has `repository` (as servers pull it), `tailnetRepository`, `kind` (\"built\" or \"pushed\"), `serviceId`, `tags`, `bytes` and `lastPushAt`. `tailnetRepository` is a pushed repository's name on the team's tailnet, `<pushAddress>/<team>/<project>/<service>`. It's null for one Pyo built, or without a tailnet. `pushAddress` is the registry's address on the team's tailnet, where the team pushes and pulls its own images, or null without a tailnet. On Pyo Cloud each cluster keeps its own registry: `clusterRegistries` lists the team's clusters, each with `clusterId`, `name` and its registry's `pushAddress` on the cluster's tailnet (null until the cluster has Tailscale), and `pushAddress` is the first of them. Each of `tokens` has `id`, `name`, `scope`, `createdBy`, `createdAt`, `expiresAt` and `lastUsedAt`, but never the token itself.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No `team`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/cloudflare": {
      "get": {
        "tags": [
          "Integrations"
        ],
        "summary": "Cloudflare zones",
        "description": "The team's Cloudflare connection: the zones its token covers as of the\nlast test, and whether Pyo can edit DNS in each. Pyo creates a domain's\nDNS record when one of these zones covers it. Never the token: owners\nand admins also see its last four characters (`hint`).\n\nAPI key access: **read**.",
        "operationId": "getCloudflare",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`connected`, and when connected `zones` (each with `id`, `name`, `canEdit` and, when it can't, `missing`: the permission the token lacks, `accountId`, `accountName`, and `tunnel`: `ready` and the tunnel permissions it lacks as `missing`), `createdAt`, `testedAt`, and for owners and admins `hint` and `createdBy`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/clusters/{id}/tunnel": {
      "get": {
        "tags": [
          "Clusters"
        ],
        "summary": "A cluster's Cloudflare Tunnel",
        "description": "The cluster's tunnel as Pyo last saw it: its state, Cloudflare's view\n(`health`, `connections`, `colos`), the connectors in the cluster\n(`connectors`: each one's server, whether it's ready, and why not), its\ndefault domain, its certificate, and `refused` when the cluster's install\nis older than Pyo's. Never a token. Cloudflare's view is read again when\nit's older than 30 seconds.\n\nAPI key access: **read**.",
        "operationId": "getClusterTunnel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The cluster's id (`cl_…`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`tunnel`: the cluster's tunnel, or null without one. `traffic`: \"public\", \"tailscale\" or \"tunnel\".",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such cluster, or it isn't yours to see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/databases": {
      "get": {
        "tags": [
          "Databases"
        ],
        "summary": "Databases",
        "description": "A team's Postgres and MySQL databases and Valkey\n(Redis-compatible) KV databases: engine, version, size, instances, the cluster's status (phase,\nprimary, ready instances, failovers), the services connected to each and\ntheir variables, passwords masked.\n\nAPI key access: **read**.",
        "operationId": "listDatabases",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`databases`, each with `id`, `name`, `engine`, `version`, `size`, `cpu`, `memory`, `storageGi`, `instances`, `pooler`, `rest`, `deletionProtection`, `status` (with `backup`: `firstRecoverabilityPoint`, `lastSuccessfulBackup`, `lastArchivedWal`, `lastFailedBackup`, `message`), `backup`, `restoredFrom`, `readReplicas`, `extensions`, `setup`, `members`, `connections` and `variables` (passwords masked). `backup` has `enabled`, `retentionDays` and `hour` for Postgres and MySQL. For KV, once turned on, it has `enabled`, `schedule`, `hour`, `keep` and `backupDatabaseId` (its id in Backups). `readReplicas` is null when off, or has `instances`, `ready`, `reported` and `members` (each with `name`, `ready`, `server` and `lagSeconds`). `extensions` is null for MySQL. For Postgres and KV, it lists each extension or module that's on or being turned off, with `name`, `enabled`, `state` (\"enabled\", \"pending\", \"restarting\", \"disabling\" or \"failed\") and a `message`. `setup` is null once the cluster's databases are set up. While they're being set up or updated, it has `state` (\"installing\" or \"failed\") and a `message`. While a new database waits for its engine's operator to start, `state` is \"starting\" and `message` names it. `members` lists each instance's `name`, `role` (\"primary\" or \"replica\"), `ready` and the `server` it runs on, primary first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/databases/{id}": {
      "get": {
        "tags": [
          "Databases"
        ],
        "summary": "A database",
        "description": "One Postgres, MySQL or KV database, as `listDatabases` lists them.\n\nAPI key access: **read**.",
        "operationId": "getDatabase",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The database's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The database, as in `listDatabases`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such database, or you can't see it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/database-extensions": {
      "get": {
        "tags": [
          "Databases"
        ],
        "summary": "Database extensions",
        "description": "The extensions Pyo's databases offer: Postgres extensions and KV\nmodules. Each one's `name`, `engine` (\"postgres\" or \"valkey\"), `section`\n(\"pyo\" ones are turned on with `setDatabaseExtensions`, and the\ndatabase's owner adds \"additional\" ones with CREATE EXTENSION), a\none-line `description`, its `docs`, its `edition` when it's a limited build,\n`hidden` when it's obsolete (shown only while a database has it on), and\nwhether turning it on or off `restart`s the database (every KV module\ndoes).\n\nAPI key access: **read**.",
        "operationId": "listDatabaseExtensions",
        "responses": {
          "200": {
            "description": "`extensions`: each one's `name`, `engine` (\"postgres\" or \"valkey\"), `section`, `description`, `docs`, `edition` (when it's a limited build), `hidden` (when it's obsolete) and `restart`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/databases/{id}/logs": {
      "get": {
        "tags": [
          "Databases"
        ],
        "summary": "A database's logs and events",
        "description": "The recent output of each of its parts, oldest first: `at`, `level`,\n`source` (the instance), `role` (\"primary\", \"replica\", \"read\",\n\"pooler\", \"read-pooler\", \"sentinel\", \"proxy\" (KV's endpoint) or \"other\"), `message`, and\n`raw` for structured lines. `events`: what happened to it, newest first.\nTo follow them live, open the WebSocket at `/databases/{id}/logs/follow`:\nit sends the last lines, then new ones as they're printed, each text\nframe `{\"type\":\"lines\",\"lines\":[…]}`, and all events as\n`{\"type\":\"events\",\"events\":[…]}` when they change (or\n`{\"type\":\"error\",\"message\":…}`). It closes after an hour, so open it\nagain with `since` set to the newest line's time.\n\nAPI key access: **read**.",
        "operationId": "getDatabaseLogs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The database's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "\"live\" (the default: the last lines), \"15m\", \"1h\", \"6h\" or \"24h\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`logs`, `events` and `fetchedAt`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such database, or you aren't in its team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "The agent couldn't read them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "504": {
            "description": "The cluster's agent didn't answer in time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/databases/{id}/analytics": {
      "get": {
        "tags": [
          "Databases"
        ],
        "summary": "A database's analytics",
        "description": "Its health over time, sampled about every 30 seconds. Per member\n(`members`: each instance, read replica, pooler and KV endpoint), its\n`role`, `server`, and series for `cpu` in cores, `memoryMi`,\n`diskUsedGi` (only where the volume reports its own space),\n`connections` and `lagSeconds`. For the whole database, `transactions`\n(Postgres), `queries` (MySQL), `poolerQueries` and `commands` (KV) per\nsecond, `connections` (`primary`, `replicas`, `limit`, and the pooler's\n`poolerActive`, `poolerWaiting`, `poolerServersActive`,\n`poolerServersIdle` and `poolerMaxWaitSeconds`), `cacheHitRatio`,\n`keyHitRatio`, `evictions` per second, `routing` (KV reads per second\nserved by `replica`s or the `primary`, and `fallbacks` to the primary)\nand `storage` (`sizeBytes`, `memoryUsedBytes`, `maxmemoryBytes`,\n`keys`). Each series lines up with `times`, with `null` where nothing\nwas measured. A series is `null` when the database doesn't report it.\n\nAPI key access: **read**.",
        "operationId": "getDatabaseAnalytics",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The database's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "\"1h\", \"24h\" (the default), \"7d\" or \"30d\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`range`, `stepMs`, `times` (milliseconds), `engine`, `members` and the database's series.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such database, or you aren't in its team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "This installation doesn't store metrics.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/database-backups": {
      "post": {
        "tags": [
          "Databases"
        ],
        "summary": "Back up a database",
        "description": "Checks the admin login from the cluster, makes a backup user with it,\nthen saves the database and its schedule. Team owners and admins.\n\nAPI key access: **deploy**.",
        "operationId": "addDatabaseBackup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddDatabase"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved: `ok` and the new database's `id`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A missing or wrong value, or the login didn't work.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You aren't an owner or admin of the team, or the API key can only read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team or service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The team already backs up a database by that name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "504": {
            "description": "The cluster didn't finish checking in time (is it connected?).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "deploy"
      }
    },
    "/database-imports/check": {
      "post": {
        "tags": [
          "Databases"
        ],
        "summary": "Check an import",
        "description": "Everything `startDatabaseImport` checks, without importing. The cluster\nconnects to the source, which must be reachable from there, and checks\nthe login, TLS, its version, its extensions and that every table is\nreadable. It also checks that the database to import into is empty.\nOwners and admins.\n\nAPI key access: **full**.",
        "operationId": "checkDatabaseImport",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartImport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "It can be imported: `source` (`version`, `sizeBytes`), and `extensions`: `turnedOn` (Pyo turns them on first) and `madeByImport`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Why not: the URL, the source can't be reached or refuses the login, TLS, its version, an extension Pyo's Postgres doesn't have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The database to import into isn't empty, or is importing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "504": {
            "description": "The cluster didn't answer in time (is it connected?).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/database-imports": {
      "post": {
        "tags": [
          "Databases"
        ],
        "summary": "Import into a database",
        "description": "Copies a Postgres or MySQL database into one of the team's: a new one\n(`newDatabase`), or an empty one (`databaseId`). From `url` (the source\nmust be reachable from the cluster) or `uploadId` (a dump uploaded\nfirst). It's checked first, as `checkDatabaseImport`. Then the\ndatabase's `import` shows how it goes (\"pending\", \"running\", \"succeeded\"\nor \"failed\", with a `phase`), and its logs have the import's output.\nWrites made to the source during the import aren't copied. Owners and\nadmins.\n\nAPI key access: **full**.",
        "operationId": "startDatabaseImport",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartImport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Started: `importId`, `databaseId`, `clusterId`, and what the check found (`source`, `extensions`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Why not (as `checkDatabaseImport`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You aren't an owner or admin of the team, or the API key can't make changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The database isn't empty or is importing, or the name is taken.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "504": {
            "description": "The cluster didn't answer in time (is it connected?).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/database-imports/{id}/retry": {
      "post": {
        "tags": [
          "Databases"
        ],
        "summary": "Retry an import",
        "description": "Runs a failed import again, from the same source. After a failure, Pyo\nkeeps the URL's password (sealed), and an uploaded dump for\n`PYO_DATABASE_IMPORT_RETENTION_HOURS` (24 by default). A new database\nmade for the import is made again. A database that already existed must\nstill be empty. Owners and admins.\n\nAPI key access: **full**.",
        "operationId": "retryDatabaseImport",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The import's id (the database's `import.id`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Started again: the new `importId`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Why not (as `checkDatabaseImport`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "It didn't fail, there's a newer one, or the dump is gone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/database-imports/uploads": {
      "post": {
        "tags": [
          "Databases"
        ],
        "summary": "Start an upload",
        "description": "The first step of uploading a dump to import: say what it is and get\nwhere to send it. Then `PUT` the file to `uploadUrl` as it is, before\n`expiresAt`, with exactly the `headers` given and nothing else. Send no\ncookies or API key, since the URL may be on another host. Or send it in\nparts of `partSize` bytes with `uploadDatabaseDumpPart`, then\n`completeDatabaseDumpUpload`, so no request is bigger than a proxy in\nfront takes. Then call `startDatabaseImport` with `uploadId`. Postgres takes `.sql`, `.sql.gz`\nor a custom-format `.dump` (pg_dump -Fc). MySQL takes `.sql` or\n`.sql.gz` (mysqldump). The dump stays in the team's storage in Pyo until\nits import succeeds, or for `PYO_DATABASE_IMPORT_RETENTION_HOURS` (24 by\ndefault) when unused. At most `PYO_DATABASE_IMPORT_MAX_BYTES` (10 GiB by\ndefault). Owners and admins.\n\nAPI key access: **full**.",
        "operationId": "createDatabaseDumpUpload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewUpload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "`uploadId` (for `startDatabaseImport`), and where to send the file: `uploadUrl` (relative to your Pyo's address when it starts with `/`), `method` (\"PUT\"), `headers` (send exactly these) and `expiresAt` (start sending before it). For parts: `partSize` (bytes in each part but the last) and `parts` (how many).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Not a file Pyo can import, by its name, or empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You aren't an owner or admin of the team, or the API key can't make changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "413": {
            "description": "Bigger than this installation takes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "This installation has no storage for uploads.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/database-imports/uploads/{id}/content": {
      "put": {
        "tags": [
          "Databases"
        ],
        "summary": "Send an upload's file",
        "description": "The second step: the file, as the request's body, to the `uploadUrl`\nthat `createDatabaseDumpUpload` gave (its `token` is the only\ncredential: send no API key). Once only, before its `expiresAt`, and\nexactly the size declared.\n\nNo API key needed.",
        "operationId": "uploadDatabaseDump",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The upload's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "query",
            "description": "The upload's one-time token, from `uploadUrl`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The file.",
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored: `uploadId`, `size`, `sha256`, `format`, `extensions` (Postgres: the ones it makes) and `sourceVersion` (what it was dumped from, when it says).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Not the size declared, or not what its name says.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "The token is wrong, used already or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "This installation has no storage for uploads.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-pyo-access": "none"
      }
    },
    "/database-imports/uploads/{id}/parts/{n}": {
      "put": {
        "tags": [
          "Databases"
        ],
        "summary": "Send a part of an upload's file",
        "description": "Part `n` (from 0) of the file, as the request's body: exactly\n`partSize` bytes, the last part what's left. Parts go in order. Send a\npart again when its request failed: one that arrived already is taken\nonce. `x-pyo-sha256` may carry the part's SHA-256 (hex), to check it on\narrival. Owners and admins.\n\nAPI key access: **full**.",
        "operationId": "uploadDatabaseDumpPart",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The upload's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "description": "The part, from 0.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "description": "The part's bytes.",
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored: `received` (parts so far) and `parts`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Not the next part, not its size or SHA-256, or not what the file's name says.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You aren't an owner or admin of the team, or the API key can't make changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such upload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The upload is complete already, or sent in one request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "410": {
            "description": "The upload expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/database-imports/uploads/{id}": {
      "get": {
        "tags": [
          "Databases"
        ],
        "summary": "An upload in parts",
        "description": "How far an upload's file got: `state` (\"pending\" before any part,\n\"uploading\", \"uploaded\"), `parts` and `received` (the next part to send\nis this). Owners and admins.\n\nAPI key access: **full**.",
        "operationId": "getDatabaseDumpUpload",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The upload's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`uploadId`, `state`, `partSize`, `parts` and `received`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You aren't an owner or admin of the team, or the API key can't make changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such upload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/database-imports/uploads/{id}/complete": {
      "post": {
        "tags": [
          "Databases"
        ],
        "summary": "Finish an upload in parts",
        "description": "Once every part is sent: Pyo puts the file together in the team's\nstorage and checks it against `sha256`, when given. Then call\n`startDatabaseImport` with `uploadId`. Owners and admins.\n\nAPI key access: **full**.",
        "operationId": "completeDatabaseDumpUpload",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The upload's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteUpload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored: `uploadId`, `size`, `sha256`, `format`, `extensions` (Postgres: the ones it makes) and `sourceVersion` (what it was dumped from, when it says).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Parts are missing (`getDatabaseDumpUpload` says how many arrived), or the file isn't the one sent (the upload is gone then: start again).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You aren't an owner or admin of the team, or the API key can't make changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such upload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/source-uploads": {
      "post": {
        "tags": [
          "Deployments"
        ],
        "summary": "Start an upload",
        "description": "The first step of deploying a folder: say what the archive is (a\ngzipped tar of the folder) and get where its parts go. Send each part\nwith `uploadSourcePart`, then `completeSourceUpload`, then `deploy` (or\n`createService`) with the `uploadId`. At most\n`PYO_SOURCE_UPLOAD_MAX_BYTES` (500 MB by default). Kept for 2 hours.\n\nAPI key access: **deploy**.",
        "operationId": "createSourceUpload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewSourceUpload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "`uploadId`, `partSize` (bytes in each part but the last), `parts` (how many) and `expiresAt`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Empty, or not a SHA-256.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You can't deploy in this team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "413": {
            "description": "Bigger than this installation takes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many uploads waiting in this team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "deploy"
      }
    },
    "/source-uploads/{id}/parts/{n}": {
      "put": {
        "tags": [
          "Deployments"
        ],
        "summary": "Send a part",
        "description": "Part `n` (from 0) of an upload's archive, as the request's body: exactly\n`partSize` bytes, the last part what's left. Sending a part again\nreplaces it.\n\nAPI key access: **deploy**.",
        "operationId": "uploadSourcePart",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The upload's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "description": "The part, from 0.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "description": "The part's bytes.",
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Not a part of this upload, or not its size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such upload, or it expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The upload is complete already.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "deploy"
      }
    },
    "/source-uploads/{id}": {
      "get": {
        "tags": [
          "Deployments"
        ],
        "summary": "An upload",
        "description": "Which parts of an upload Pyo has (`received`), to send the rest after a\nbreak, and its `state`: \"uploading\", \"ready\" (complete) or \"used\" (a\ndeployment builds it).\n\nAPI key access: **deploy**.",
        "operationId": "getSourceUpload",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The upload's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`uploadId`, `state`, `parts` and `received`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such upload, or it expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "deploy"
      }
    },
    "/source-uploads/{id}/complete": {
      "post": {
        "tags": [
          "Deployments"
        ],
        "summary": "Finish an upload",
        "description": "Once every part is sent: Pyo checks the archive against its SHA-256.\nThen deploy it with `deploy` (or `createService`) and its `uploadId`.\n\nAPI key access: **deploy**.",
        "operationId": "completeSourceUpload",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The upload's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Parts are missing (`getSourceUpload` says which), or the archive isn't what was declared (the upload is gone then: start again).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such upload, or it expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "deploy"
      }
    },
    "/github/repos": {
      "get": {
        "tags": [
          "GitHub"
        ],
        "summary": "GitHub repositories",
        "description": "The repositories the team's GitHub installations can see, to deploy\nfrom.\n\nAPI key access: **read**.",
        "operationId": "listGithubRepos",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`repositories`: each with `installationId`, `account`, `fullName`, `name`, `private`, `defaultBranch`, `htmlUrl` and `pushedAt`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No `team`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/github/build-file": {
      "get": {
        "tags": [
          "GitHub"
        ],
        "summary": "The Dockerfile a Git build of a repository would use by default, in the\nbuild context. None: the build is zero-config (Railpack).",
        "description": "API key access: **read**.",
        "operationId": "getGithubBuildFile",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "query",
            "description": "The repository, as owner/name or its GitHub URL.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "branch",
            "in": "query",
            "description": "The branch to look at.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "context",
            "in": "query",
            "description": "The build context, a folder of the repository (\".\" for its root).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`file`: the Dockerfile Pyo would use, or null when there's none.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No `team`, `repo` or `branch`, or the team hasn't connected GitHub.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/git/repos": {
      "get": {
        "tags": [
          "Git providers"
        ],
        "summary": "Git repositories",
        "description": "The repositories the team's Git connections (GitLab) can deploy: those\ntheir token has the Maintainer role on, latest activity first.\n\nAPI key access: **read**.",
        "operationId": "listGitRepos",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Only repositories whose path contains this.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`repositories`: each with `connectionId`, `provider`, `host`, `fullName`, `name`, `group`, `private`, `defaultBranch`, `htmlUrl` and `pushedAt`. `errors`: connections that couldn't be listed, with `connectionId` and `message`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "No `team`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/git/branches": {
      "get": {
        "tags": [
          "Git providers"
        ],
        "summary": "Git branches",
        "description": "A repository's branches, through one of the team's Git connections.\n\nAPI key access: **read**.",
        "operationId": "listGitBranches",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "The Git connection's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "query",
            "description": "The repository: its path (\"group/project\") or URL.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Only branches whose name contains this.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`branches`: each with `name`, `commit`, `default` and `protected`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A missing or invalid field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team or connection, or you aren't in the team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "The provider couldn't be reached or refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/git/build-file": {
      "get": {
        "tags": [
          "Git providers"
        ],
        "summary": "Git build file",
        "description": "The Dockerfile a build of a repository of the team's Git connections\nwould use by default, in the build context. Null: the build is\nzero-config (Railpack).\n\nAPI key access: **read**.",
        "operationId": "getGitBuildFile",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "The Git connection's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "query",
            "description": "The repository: its path (\"group/project\") or URL.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "branch",
            "in": "query",
            "description": "The branch to look at.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "context",
            "in": "query",
            "description": "The build context, a folder of the repository (\".\" for its root).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`file`: the Dockerfile Pyo would use, or null when there's none.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A missing or invalid field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team or connection, or you aren't in the team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "The provider couldn't be reached or refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/compose/preview": {
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Preview a Docker Compose import",
        "description": "What importing a Compose file would create: a project, and a service per\nCompose service with its source, ports, variables, volumes and health\ncheck, in deploy order. It adds a warning for each thing that isn't\ncarried over. Nothing is created. Edit the plan if you like, then pass it\nto the `importCompose` operation.\n\nAPI key access: **read**.",
        "operationId": "previewCompose",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComposePlan"
                }
              }
            }
          },
          "400": {
            "description": "Not a Compose file Pyo can read, nothing importable, or no file given.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, cluster or file.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "GitHub couldn't be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/compose/sync-plan": {
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Plan a Docker Compose sync",
        "description": "What applying a Compose file to the project made from it would change,\nservice by service: added, changed (and what), unchanged, or not in the\nfile. Only what the file sets is compared, so settings changed in Pyo\nthat the file doesn't mention stay. A secret's value is never changed.\nAn image's tag follows the file only when the file changed it.\nWhat can't change in place is listed under `manual` and left as it is.\nNothing changes. Pass `file` to the `syncCompose` operation to apply it,\nor to `importCompose` when there's no `project` yet.\n\nBesides Compose, each service's `x-pyo` can set `domains`, `behindCdn`\n(\"cloudflare\" or \"none\"), `health` (a path like \"/healthz\", \"tcp\" or\n\"none\"), `replicas`, `placement` (`{\"servers\": [...], \"tags\": [...]}`)\nand `secrets` (variable names; their values are set in Pyo).\n\nAPI key access: **read**.",
        "operationId": "planComposeSync",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncPlan"
                }
              }
            }
          },
          "400": {
            "description": "Not a Compose file Pyo can read, nothing importable, or no file given.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, project, cluster or file.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "GitHub couldn't be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/cloud/options": {
      "get": {
        "tags": [
          "Servers"
        ],
        "summary": "Server types and prices",
        "description": "What a new server at a cloud provider can be, read live from it with the\nteam's token: its locations, and its server types with their specs,\narchitecture, where each can be made now and its monthly price in each\nlocation (before VAT, with its IPv4 address). Pyo's servers run x86-64,\nso Arm types have `supported` false.\n\nAPI key access: **read**.",
        "operationId": "getCloudOptions",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "description": "The provider: \"hetzner\".",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`provider`, `currency`, `locations` (each with `name`, `city`, `country` and `networkZone`) and `serverTypes` (each with `name`, `description`, `cores`, `memoryGb`, `diskGb`, `cpuType`, `architecture`, `supported`, `prices` by location and `available` locations).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The team hasn't connected the provider.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "The provider failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/audit-log": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "Audit log",
        "description": "Who did what in a team, newest first: when, the account, the action,\nhow (dashboard, API key or assistant) and the address and browser it\ncame from, as the team keeps them. Sign-ins, failed sign-ins and\ntwo-factor changes are here too. For the team's owners and admins.\n\nAPI key access: **read**.",
        "operationId": "listAuditLog",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id (`team_…`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "person",
            "in": "query",
            "description": "Only what this account did (its user id), or `pyo` for Pyo's own.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "description": "Only this action (`member.role_changed`) or kind of action (`member`).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "From this time on (milliseconds).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Up to this time (milliseconds).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next` of the page before.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "`csv` for a download of everything that matches (up to 50,000 rows).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`events` (each with `id`, `at`, `action`, `title`, `actor` {id, name, email}, `via`, `key`, `ip`, `userAgent`, `target` and `outcome`), `next` (the `cursor` for the next page, or null), `people` (who appears in the log), `ips` (what the team keeps of addresses) and `days` (how long entries are kept). With `format=csv`, a CSV file.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Not an owner or admin of the team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or it isn't yours to see.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/tailnet/lock": {
      "get": {
        "tags": [
          "Servers"
        ],
        "summary": "Machines waiting for a Tailnet Lock signature",
        "description": "With Tailnet Lock on, a new server stays off the tailnet until a\nsigning device signs its key. These are the ones on the team's\nclusters' tailnets that wait, with the command to run on a signing\ndevice, as each cluster last saw them. Empty without Tailscale set up.\n\nAPI key access: **read**.",
        "operationId": "getTailnetLock",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team adding the server (slug or id).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`waiting`: each with `name` (the machine's hostname) and `signCommand`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Only owners and admins add servers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/platform-imports/preview": {
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Preview an import from another platform",
        "description": "Reads a Coolify or Dokploy installation, or a Railway or Vercel\naccount, through its API with a token you give, and shows what importing would create: per project there, its\nservices (source, ports, domains, variable names, volumes), Compose\nstacks and databases, each with what doesn't carry over. Nothing is\ncreated and the token isn't kept. Things an earlier import made are\nmarked (`existingId`). Owners and admins.\n\nAPI key access: **full**.",
        "operationId": "previewPlatformImport",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The plan. Variables have no values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportPlan"
                }
              }
            }
          },
          "400": {
            "description": "The address or token isn't usable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You aren't an owner or admin of the team, or the API key can't make changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many imports for now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "The platform couldn't be reached or refused the token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/platform-imports": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "List imports from other platforms",
        "description": "A team's imports of the last 30 days, newest first (at most 20). Owners\nand admins.\n\nAPI key access: **read**.",
        "operationId": "listPlatformImports",
        "parameters": [
          {
            "name": "teamId",
            "in": "query",
            "description": "The team whose imports to list.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`imports`: each one as `getPlatformImport` gives it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You aren't an owner or admin of the team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      },
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Import from another platform",
        "description": "Starts an import and answers at once with it (`getPlatformImport` follows\nit). On the server, whatever happens to this request, Pyo reads the\nplatform again (as `previewPlatformImport`) and creates the picked\nthings (`items`, all by default): a project per project there, its\nservices with their variables (secret ones sealed), domains (live after\nthe first deploy), ports and empty volumes, a project per Compose stack,\nand databases. A Postgres or MySQL database reachable from outside the\nplatform is copied by a database import. Others are made empty or left\nfor you. Services aren't deployed unless `deploy`. Running it again\nskips what an earlier import made. The token is kept in memory for the\nimport only, never stored. Owners and admins.\n\nAPI key access: **full**.",
        "operationId": "startPlatformImport",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Started: the import, `reading` at first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportRun"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "You aren't an owner or admin of the team, or the API key can't make changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many imports for now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/platform-imports/{id}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "Get an import from another platform",
        "description": "How an import started with `startPlatformImport` is doing: its status,\nwhat it makes and what became of each item so far. Owners and admins.\n\nAPI key access: **read**.",
        "operationId": "getPlatformImport",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The import's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The import.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportRun"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such import.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      }
    },
    "/sandboxes": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Sandboxes",
        "description": "A team's sandboxes: their template, size, state, server and lifetime.\nEnv values are never shown, only their names.\n\nAPI key access: **read**.",
        "operationId": "listSandboxes",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "\"live\" (the default: not stopped or failed) or \"all\" (the latest 500).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Only sandboxes whose name or id has this text, ignoring case.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`sandboxes`, newest first, each with `id`, `name`, `teamId`, `projectId`, `serverId`, `server`, `template`, `templateId`, `state` (\"creating\", \"running\", \"pausing\", \"paused\", \"resuming\", \"stopping\", \"stopped\" or \"failed\"), `preparing` (true while it waits for its server to make its template), `runtime` (\"firecracker\" or \"gvisor\"), `cpus`, `memoryMib`, `diskMib`, `network`, `isolation`, `labels`, `env` (names only), `url` (where its server's daemon is called: HTTPS on the server's tailnet name, this Pyo at `/api/sandbox-proxy` for a server without Tailscale, or null while `serverNeedsUpdate`), `proxied` (true when its server has no Tailscale, so calls to it go through Pyo, left out otherwise), `serverNeedsUpdate` (its server joined before 0.52.0 and takes no commands until it's updated), `edgeUrl` (its server's edge proxy, or null), `ports` (each `port`, `public` and `url`), `error`, `createdBy`, `createdAt`, `startedAt`, `expiresAt` (null when it runs until it's deleted), `pausedAt` and `endedAt`. Also `limits` (the team's, `maxTtlSecs` null when there's no limit) and `inUse` (what its sandboxes take now).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      },
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Create a sandbox",
        "description": "Makes an isolated machine from a sandbox template on one of the team's\nsandbox servers (or the installation's), within the team's limits. It\nruns until its lifetime ends or it's deleted. The answer has the\n`connection`: the server's address and a token, valid an hour, for exec,\nterminals, files and ports there. A server with Tailscale answers on\nyour tailnet. One without is called through Pyo, at the `url` the\nconnection gives, and its desktop and web pages don't open until it has\nTailscale. Ask for a new token with\n`createSandboxToken`. `teamId` may be left out when the API key (or\nyou) can use only one team. `server` runs it on that server only.\n\nA server that doesn't have Pyo's template `base` (or `desktop`) yet\nmakes it first: the first sandbox from it there takes a minute or so\nlonger, and later ones start at once.\n\nAPI key access: **sandboxes**.",
        "operationId": "createSandbox",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSandbox"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "`sandbox` (as in `listSandboxes`) and `connection`: `url`, `sandboxId`, `token`, `expiresAt`, `webUrl` (on your tailnet only) and `proxied` (true for a server without Tailscale, left out otherwise).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A size, lifetime or other value Pyo can't accept, or no `teamId` when you can use more than one team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Your role, the API key's access or the team's sandbox limits don't allow it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, template, project or server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "No sandbox server can run it: none yet, none with the template, none with KVM for `isolation: vm`, or the servers need an update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "The server couldn't make `base` or `desktop`. The error says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Every sandbox server is full or down, the server asked for has no room, or `base` or `desktop` is still being made there. Try again soon.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    },
    "/sandboxes/{id}": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "A sandbox",
        "description": "One sandbox, as `listSandboxes` lists them, with a fresh `connection`\nfor its server when you may use it.\n\nAPI key access: **read**.",
        "operationId": "getSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox's id, `sbx_…`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sandbox, with `connection` (as in `createSandbox`) when you may use sandboxes and it lives. Otherwise `connection` is null and `connectionNote` says why: a read-only key, a viewer, a sandbox that has ended, or a server that needs an update.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox, or you can't see it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      },
      "delete": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Delete a sandbox",
        "description": "Ends the sandbox and throws away its files. When its server can't be\nreached right now, it shows as stopping and Pyo tries again.\n\nAPI key access: **sandboxes**.",
        "operationId": "deleteSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sandbox, now stopped or stopping.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Its server needs an update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      },
      "patch": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Rename a sandbox",
        "description": "Gives the sandbox another name. Its id stays the same, so scripts that\nuse it keep working. Works on ended sandboxes too.\n\nAPI key access: **sandboxes**.",
        "operationId": "renameSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Rename"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The sandbox, with its new `name`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A name Pyo can't accept. The error says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    },
    "/sandboxes/{id}/pause": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Pause a sandbox",
        "description": "Stops its machine and keeps its memory and files on the server, so it\nresumes where it was. Connections to it drop.\n\nAPI key access: **sandboxes**.",
        "operationId": "pauseSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sandbox, paused.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "It has ended, isn't running, or its server needs an update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    },
    "/sandboxes/{id}/resume": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Resume a sandbox",
        "description": "Starts a paused sandbox again where it was.\n\nAPI key access: **sandboxes**.",
        "operationId": "resumeSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sandbox, running.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "It has ended, isn't paused, or its server needs an update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    },
    "/sandboxes/{id}/extend": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Extend a sandbox",
        "description": "Sets when the sandbox ends: `ttl` from now, or never with `\"none\"`.\n\nAPI key access: **sandboxes**.",
        "operationId": "extendSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Extend"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The sandbox, with its new `expiresAt` (null when it runs until it's deleted).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Longer than the team's sandboxes may live.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    },
    "/sandboxes/{id}/token": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "New sandbox token",
        "description": "A new token for the sandbox's server, valid an hour. Ask before the\nlast one runs out.\n\nAPI key access: **sandboxes**.",
        "operationId": "createSandboxToken",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The connection: `url`, `sandboxId`, `token`, `expiresAt`, `webUrl` (on your tailnet only) and `proxied` (true for a server without Tailscale, left out otherwise).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Connection"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "It has ended, or its server needs an update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    },
    "/sandboxes/{id}/ports": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Open a sandbox port",
        "description": "Serves a port the sandbox listens on at its own URL. A public port\nanswers anyone. A private one needs a sandbox token, in\n`Authorization: Bearer` or once as `?pyo_token=` in a browser.\n\nAPI key access: **sandboxes**.",
        "operationId": "openSandboxPort",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenPort"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "`url`, `port` and `public`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "It has ended, its server has no edge proxy, or its server needs an update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    },
    "/sandboxes/{id}/ports/{port}": {
      "delete": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Close a sandbox port",
        "description": "Stops serving the port at its URL. Closing a port that isn't open is\nfine.\n\nAPI key access: **sandboxes**.",
        "operationId": "closeSandboxPort",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "port",
            "in": "path",
            "description": "The port, like 3000.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`port` and `closed`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "It has ended, or its server needs an update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    },
    "/sandbox-servers": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Sandbox servers",
        "description": "The servers a team's sandboxes run on: its own and the installation's.\n\nAPI key access: **read**.",
        "operationId": "listSandboxServers",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`servers`, each with `id`, `teamId` (null for the installation's), `name`, `address`, `state` (\"joining\", \"ready\", \"unreachable\" or \"refused\"), `enabled`, `runtime` (\"firecracker\" or \"gvisor\", what runs its sandboxes, null until it reports), `capability` (`runtime`, `kvm`, `bootMs`, `arch`, `cpus`, `memory`, `disk`, `gvisorVersion` and the checks), `summary` (one line about it), `capacity`, `templates`, `daemonVersion`, `lastReportAt`, `error`, `sandboxes` (how many run there), `createdAt`, `outbound` (it gets its work over its channel), `proxied` (it has no Tailscale, so calls to its sandboxes go through Pyo), `tailnetName` (its name on the team's tailnet, null without Tailscale), `needsUpdate` (it joined before 0.52.0 and takes no commands until resetSandboxServerAccess gives the command that updates it), `edgeDomain` and, with an edge domain, `edge`: its `domain`, `https` (whether it serves HTTPS), `cert` (`state`: \"none\", \"issuing\", \"ready\" or \"failed\", `notAfter`, `issuedAt`, `error`, `served`), `cloudflare` (the connected zone that covers it: `teamId`, `zone`, `canEdit`, or null) and `dns` (`name`, the `records` to point it at the server, and what Pyo `made`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      },
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Add a sandbox server",
        "description": "Makes a server's one-time join code and the command to run on it. The\ncode works once, for 15 minutes. The command,\n`curl -fsSL <url>/server.sh | bash -s -- sandbox <token>`, runs\npyo-server with one token that carries the code. It installs Pyo's\nsandbox daemon, checks what the server can run (Firecracker where it has KVM,\ngVisor elsewhere) and joins Pyo. The server then gets its work from Pyo\nover HTTPS: Pyo never calls it. With Tailscale set up, the command also\njoins your tailnet, and the terminal, files and desktop open there.\nWithout, the server joins with its code alone at Pyo's public HTTPS\naddress, the terminal and files go through Pyo, and the desktop needs\nTailscale. Adding a server that hasn't joined yet again makes a new\ncode. With `id`, asking again changes that server until it joins. Team\nowners and admins. On Pyo Cloud, use createSandboxJoinCode.\n\nAPI key access: **full**.",
        "operationId": "addSandboxServer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddServer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "`server`, `command` (run it on the server as root) and `expiresAt` (when the code runs out).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A bad name or `id`, or the team's Tailscale needs setting up again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "`id` is another team's server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "A server with that name is there already, the server with that `id` has joined, Pyo isn't on the tailnet yet, the server's tailnet can't reach Pyo, or there's no Tailscale and Pyo has no HTTPS address the server can reach.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many codes for the team in an hour.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/sandbox-servers/cloud": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Buy a sandbox server at a cloud provider",
        "description": "Makes a server in the team's Hetzner project and sets it up as a sandbox\nserver, the way Pyo makes a cluster's servers there. Read the locations,\nserver types and prices with getCloudOptions first. On its first boot\npyo-server joins your tailnet and sets it up with a one-time code. Hetzner\nCloud servers have no KVM, so it runs sandboxes on gVisor. Follow it in\nthe server's `cloud` (creating, booting, joining, ready) and `state`.\nWithout `confirm` it answers 409 with the monthly price. Confirm that\nwith the user, then send it again with `confirm: true`. Team owners and\nadmins. Needs Tailscale and the team's Hetzner connection.\n\nAPI key access: **full**.",
        "operationId": "createCloudSandboxServer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddCloudServer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "`server` (as listSandboxServers shows it) and `cloudServer` (`id`, `name`, `state`, `monthly`, `currency`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A bad name, location or server type, or Tailscale or Hetzner isn't set up.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "`needsConfirm` with the monthly price, a name in use, a type Hetzner can't make now, or Pyo isn't on the tailnet yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "Hetzner failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/sandbox-servers/join-codes": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Make a sandbox server's join code",
        "description": "On Pyo Cloud: adds a sandbox server to the team, or makes a new code for\none that hasn't joined yet, and the command to run on it. The code works\nonce, for 15 minutes. The command,\n`curl -fsSL <url>/server.sh | bash -s -- sandbox <token>`, runs\npyo-server with one token that carries the code. It installs Pyo's\nsandbox daemon and joins Pyo over HTTPS. The server then gets its work from Pyo. With\nTailscale on Integrations, the command also joins your tailnet with a\nkey from your team's Tailscale, and the terminal, files and desktop\nopen there. Without, the server joins with its code alone, the terminal\nand files go through Pyo, and the desktop needs Tailscale. With `id`,\nasking again changes that server until it joins. Team owners and\nadmins.\n\nAPI key access: **full**.",
        "operationId": "createSandboxJoinCode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJoinCode"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "`server`, `command` (run it on the server as root), `expiresAt` (when the code runs out) and `pyoUrl`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A bad name or `id`, or the team's Tailscale needs setting up again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "`id` is another team's server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "A server with that name is there already, the server with that `id` has joined, the cluster that keeps your Tailscale isn't connected, or this Pyo adds sandbox servers with addSandboxServer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many codes for the team in an hour.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/sandbox-servers/{id}/reset-access": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Reset a sandbox server's access",
        "description": "The server's key stops working at once, and its waiting commands fail.\nAnswers with a new command for the same server, which works once, for 15\nminutes. Run it there to join again. On a self-hosted Pyo, a server that\nshows `needsUpdate` gets the command that updates it instead (Update):\nit takes no commands until the command runs there. Its sandboxes keep\nrunning. The new command joins the server the way that fits now: on\nyour tailnet once Tailscale is set up, without it otherwise. So it also\nmoves a server onto the tailnet, or off it. Team owners and admins, or\nthe installation's admin for its own servers.\n\nAPI key access: **full**.",
        "operationId": "resetSandboxServerAccess",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox server's id, `sbs_…`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`server`, `command` (run it on the server as root), `expiresAt` (when the code runs out) and `pyoUrl`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "On Pyo Cloud, the server doesn't join over HTTPS. Or the cluster that keeps your Tailscale isn't connected, the server's tailnet can't reach Pyo, or there's no Tailscale and Pyo has no HTTPS address the server can reach.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many codes for the team in an hour.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/sandbox-servers/{id}/keep": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Keep a sandbox server that hasn't joined",
        "description": "A server added with an `id` that never joins is removed a day after\nits last code runs out. This keeps it until it's removed, with\nresetSandboxServerAccess for a new command. Fine for a server that's\nkept already. Team owners and admins, or the installation's admin for\nits own servers.\n\nAPI key access: **full**.",
        "operationId": "keepSandboxServer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox server's id, `sbs_…`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`ok`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/sandbox-servers/{id}": {
      "delete": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Remove a sandbox server",
        "description": "Deletes its sandboxes where it still answers, and forgets it. To take the\ndaemon off the server, run `pyo-server uninstall` there. A server set up\nwith sandbox.sh before 0.53.0 takes `sandbox.sh --uninstall`. A server Pyo\nmade at a cloud provider leaves your tailnet and is deleted there, which\ntakes `confirm`. With `draft`, only a server that never joined is\nremoved, and one that joined is left alone.\n\nAPI key access: **full**.",
        "operationId": "removeSandboxServer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox server's id, `sbs_…`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "Delete a server Pyo made at a cloud provider: without it the answer\nis 409 with the monthly cost that stops.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "draft",
            "in": "query",
            "description": "Only take back a server that never joined, as a form that added it\nwith an `id` does when it's left. One that joined is left alone.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`ok`, `removed` (false with `draft` when it was left alone), `stopped` (how many sandboxes ended) and `deleting` (whether it's being deleted at the provider). With `draft` also `joined`: whether it was left alone because it joined.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such sandbox server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "`needsConfirm`: it's deleted at the provider, with the monthly cost that stops.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/sandbox-servers/{id}/certificate": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Get a sandbox server's certificate",
        "description": "Gets a Let's Encrypt certificate for `*.<edge domain>` with a DNS-01\nchallenge in the team's Cloudflare connection, and puts it on the\nserver, whose edge serves it at once. It runs in the background: the\nserver's `edge.cert.state` says how it goes. Pyo renews it 30 days\nbefore it runs out. Also renews it now. The zone must be connected and\neditable. Team owners and admins, or the installation's admin for its\nown servers.\n\nAPI key access: **full**.",
        "operationId": "issueSandboxServerCertificate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox server's id, `sbs_…`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EdgeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "`state`: \"issuing\".",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The server has no edge domain, or no connected Cloudflare zone covers it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Pyo is getting it already.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/sandbox-servers/{id}/dns-record": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Create a sandbox server's DNS record",
        "description": "Creates the wildcard record `*.<edge domain>` in the team's Cloudflare\nconnection: A (and AAAA) to the public addresses the server reports,\nnot proxied. Records already on the name are never changed: another one\nthere is a conflict. Team owners and admins, or the installation's\nadmin for its own servers.\n\nAPI key access: **full**.",
        "operationId": "createSandboxServerDnsRecord",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The sandbox server's id, `sbs_…`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EdgeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "`ok`, `status` (\"created\", \"exists\" or \"conflict\") and `existing` (the records in the way).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The server has no edge domain, or no connected Cloudflare zone covers it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The server reports no public address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "full"
      }
    },
    "/sandbox-templates": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Sandbox templates",
        "description": "What a team's sandboxes can start from: its own templates and the\ninstallation's.\n\nAPI key access: **read**.",
        "operationId": "listSandboxTemplates",
        "parameters": [
          {
            "name": "team",
            "in": "query",
            "description": "The team's id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`templates`, each with `id`, `teamId` (null for the installation's), `name`, `source` (`kind` and `image`), `state` (\"pending\", \"building\", \"ready\" or \"failed\", from its servers, and \"unavailable\" for `base` or `desktop` while Pyo has no image for it), `builtin`, `servers`, `error` and `createdAt`. Pyo's own `base` and `desktop` come first, are always listed and are ready to use: servers make them on first use, so their `servers` are those that have them. Each of the other templates' `servers` is a sandbox server that may use it, with `id`, `name`, `state` (\"pending\", \"building\", \"ready\" or \"failed\"), `phase` while building (\"queued\", \"pulling\", \"unpacking\" or \"snapshotting\"), `pulled` and `unpacked` of `imageBytes` (asked of the server as the list is read, while it builds), `pullMs`, `unpackMs` and `snapshotMs`, `bytes` (disk it takes there), `snapshots` and `error`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such team, or you aren't in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "read"
      },
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Create a sandbox template",
        "description": "A template made from an OCI image, like \"node:22\", or an image in Pyo's\nregistry. Every sandbox server that may use it pulls the image and makes\na root disk from it. A Firecracker server boots it once and snapshots\nit, and a gVisor server starts sandboxes from the disk. The template is\nready once one server has it.\n\nAPI key access: **sandboxes**.",
        "operationId": "createSandboxTemplate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The template, as in `listSandboxTemplates`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A bad name or image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The team has a template with that name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    },
    "/sandbox-templates/{id}": {
      "delete": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Delete a sandbox template",
        "description": "Deletes it here and on the sandbox servers. Refused while sandboxes run\nfrom it.\n\nAPI key access: **sandboxes**.",
        "operationId": "deleteSandboxTemplate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The template's id, `stp_…`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`ok`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or not a valid one (revoked, expired or mistyped).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "No such template.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Sandboxes still run from it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Pyo's side. It's logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "x-pyo-access": "sandboxes"
      }
    }
  },
  "components": {
    "schemas": {
      "AddAlertChannelOp": {
        "type": "object",
        "title": "Add alert channel",
        "description": "Send the team's alerts somewhere: `kind` \"telegram\" (a bot `token` and a `chatId`), \"discord\" or \"slack\" (the channel's `webhookUrl`), or \"webhook\" (your `webhookUrl`, and a `secret` to sign each request with). Pyo keeps it encrypted. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "kind",
          "name"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "addAlertChannel"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `alc_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "teamId": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "\"telegram\", \"discord\", \"slack\" or \"webhook\"."
          },
          "name": {
            "type": "string"
          },
          "events": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "What it gets: \"deploy_failed\", \"server_offline\" (and back online), \"server_pressure\" (low on disk space or memory, and fine again), \"backup_failed\" and \"certificate\" (expiring, or couldn't renew). All of them when omitted."
          },
          "webhookUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "Discord's or Slack's webhook URL, or your own (https, or http to a private network address)."
          },
          "token": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Telegram bot's token, from @BotFather."
          },
          "chatId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Telegram chat: its id (negative for groups and channels) or a public channel's @name."
          },
          "secret": {
            "type": [
              "string",
              "null"
            ],
            "description": "A webhook's signing secret: each request then has `X-Pyo-Signature`, HMAC-SHA256 of \"<X-Pyo-Timestamp>.<body>\" as \"sha256=<hex>\"."
          }
        },
        "example": {
          "id": "alc_8kq2x7ad",
          "kind": "slack",
          "name": "Ops chat",
          "op": "addAlertChannel",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "id": "alc_8kq2x7ad",
            "kind": "slack",
            "name": "Ops chat",
            "op": "addAlertChannel",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Alerts"
        ]
      },
      "AddCloudServer": {
        "type": "object",
        "required": [
          "teamId",
          "name",
          "location",
          "serverType"
        ],
        "properties": {
          "teamId": {
            "type": "string",
            "description": "The team whose server it is: its cloud provider connection pays."
          },
          "name": {
            "type": "string",
            "description": "Its name in Pyo, on your tailnet and at the provider: lowercase\nletters, digits and dashes."
          },
          "provider": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"hetzner\" (the default)."
          },
          "location": {
            "type": "string",
            "description": "A location's `name` from getCloudOptions (\"fsn1\")."
          },
          "serverType": {
            "type": "string",
            "description": "A server type's `name` from getCloudOptions (\"cx23\")."
          },
          "edgeDomain": {
            "type": [
              "string",
              "null"
            ],
            "description": "A domain whose wildcard points at the server, as for\n`addSandboxServer`."
          },
          "sshKey": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your OpenSSH public key, to sign in to it over your tailnet."
          },
          "confirm": {
            "type": "boolean",
            "description": "Without it the answer is 409 with the monthly price."
          }
        },
        "additionalProperties": false
      },
      "AddDatabase": {
        "type": "object",
        "description": "A database to back up.",
        "required": [
          "teamId",
          "name",
          "engine",
          "clusterId",
          "host",
          "port",
          "adminUser",
          "adminPassword",
          "enabled",
          "schedule",
          "hour",
          "keep"
        ],
        "properties": {
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "A name for it, unique in the team."
          },
          "engine": {
            "type": "string",
            "description": "\"postgres\", \"mysql\", \"mariadb\", \"mongo\" or \"redis\"."
          },
          "clusterId": {
            "type": "string",
            "description": "The cluster that reaches it and runs its backups."
          },
          "serviceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Pyo service it is, if it is one."
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "database": {
            "type": "string",
            "description": "The database to back up. Not needed for Redis."
          },
          "adminUser": {
            "type": "string",
            "description": "A login allowed to create users: Pyo makes a backup user with it and doesn't keep it."
          },
          "adminPassword": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "schedule": {
            "type": "string",
            "description": "\"daily\" or \"weekly\"."
          },
          "hour": {
            "type": "integer",
            "format": "int32",
            "description": "The hour of day it runs, 0 to 23 (UTC).",
            "minimum": 0
          },
          "keep": {
            "type": "integer",
            "format": "int32",
            "description": "How many backups to keep, 1 to 365.",
            "minimum": 0
          }
        }
      },
      "AddFirewallRuleOp": {
        "type": "object",
        "title": "Add firewall rule",
        "description": "Add an access rule to the end of a service's firewall. Allow and block rules are checked in order, and the first match decides. With no match, the client gets in. Rate limit rules then apply to websites, and each matching one counts the request, per client address and per server.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "serviceId",
          "action"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "addFirewallRule"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `fwr_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "serviceId": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "description": "\"allow\", \"block\" or \"rateLimit\"."
          },
          "operator": {
            "type": "string",
            "description": "\"in\" (the default) or \"notIn\": whether the client's address or country is in `sources`."
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Up to 50 IP addresses and ranges (\"198.51.100.0/24\", \"2001:db8::/32\") or two-letter country codes (\"DE\"), but not both. Presets go with addresses: a CDN's current ranges (\"cloudflare\", \"fastly\", \"bunny\", \"cloudfront\") or your networks (\"tailnet\" for Tailscale's addresses, \"private\" for private networks). None (with \"in\") matches any client. Countries apply to websites only, since TCP and UDP ports never see a client's country. Rate limits take no countries and no CDN, and only one range with \"notIn\"."
          },
          "requests": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "A rate limit's requests from each client address per `per`: 1 to 1,000,000.",
            "minimum": 0
          },
          "per": {
            "type": [
              "string",
              "null"
            ],
            "description": "A rate limit's window: \"second\" or \"minute\" (the default)."
          },
          "note": {
            "type": "string"
          }
        },
        "example": {
          "action": "allow",
          "id": "fwr_8kq2x7ad",
          "op": "addFirewallRule",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "action": "allow",
            "id": "fwr_8kq2x7ad",
            "op": "addFirewallRule",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "AddServer": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "teamId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The team whose server it is. Left out: the installation's, which\nevery team may use (the installation's admin, in the dashboard)."
          },
          "name": {
            "type": "string",
            "description": "Its name in Pyo and on your tailnet: lowercase letters, digits and\ndashes."
          },
          "edgeDomain": {
            "type": [
              "string",
              "null"
            ],
            "description": "A domain whose wildcard points at the server, like sbx.example.com.\nSandbox ports are then served at `<port>-<sandbox>.<domain>` on\nports 80 and 443. Pyo gets the certificate for `*.<domain>` when the\nteam's Cloudflare connection covers the domain\n(`issueSandboxServerCertificate`). Otherwise it goes in\n/etc/pyo-sandbox/edge on the server."
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A new id you choose, for a form that shows the command as it's\nfilled in: `sbs_` then 4 to 40 lowercase letters, digits, dashes or\nunderscores. Ask again with the same id to rename the server or\nchange its edge domain until it joins: its older codes stop\nworking and the answer has a new command. A server added this way\nthat never joins is removed a day after its last code runs out,\nunless `keepSandboxServer` or `resetSandboxServerAccess` kept it."
          }
        },
        "additionalProperties": false
      },
      "AddVolumeOp": {
        "type": "object",
        "title": "Add volume",
        "description": "Add a persistent volume to a service, mounted at `mountPath` from its next deploy.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "serviceId",
          "name",
          "mountPath",
          "sizeGi"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "addVolume"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `vol_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "serviceId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "mountPath": {
            "type": "string"
          },
          "sizeGi": {
            "type": "integer",
            "format": "int64"
          }
        },
        "example": {
          "id": "vol_8kq2x7ad",
          "mountPath": "/data",
          "name": "data",
          "op": "addVolume",
          "serviceId": "svc_8kq2x7ad",
          "sizeGi": 10
        },
        "examples": [
          {
            "id": "vol_8kq2x7ad",
            "mountPath": "/data",
            "name": "data",
            "op": "addVolume",
            "serviceId": "svc_8kq2x7ad",
            "sizeGi": 10
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Volumes"
        ]
      },
      "AddWafRuleOp": {
        "type": "object",
        "title": "Add waf rule",
        "description": "Add a custom web application firewall rule to a service. Custom rules run in order before the OWASP rules, while the service's WAF is on. It goes last in the list.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "serviceId",
          "name",
          "match",
          "conditions",
          "action"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "addWafRule"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `wfr_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "serviceId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Up to 80 characters. Findings show it."
          },
          "match": {
            "type": "string",
            "description": "\"all\" (every condition must match) or \"any\" (one is enough)."
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConditionInput"
            },
            "description": "1 to 10 tests on the request."
          },
          "action": {
            "type": "string",
            "description": "\"block\" (403), \"log\", \"allow\" (skips later rules and the OWASP rules) or \"skipOwasp\" (later custom rules still run)."
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "example": {
          "action": "block",
          "conditions": [],
          "id": "wfr_8kq2x7ad",
          "match": "all",
          "name": "web",
          "op": "addWafRule",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "action": "block",
            "conditions": [],
            "id": "wfr_8kq2x7ad",
            "match": "all",
            "name": "web",
            "op": "addWafRule",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "ApplyBody": {
        "type": "object",
        "required": [
          "teamId",
          "platform",
          "token"
        ],
        "properties": {
          "teamId": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/Platform"
          },
          "url": {
            "type": "string"
          },
          "token": {
            "type": "string",
            "description": "Read again for this request, never stored."
          },
          "team": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vercel only: the team to read (its id or slug)."
          },
          "clusterId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where the services and databases go. The team's default cluster when omitted."
          },
          "items": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The `key`s to import, from the preview. All of them when omitted."
          },
          "deploy": {
            "type": "boolean",
            "description": "Deploy each service once it's made. Off: they're saved, stopped, to deploy when you like."
          }
        }
      },
      "AttachVolumeOp": {
        "type": "object",
        "title": "Attach volume",
        "description": "Attach a detached volume to a service on its cluster, mounted at `mountPath` from the service's next deploy.\nA service of another project (or any project, for a volume whose project was deleted) gets the volume moved into its project first, data, id and backups kept: the volume shows `moving` until its cluster has moved it, then it's attached (or `moveError` says why not). A volume can't move to another cluster.\nA volume on a one-server storage class keeps its data on that server, so the service must be able to run there.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "serviceId",
          "mountPath"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "attachVolume"
            ]
          },
          "id": {
            "type": "string"
          },
          "serviceId": {
            "type": "string"
          },
          "mountPath": {
            "type": "string"
          }
        },
        "example": {
          "id": "vol_8kq2x7ad",
          "mountPath": "/data",
          "op": "attachVolume",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "id": "vol_8kq2x7ad",
            "mountPath": "/data",
            "op": "attachVolume",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Volumes"
        ]
      },
      "Autoscale": {
        "type": "object",
        "description": "Replicas follow CPU use, and memory if `target_memory` is set, between\n`min` and `max`. Targets are average use as a percentage of what each\nreplica reserves. The target that asks for more replicas wins.",
        "required": [
          "min",
          "max",
          "targetCpu"
        ],
        "properties": {
          "min": {
            "type": "integer",
            "format": "int32"
          },
          "max": {
            "type": "integer",
            "format": "int32"
          },
          "targetCpu": {
            "type": "integer",
            "format": "int32"
          },
          "targetMemory": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          }
        }
      },
      "CanAddServer": {
        "type": "object",
        "description": "Whether a team may add a server.",
        "required": [
          "allowed"
        ],
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why not, when it may not. Null when it may."
          }
        }
      },
      "CancelOp": {
        "type": "object",
        "title": "Cancel",
        "description": "Cancel a deployment that hasn't finished.\n\nAPI key access: **deploy**.",
        "required": [
          "op",
          "deploymentId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "cancel"
            ]
          },
          "deploymentId": {
            "type": "string"
          }
        },
        "example": {
          "deploymentId": "dpl_8kq2x7ad",
          "op": "cancel"
        },
        "examples": [
          {
            "deploymentId": "dpl_8kq2x7ad",
            "op": "cancel"
          }
        ],
        "x-pyo-access": "deploy",
        "x-tags": [
          "Deployments"
        ]
      },
      "CancelServerRemovalOp": {
        "type": "object",
        "title": "Cancel server removal",
        "description": "Stop a server removal that's waiting or failed. The server takes work again.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serverId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "cancelServerRemoval"
            ]
          },
          "serverId": {
            "type": "string"
          }
        },
        "example": {
          "op": "cancelServerRemoval",
          "serverId": "srv_8kq2x7ad"
        },
        "examples": [
          {
            "op": "cancelServerRemoval",
            "serverId": "srv_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "CheckSecretImportOp": {
        "type": "object",
        "title": "Check secret import",
        "description": "The key names at a path of a secret store, to check it before importing. Never values.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "storeId",
          "path"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "checkSecretImport"
            ]
          },
          "storeId": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        },
        "example": {
          "op": "checkSecretImport",
          "path": "secret/shop",
          "storeId": "sst_8kq2x7ad"
        },
        "examples": [
          {
            "op": "checkSecretImport",
            "path": "secret/shop",
            "storeId": "sst_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Integrations"
        ]
      },
      "CompleteUpload": {
        "type": "object",
        "description": "The end of an upload in parts.",
        "properties": {
          "sha256": {
            "type": [
              "string",
              "null"
            ],
            "description": "The whole file's SHA-256 (hex), when known: it's checked."
          }
        }
      },
      "ComposePlan": {
        "type": "object",
        "description": "A whole import: what will be created, and what was left out.",
        "required": [
          "project",
          "services",
          "warnings"
        ],
        "properties": {
          "project": {
            "$ref": "#/components/schemas/PlanProject"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanService"
            },
            "description": "In deploy order: a service comes after those it depends on."
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanWarning"
            }
          }
        }
      },
      "ConditionInput": {
        "type": "object",
        "description": "A condition as the API takes it: one `value`, or `values` for \"in\".",
        "required": [
          "field",
          "op"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "What it reads: \"path\", \"query\" (the query string), \"method\", \"host\", \"header\" (by `name`), \"userAgent\", \"cookie\" (by `name`), \"body\", \"ip\" (the visitor's address) or \"country\" (a two-letter code)."
          },
          "name": {
            "type": "string",
            "description": "The header's or cookie's name."
          },
          "op": {
            "type": "string",
            "description": "\"equals\", \"contains\", \"startsWith\", \"endsWith\", \"in\" (one of `values`) or \"regex\" (RE2 syntax). \"ip\" takes \"in\" (addresses and ranges). \"country\" and \"method\" take \"equals\" or \"in\"."
          },
          "value": {
            "type": [
              "string",
              "null"
            ]
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "negate": {
            "type": "boolean",
            "description": "Match when the test fails instead."
          }
        }
      },
      "ConnectCloudflareOp": {
        "type": "object",
        "title": "Connect cloudflare",
        "description": "Connect the team's Cloudflare account, or replace its token. The token needs Zone:Read and DNS:Edit on the zones Pyo may use, and for Cloudflare Tunnel also Cloudflare Tunnel:Edit and SSL and Certificates:Edit. Pyo lists its zones and their accounts, checks it can edit DNS in each (it makes and deletes a TXT record `_pyo-check.<zone>`), checks the tunnel permissions (it makes and deletes a tunnel `pyo-check-<installation id>-<hex>` once per account, and reads each zone's Origin CA certificates), then keeps it encrypted. It's never shown again. Each zone's `tunnel` says whether it can use Cloudflare Tunnel. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId",
          "token"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "connectCloudflare"
            ]
          },
          "teamId": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "example": {
          "op": "connectCloudflare",
          "teamId": "team_8kq2x7ad",
          "token": "example"
        },
        "examples": [
          {
            "op": "connectCloudflare",
            "teamId": "team_8kq2x7ad",
            "token": "example"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Integrations"
        ]
      },
      "ConnectDatabaseOp": {
        "type": "object",
        "title": "Connect database",
        "description": "Connect a service to a database on its cluster. Postgres adds DATABASE_URL (through the pooler when it's on) and DATABASE_URL_DIRECT, plus DATABASE_URL_READ with read replicas. MySQL adds DATABASE_URL (mysql://, to the primary), MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD and MYSQL_DATABASE. KV adds REDIS_URL (which follows failover and sends reads to read replicas), plus KV_REST_API_URL, KV_REST_API_TOKEN and KV_REST_API_READ_ONLY_TOKEN (reads only) with its REST API. With `env`, it adds only those, under the service's own names. With `prefix`, it adds all of them with that prefix, so two databases' variables don't clash. They're secret variables and apply on the service's next deploy.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "serviceId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "connectDatabase"
            ]
          },
          "id": {
            "type": "string"
          },
          "serviceId": {
            "type": "string"
          },
          "env": {
            "type": [
              "object",
              "null"
            ],
            "description": "The service's own names for them: `{\"WORDPRESS_DB_HOST\": \"MYSQL_HOST\", …}`, each a variable the database offers, or several joined by \":\" (`MYSQL_HOST:MYSQL_PORT`). Under its own names, Postgres also offers POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD and POSTGRES_DATABASE (the primary, not the pooler), and KV REDIS_HOST, REDIS_PORT and REDIS_PASSWORD. Kept, so they follow its changes."
          },
          "prefix": {
            "type": [
              "string",
              "null"
            ],
            "description": "Instead of `env`: all its variables, each named with this prefix (`MYSQL` gives MYSQL_DATABASE_URL…), so a service can use databases whose variables would clash."
          }
        },
        "example": {
          "id": "mdb_8kq2x7ad",
          "op": "connectDatabase",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "id": "mdb_8kq2x7ad",
            "op": "connectDatabase",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "Connection": {
        "type": "object",
        "description": "Where a client reaches its sandbox, and with what.",
        "required": [
          "url",
          "sandboxId",
          "token",
          "expiresAt"
        ],
        "properties": {
          "url": {
            "type": "string",
            "description": "Where to call the sandbox's server. On your tailnet: HTTPS on the\nserver's tailnet name. For a server without Tailscale: this Pyo,\nat `/api/sandbox-proxy`, which passes the calls on. Add\n`/v1/sandboxes/{id}/…` either way."
          },
          "sandboxId": {
            "type": "string"
          },
          "token": {
            "type": "string",
            "description": "`Authorization: Bearer <token>` for exec, terminals, files and ports."
          },
          "expiresAt": {
            "type": "integer",
            "format": "int64",
            "description": "When the token runs out (epoch milliseconds). Ask for a new one with\n`createSandboxToken` before.",
            "minimum": 0
          },
          "webUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where its ports' web pages open over HTTPS on your tailnet, like the\ndesktop's screen: `<webUrl>/v1/sandboxes/{id}/web/{port}/`, with the\ntoken once as `?pyo_token=`. The same as `url`. Left out for a\nserver without Tailscale: web pages need the tailnet."
          },
          "proxied": {
            "type": "boolean",
            "description": "The calls go through Pyo, since the server has no Tailscale. Left\nout otherwise."
          }
        }
      },
      "CreateBuilderOp": {
        "type": "object",
        "title": "Create builder",
        "description": "Add a builder that builds images from Git on one of the team's servers (`kind` \"cluster\").\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "name",
          "kind"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createBuilder"
            ]
          },
          "id": {
            "type": "string"
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "\"cluster\"."
          },
          "clusterId": {
            "type": [
              "string",
              "null"
            ]
          },
          "server": {
            "type": [
              "string",
              "null"
            ],
            "description": "The server it runs on."
          }
        },
        "example": {
          "id": "bld_8kq2x7ad",
          "kind": "cluster",
          "name": "builder-1",
          "op": "createBuilder",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "id": "bld_8kq2x7ad",
            "kind": "cluster",
            "name": "builder-1",
            "op": "createBuilder",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Builders"
        ]
      },
      "CreateCloudClusterOp": {
        "type": "object",
        "title": "Create cloud cluster",
        "description": "Add a cluster whose first server Pyo makes at a cloud provider (team admins). pyo-server connects it there the way Add cluster's command does, over your tailnet. Without `confirm` it answers 409 with the monthly price. Confirm that with the user, then send it again with `confirm: true`.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "name",
          "serverId",
          "location",
          "serverType"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createCloudCluster"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `cl_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "The cluster's name. Its first server is named `<name>-1`."
          },
          "serverId": {
            "type": "string",
            "description": "A new id you choose for its server: `cs_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "provider": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"hetzner\" (the default)."
          },
          "location": {
            "type": "string"
          },
          "serverType": {
            "type": "string"
          },
          "sshKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "confirm": {
            "type": "boolean"
          }
        },
        "example": {
          "id": "cl_8kq2x7ad",
          "location": "Singapore, SG",
          "name": "edge",
          "op": "createCloudCluster",
          "serverId": "srv_8kq2x7ad",
          "serverType": "example",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "id": "cl_8kq2x7ad",
            "location": "Singapore, SG",
            "name": "edge",
            "op": "createCloudCluster",
            "serverId": "srv_8kq2x7ad",
            "serverType": "example",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "CreateCloudServerOp": {
        "type": "object",
        "title": "Create cloud server",
        "description": "Make a server at a cloud provider and join it to a cluster over your tailnet (team admins). Read the locations, server types and prices with getCloudOptions first. Its startup script holds only one-time keys: on its first boot it joins your tailnet, then fetches its join details from Pyo over the tailnet. Pyo labels it as this installation's and puts it behind a firewall that allows only the web (80 and 443) and Tailscale. Follow it in `cloudServers` of getState: creating, booting, joining, then ready. Without `confirm` it answers 409 with the monthly price. Confirm that with the user, then send it again with `confirm: true`.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "clusterId",
          "name",
          "location",
          "serverType"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createCloudServer"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `cs_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "clusterId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Its name in the cluster, on your tailnet and at the provider."
          },
          "provider": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"hetzner\" (the default)."
          },
          "location": {
            "type": "string",
            "description": "A location's `name` from getCloudOptions (\"fsn1\")."
          },
          "serverType": {
            "type": "string",
            "description": "A server type's `name` from getCloudOptions (\"cx23\")."
          },
          "builder": {
            "type": "boolean",
            "description": "A build-only server: only Pyo's builder runs on it."
          },
          "sshKey": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your OpenSSH public key, to sign in to it over your tailnet."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "confirm": {
            "type": "boolean"
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "id": "cs_8kq2x7ad",
          "location": "Singapore, SG",
          "name": "web",
          "op": "createCloudServer",
          "serverType": "cx23"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "id": "cs_8kq2x7ad",
            "location": "Singapore, SG",
            "name": "web",
            "op": "createCloudServer",
            "serverType": "cx23"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "CreateClusterOp": {
        "type": "object",
        "title": "Create cluster",
        "description": "Add a cluster. The response has the command that connects its first server: `curl -fsSL <url>/server.sh | bash -s -- connect <token>`, which runs pyo-server with one token. On the machine Pyo itself runs on, it runs connect.sh from Pyo there.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "name",
          "location"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createCluster"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `cl_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "location": {
            "type": "string",
            "description": "Where it is, \"City, CC\" or a region name."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "thisMachine": {
            "type": "boolean",
            "description": "The machine Pyo itself runs on, connected with a command run there."
          },
          "publicApiUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "Connect over the public internet instead of the tailnet: the agent reaches Pyo at this URL (where you use Pyo). Services Pyo builds can't run there (its registry is on the tailnet only)."
          }
        },
        "example": {
          "id": "cl_8kq2x7ad",
          "location": "Singapore, SG",
          "name": "edge",
          "op": "createCluster",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "id": "cl_8kq2x7ad",
            "location": "Singapore, SG",
            "name": "edge",
            "op": "createCluster",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "CreateDatabaseOp": {
        "type": "object",
        "title": "Create database",
        "description": "Create a Postgres, MySQL or KV (Redis-compatible key-value, Valkey) database on one of the team's clusters. The first database on a cluster also sets up databases there, which takes a minute or two. `size` sets CPU and memory per instance: \"small\" (0.25 CPU, 512 MiB, 5 GiB), \"medium\" (0.5, 1 GiB, 10 GiB), \"large\" (1, 2 GiB, 20 GiB) or \"xlarge\" (2, 4 GiB, 50 GiB). MySQL needs 1 GiB, so \"medium\" or larger. `instances` is 1 for a single server with no automatic failover. For high availability, use a primary and 2 to 8 replicas for Postgres (instances 3 to 9), 2 to 4 for KV (3 to 5), or 2 or 4 for MySQL (3 or 5). A replica takes over when the primary's server is lost. MySQL has no pooler, read replicas or REST API. Developers and up.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "clusterId",
          "name",
          "engine",
          "size",
          "instances"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createDatabase"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `mdb_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "teamId": {
            "type": "string"
          },
          "clusterId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Lowercase letters, digits and dashes, unique in the team."
          },
          "engine": {
            "type": "string",
            "description": "\"postgres\", \"mysql\" or \"valkey\"."
          },
          "size": {
            "type": "string",
            "description": "\"small\", \"medium\", \"large\", \"xlarge\", or \"custom\" with `cpuMillis` and `memoryMi`."
          },
          "instances": {
            "type": "integer",
            "format": "int32",
            "description": "1 (a single server), or high availability: 3 to 9 for Postgres (2 to 8 replicas), 3 to 5 for KV (2 to 4), 3 or 5 for MySQL (2 or 4)."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Postgres \"16\", \"17\" or \"18\" (the default). MySQL \"8.4\". Valkey \"8.0\" or \"8.1\" (the default)."
          },
          "storageGi": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Storage per instance in GiB. Defaults to the size's storage."
          },
          "pooler": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Postgres: a connection pooler in front (on by default)."
          },
          "rest": {
            "type": "boolean",
            "description": "KV: a REST API, for serverless and edge code."
          },
          "cpuMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "A custom size's CPU per instance in millicores: 125 to 8000, in steps of 125."
          },
          "memoryMi": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "A custom size's memory per instance in MiB: 512 (Postgres), 1024 (MySQL) or 256 (KV) to 32768, in steps of 256."
          },
          "readReplicas": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Dedicated read replicas: 0 (the default) to 5 for Postgres, or to 4 for KV. MySQL has none."
          },
          "extensions": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Postgres extensions or KV modules to turn on with it, from `listDatabaseExtensions` with `section` \"pyo\" for its engine. For example [\"vector\", \"pg_cron\"] or [\"valkey-json\"]."
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "engine": "postgres",
          "id": "mdb_8kq2x7ad",
          "instances": 1,
          "name": "web",
          "op": "createDatabase",
          "size": "small",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "engine": "postgres",
            "id": "mdb_8kq2x7ad",
            "instances": 1,
            "name": "web",
            "op": "createDatabase",
            "size": "small",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "CreateDeployHookOp": {
        "type": "object",
        "title": "Create deploy hook",
        "description": "Create a deploy hook: a secret URL that deploys a service, or every service of a project.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "projectId",
          "name"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createDeployHook"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `hook_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "projectId": {
            "type": "string"
          },
          "serviceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only this service. Every service of the project when omitted."
          },
          "name": {
            "type": "string"
          }
        },
        "example": {
          "id": "hook_8kq2x7ad",
          "name": "Deploy from CI",
          "op": "createDeployHook",
          "projectId": "prj_8kq2x7ad"
        },
        "examples": [
          {
            "id": "hook_8kq2x7ad",
            "name": "Deploy from CI",
            "op": "createDeployHook",
            "projectId": "prj_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Deployments"
        ]
      },
      "CreateDnsRecordOp": {
        "type": "object",
        "title": "Create dns record",
        "description": "Create a domain's DNS record in the team's Cloudflare account, when one of its connected zones covers the hostname: an A record to the cluster's public IP, with the comment \"Made by Pyo (<installation id>)\". Pyo never overwrites a record. When another A, AAAA or CNAME record has the name, `status` is \"conflict\" and `existing` lists them. Send it again with `replace` to delete those and create Pyo's (team owners and admins). `status` \"exists\" means it already points there. With `proxied`, Cloudflare proxies it once the domain's certificate is issued.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "domainId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createDnsRecord"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "domainId": {
            "type": "string"
          },
          "proxied": {
            "type": "boolean",
            "description": "Proxied by Cloudflare. Off by default."
          },
          "replace": {
            "type": "boolean",
            "description": "Replace the records in the way."
          }
        },
        "example": {
          "domainId": "dom_8kq2x7ad",
          "op": "createDnsRecord",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "domainId": "dom_8kq2x7ad",
            "op": "createDnsRecord",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Domains"
        ]
      },
      "CreateJoinCode": {
        "type": "object",
        "required": [
          "teamId",
          "name"
        ],
        "properties": {
          "teamId": {
            "type": "string",
            "description": "The team whose server it is. With Tailscale on Integrations it\njoins the team's tailnet. Without, it joins with its code alone."
          },
          "name": {
            "type": "string",
            "description": "Its name in Pyo: lowercase letters, digits and dashes. A server of\nthat name that hasn't joined yet gets a new code."
          },
          "edgeDomain": {
            "type": [
              "string",
              "null"
            ],
            "description": "A domain whose wildcard points at the server, as for\n`addSandboxServer`."
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A new id you choose, as for `addSandboxServer`: `sbs_` then 4 to 40\nlowercase letters, digits, dashes or underscores. Ask again with\nthe same id to rename the server or change its edge domain until\nit joins."
          }
        },
        "additionalProperties": false
      },
      "CreateProjectOp": {
        "type": "object",
        "title": "Create project",
        "description": "Create a project in a team.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "name",
          "namespace"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createProject"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `prj_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "namespace": {
            "type": "string",
            "description": "The project's slug, used in service addresses: lowercase letters, digits and dashes, unique in the team."
          },
          "description": {
            "type": "string"
          }
        },
        "example": {
          "id": "prj_8kq2x7ad",
          "name": "Shop",
          "namespace": "shop",
          "op": "createProject",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "id": "prj_8kq2x7ad",
            "name": "Shop",
            "namespace": "shop",
            "op": "createProject",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Projects"
        ]
      },
      "CreateRegistryTokenOp": {
        "type": "object",
        "title": "Create registry token",
        "description": "Create a token to push (or only pull) the team's own images in Pyo registry, as `<host>/<team>/<project>/<service>:<tag>`. These are slugs, and `<host>` is the registry's name on the installation's tailnet (registry.<tailnet>.ts.net). A push needs that project and service to exist. It works over HTTPS from a device on the installation's tailnet. Team owners and admins. The token comes back only once, with the username, address and team path to log in and push with.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "name"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createRegistryToken"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `rtk_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"push\" (push and pull, the default) or \"pull\"."
          },
          "expiresInDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "30 or 90. Never expires when omitted.",
            "minimum": 0
          }
        },
        "example": {
          "id": "rtk_8kq2x7ad",
          "name": "GitHub packages",
          "op": "createRegistryToken",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "id": "rtk_8kq2x7ad",
            "name": "GitHub packages",
            "op": "createRegistryToken",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Images"
        ]
      },
      "CreateSandbox": {
        "type": "object",
        "description": "What a client asks for. Everything but the team and template has a\ndefault.",
        "properties": {
          "teamId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The team the sandbox belongs to. May be left out when the API key\n(or user) has exactly one team."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "A name to tell it apart, like \"checkout tests\": up to 63 letters,\ndigits, spaces, dashes, underscores and dots. It needn't be unique\nand never addresses the sandbox: its id does. A short one like\n\"quiet-river\" when omitted."
          },
          "template": {
            "type": [
              "string",
              "null"
            ],
            "description": "A sandbox template's name (or id): the team's own, else the\ninstallation's. \"base\" (Pyo's built-in Ubuntu 24.04 template) when\nomitted. \"desktop\" is Pyo's built-in desktop with a browser: CDP on\nport 9222 and the screen (voxl) on port 6080. A server that doesn't\nhave Pyo's template yet makes it first, so the first sandbox from it\nthere takes longer."
          },
          "server": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sandbox server to run it on, by id or name: the team's own or\nthe installation's. Pyo picks one when omitted."
          },
          "cpus": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "1 when omitted (2 for \"desktop\").",
            "minimum": 0
          },
          "memoryMib": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "512 when omitted (2048 for \"desktop\").",
            "minimum": 0
          },
          "diskMib": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The writable disk, sparse. 2048 when omitted.",
            "minimum": 0
          },
          "ttl": {
            "type": [
              "string",
              "null"
            ],
            "description": "How long it lives, like \"30m\", \"1h\" or \"7d\", or seconds, up to 365\ndays and the team's longest lifetime. \"none\": it runs until it's\ndeleted, when the team has no limit. 5 minutes when omitted."
          },
          "pauseWhenIdleSecs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Pause after this many seconds without use. Kept for now, acted on in\na later release.",
            "minimum": 0
          },
          "env": {
            "type": "object",
            "description": "Environment variables. Pyo passes them on and keeps only the names.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "network": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"internet\" (the default) or \"none\"."
          },
          "isolation": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"auto\" (the default: Firecracker where the server has KVM, gVisor\nelsewhere) or \"vm\" (Firecracker only)."
          },
          "labels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "projectId": {
            "type": [
              "string",
              "null"
            ],
            "description": "A project of the team, as a label."
          }
        },
        "additionalProperties": false
      },
      "CreateServiceOp": {
        "type": "object",
        "title": "Create service",
        "description": "Create a service and deploy it.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "service",
          "deploymentId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createService"
            ]
          },
          "service": {
            "type": "object",
            "description": "The service, as in the snapshot's services: id (`svc_…`), projectId, clusterId, name, source, ports, env and the rest.\nA template's service records where it came from in `source`: `templateVersion`, `appVersion`, `images` (each Compose service's image, `repository:tag@digest`, by name) and `fields` (the deploy form's values, with a secret one only as `{\"secret\": true, \"set\": …, \"env\": …}`). Saves keep them. Responses add `customized` when its image is no longer the template's.\nIts ports: `name`, `containerPort`, `protocol` (\"HTTP\", \"TCP\" or \"UDP\"), `exposure` (\"internal\", \"http\" for a website, \"nodeport\", or \"loadbalancer\" for a public TCP or UDP port) and `publicPort`.\nA public TCP or UDP port goes through the gateway unless `proxy` is false. Then, for TCP only, it can have `ipFilter` (`{\"mode\": \"allow\" or \"deny\", \"cidrs\": [...]}`), `connectionLimit` (open connections on the port, from everyone together), `sendProxyProtocol` (\"V1\" or \"V2\", to the service) and `acceptProxyProtocol` (read the visitor's address from a header sent by a load balancer in front, while connections without one still work). Ports 22, 53, 80, 443 and a few others can't be public. Each public port belongs to one service on its cluster.\nIts `healthCheck`, which says when a replica is ready: `type` (\"http\" for a request to `path` on `port` answered with 2xx or 3xx, \"tcp\" for `port` accepting connections, \"exec\" to run `command`, or \"none\" so deploys don't wait for it), `initialDelaySeconds` and `periodSeconds`. With `auto` (\"default\" or \"static\") Pyo picks it from what each build finds: a static site or single-page app gets an HTTP check of `/`. A check without `auto` is kept as it is.\nA Git `source` has `buildArgs` (`[{\"key\": …, \"value\": …}]`), used by its next build: Dockerfile build arguments, or Railpack settings such as `RAILPACK_BUILD_CMD`. They can end up in the image, so no secrets.\nIts `serveAs`, for a build Pyo detects as a static site: \"static\" (the default) serves the build's output as static files from the cluster's shared static server, \"service\" runs it as a service of its own. Takes effect with the next deploy.\nIts `domains`: `id`, `hostname`, `portName` (the HTTP port it routes to), `tlsMode`, `redirectHttps`, and its rules in Pyo Gateway. `redirects` (at most 15): `[{\"path\": \"/old\", \"toHost\": …, \"toPath\": \"/new\", \"status\": 301 or 302, \"keepPath\": true}]`, each sending requests under `path` to another hostname or path, query kept. A domain without a `portName` only redirects, with a redirect of \"/\" (like www.example.com to example.com). `headers`: `{\"response\": {\"set\": [{\"name\": …, \"value\": …}], \"remove\": [names]}, \"request\": {…}}`, at most 16 per list. Hop-by-hop headers, `Host`, `X-Forwarded-*`, `X-Real-Ip`, `X-Envoy-*`, `Cf-*` and `X-Pyo-*` can't be changed. `path` (like \"/api\") routes only that path of the hostname, and `stripPrefix` sends it to the service without the prefix: services of one team on one cluster can share a hostname by path, and the longest path wins. The first entry for a hostname holds it (its DNS record, certificate, tunnel, redirects and HTTPS settings). The others show `\"primary\": false` and follow it. Rules go live in place.\nIts `placement`, where it runs: `{\"servers\": [...], \"tags\": [...]}` runs it only on the servers named and on every server with one of the tags, tagged now or later. Absent or null: any server of its cluster. A service with a volume keeps its volume's server, and one with a GPU needs a GPU server. A change goes live without a deploy. The older `serverTags` is read as its tags."
          },
          "deploymentId": {
            "type": "string",
            "description": "A new id you choose for its first deployment: `dpl_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "volumes": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Volumes to create with it."
          },
          "databases": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Databases to connect it to before its first deploy, as `connectDatabase` does: each `{\"id\": \"mdb_…\", \"env\": {\"WORDPRESS_DB_HOST\": \"MYSQL_HOST\", …}}` (`env` optional)."
          },
          "confirm": {
            "type": "boolean",
            "description": "Go ahead with a very large replica change: without it, one that goes to 20 or more replicas and to more than 10 times what the service had, or more than twice what its servers have room for, is refused with 409 and `needsConfirm: true`. Ask the user before sending it."
          },
          "uploadId": {
            "type": [
              "string",
              "null"
            ],
            "description": "A folder uploaded with `createSourceUpload`, for a service whose `source` is `{\"type\": \"upload\"}` (built from a folder with `pyo deploy`): its first deployment builds it."
          }
        },
        "example": {
          "deploymentId": "dpl_8kq2x7ad",
          "op": "createService",
          "service": {
            "clusterId": "cl_8kq2x7ad",
            "domains": [],
            "env": [],
            "id": "svc_8kq2x7ad",
            "name": "web",
            "ports": [
              {
                "containerPort": 80,
                "exposure": "http",
                "name": "http",
                "protocol": "TCP"
              },
              {
                "containerPort": 6379,
                "exposure": "loadbalancer",
                "ipFilter": {
                  "cidrs": [
                    "203.0.113.0/24"
                  ],
                  "mode": "allow"
                },
                "name": "redis",
                "protocol": "TCP",
                "proxy": true,
                "publicPort": 6379
              }
            ],
            "projectId": "prj_8kq2x7ad",
            "replicas": 2,
            "source": {
              "image": "nginx:1.29",
              "type": "image"
            }
          }
        },
        "examples": [
          {
            "deploymentId": "dpl_8kq2x7ad",
            "op": "createService",
            "service": {
              "clusterId": "cl_8kq2x7ad",
              "domains": [],
              "env": [],
              "id": "svc_8kq2x7ad",
              "name": "web",
              "ports": [
                {
                  "containerPort": 80,
                  "exposure": "http",
                  "name": "http",
                  "protocol": "TCP"
                },
                {
                  "containerPort": 6379,
                  "exposure": "loadbalancer",
                  "ipFilter": {
                    "cidrs": [
                      "203.0.113.0/24"
                    ],
                    "mode": "allow"
                  },
                  "name": "redis",
                  "protocol": "TCP",
                  "proxy": true,
                  "publicPort": 6379
                }
              ],
              "projectId": "prj_8kq2x7ad",
              "replicas": 2,
              "source": {
                "image": "nginx:1.29",
                "type": "image"
              }
            }
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Services"
        ]
      },
      "CreateTeamOp": {
        "type": "object",
        "title": "Create team",
        "description": "Create a team. You become its owner.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "name"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "createTeam"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `team_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "example": {
          "id": "team_8kq2x7ad",
          "name": "Acme",
          "op": "createTeam"
        },
        "examples": [
          {
            "id": "team_8kq2x7ad",
            "name": "Acme",
            "op": "createTeam"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "CreateTemplate": {
        "type": "object",
        "required": [
          "name",
          "image"
        ],
        "properties": {
          "teamId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The team whose template it is. Left out: the installation's (its\nadmin, in the dashboard)."
          },
          "name": {
            "type": "string",
            "description": "Lowercase letters, digits, dashes, dots and underscores, like\n\"node-22\"."
          },
          "image": {
            "type": "string",
            "description": "The OCI image it's made from, like \"node:22\", or an image in Pyo's\nregistry, like \"registry.<tailnet>.ts.net/acme/app/api:1\"."
          }
        },
        "additionalProperties": false
      },
      "DeleteCloudServerOp": {
        "type": "object",
        "title": "Delete cloud server",
        "description": "Delete a server Pyo made at a cloud provider (team admins): its services move off it, it leaves the cluster and your tailnet, then it's deleted at the provider. Only servers with this installation's label are ever deleted there. A cluster's first server goes once the cluster is removed. Without `confirm` it answers 409 with the monthly cost that stops. Confirm that with the user, then send it again with `confirm: true`.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deleteCloudServer"
            ]
          },
          "id": {
            "type": "string",
            "description": "The cloud server's id (`cs_…`), from `cloudServers` in getState."
          },
          "confirm": {
            "type": "boolean"
          }
        },
        "example": {
          "confirm": true,
          "id": "cs_8kq2x7ad",
          "op": "deleteCloudServer"
        },
        "examples": [
          {
            "confirm": true,
            "id": "cs_8kq2x7ad",
            "op": "deleteCloudServer"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "DeleteDatabaseBackupOp": {
        "type": "object",
        "title": "Delete database backup",
        "description": "Stop backing up a database. Its existing backups stay in storage.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deleteDatabaseBackup"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "db_8kq2x7ad",
          "op": "deleteDatabaseBackup"
        },
        "examples": [
          {
            "id": "db_8kq2x7ad",
            "op": "deleteDatabaseBackup"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "DeleteDatabaseOp": {
        "type": "object",
        "title": "Delete database",
        "description": "Delete a database and its data. Refused while deletion protection is on or a service is connected. Owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deleteDatabase"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "mdb_8kq2x7ad",
          "op": "deleteDatabase"
        },
        "examples": [
          {
            "id": "mdb_8kq2x7ad",
            "op": "deleteDatabase"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "DeleteDnsRecordOp": {
        "type": "object",
        "title": "Delete dns record",
        "description": "Delete the DNS record Pyo made for a domain in Cloudflare. Only a record Pyo made, still with its comment, is deleted. Refused while other paths of the hostname still use it. Remove the domain after this.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "domainId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deleteDnsRecord"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "domainId": {
            "type": "string"
          }
        },
        "example": {
          "domainId": "dom_8kq2x7ad",
          "op": "deleteDnsRecord",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "domainId": "dom_8kq2x7ad",
            "op": "deleteDnsRecord",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Domains"
        ]
      },
      "DeletePreviewOp": {
        "type": "object",
        "title": "Delete preview",
        "description": "Remove a pull request's preview of a service now. The next push to the pull request brings it back.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deletePreview"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "pvw_8kq2x7ad",
          "op": "deletePreview"
        },
        "examples": [
          {
            "id": "pvw_8kq2x7ad",
            "op": "deletePreview"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Deployments"
        ]
      },
      "DeleteProjectOp": {
        "type": "object",
        "title": "Delete project",
        "description": "Delete a project and its services. Its volumes are kept, detached, unless `deleteVolumes`.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deleteProject"
            ]
          },
          "id": {
            "type": "string"
          },
          "deleteVolumes": {
            "type": "boolean",
            "description": "Delete its volumes and their data too, for good. Admins only."
          }
        },
        "example": {
          "deleteVolumes": true,
          "id": "prj_8kq2x7ad",
          "op": "deleteProject"
        },
        "examples": [
          {
            "deleteVolumes": true,
            "id": "prj_8kq2x7ad",
            "op": "deleteProject"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Projects"
        ]
      },
      "DeleteServiceOp": {
        "type": "object",
        "title": "Delete service",
        "description": "Delete a service and stop it everywhere. Its volumes are kept, detached, unless `deleteVolumes`.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deleteService"
            ]
          },
          "id": {
            "type": "string"
          },
          "deleteVolumes": {
            "type": "boolean",
            "description": "Delete its volumes and their data too, for good, once the service is gone. Admins only."
          }
        },
        "example": {
          "deleteVolumes": true,
          "id": "svc_8kq2x7ad",
          "op": "deleteService"
        },
        "examples": [
          {
            "deleteVolumes": true,
            "id": "svc_8kq2x7ad",
            "op": "deleteService"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Services"
        ]
      },
      "DeleteTeamOp": {
        "type": "object",
        "title": "Delete team",
        "description": "Delete a team and everything in it. Owners only.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deleteTeam"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "team_8kq2x7ad",
          "op": "deleteTeam"
        },
        "examples": [
          {
            "id": "team_8kq2x7ad",
            "op": "deleteTeam"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "DeleteVolumeOp": {
        "type": "object",
        "title": "Delete volume",
        "description": "Delete a detached volume and its data, for good. Admins only.\nThe volume stays listed, being deleted, until its cluster confirms. Also deletes a volume Pyo has no record of, listed in its cluster's `strayVolumes`: pass that `volumeId` as `id`, with `clusterId`.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deleteVolume"
            ]
          },
          "id": {
            "type": "string"
          },
          "clusterId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only for a volume from a cluster's `strayVolumes`."
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "id": "vol_8kq2x7ad",
          "op": "deleteVolume"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "id": "vol_8kq2x7ad",
            "op": "deleteVolume"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Volumes"
        ]
      },
      "DeployOp": {
        "type": "object",
        "title": "Deploy",
        "description": "Deploy a service, roll back to an earlier deployment, or retry a failed one.\n\nAPI key access: **deploy**.",
        "required": [
          "op",
          "serviceId",
          "deploymentId",
          "trigger"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "deploy"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "deploymentId": {
            "type": "string",
            "description": "A new id you choose: `dpl_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "trigger": {
            "type": "string",
            "description": "What started it, shown in the history: \"manual\" (also for anything else), \"redeploy\", \"rollback\", \"retry\" or \"config_change\"."
          },
          "rollbackOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "The deployment to go back to."
          },
          "retryOf": {
            "type": [
              "string",
              "null"
            ],
            "description": "The failed deployment to try again."
          },
          "uploadId": {
            "type": [
              "string",
              "null"
            ],
            "description": "A folder uploaded with `createSourceUpload` to build and deploy, instead of the service's source. For services built from Git or from a folder."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "A tag (`v1.2.3`) or digest (`sha256:` and 64 hex characters) of the service's own image repository, to deploy and keep as its reference. The repository and registry stay as they are. For services that run an image, and not with `rollbackOf`, `retryOf` or `uploadId`. Deploy access is enough."
          }
        },
        "example": {
          "deploymentId": "dpl_8kq2x7ad",
          "op": "deploy",
          "serviceId": "svc_8kq2x7ad",
          "trigger": "manual"
        },
        "examples": [
          {
            "deploymentId": "dpl_8kq2x7ad",
            "op": "deploy",
            "serviceId": "svc_8kq2x7ad",
            "trigger": "manual"
          }
        ],
        "x-pyo-access": "deploy",
        "x-tags": [
          "Deployments"
        ]
      },
      "DetachVolumeOp": {
        "type": "object",
        "title": "Detach volume",
        "description": "Detach a volume from its service: unmounted from the next deploy. The volume and its data stay, to attach again or delete.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "detachVolume"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "vol_8kq2x7ad",
          "op": "detachVolume"
        },
        "examples": [
          {
            "id": "vol_8kq2x7ad",
            "op": "detachVolume"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Volumes"
        ]
      },
      "DiscardClusterDraftOp": {
        "type": "object",
        "title": "Discard cluster draft",
        "description": "Discard a cluster that was added but never connected.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "discardClusterDraft"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "cl_8kq2x7ad",
          "op": "discardClusterDraft"
        },
        "examples": [
          {
            "id": "cl_8kq2x7ad",
            "op": "discardClusterDraft"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "DisconnectDatabaseOp": {
        "type": "object",
        "title": "Disconnect database",
        "description": "Disconnect a service from a database: removes the variables it added (on the next deploy).\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "serviceId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "disconnectDatabase"
            ]
          },
          "id": {
            "type": "string"
          },
          "serviceId": {
            "type": "string"
          }
        },
        "example": {
          "id": "mdb_8kq2x7ad",
          "op": "disconnectDatabase",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "id": "mdb_8kq2x7ad",
            "op": "disconnectDatabase",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "EdgeRequest": {
        "type": "object",
        "properties": {
          "teamId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The team whose Cloudflare connection to use, for one of the\ninstallation's servers. A team's own server always uses its team's."
          }
        },
        "additionalProperties": false
      },
      "ErrorBody": {
        "type": "object",
        "description": "What every error response carries: one sentence to show.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "needsConfirm": {
            "type": "boolean",
            "description": "The change wasn't made: confirm it with the user, then send it again\nwith `confirm: true`."
          }
        }
      },
      "Extend": {
        "type": "object",
        "required": [
          "ttl"
        ],
        "properties": {
          "ttl": {
            "type": "string",
            "description": "The sandbox now ends this long from now, like \"30m\", \"1h\" or \"7d\",\nor seconds. \"none\": it runs until it's deleted. Within the team's\nlongest lifetime."
          }
        },
        "additionalProperties": false
      },
      "GithubInstallUrlOp": {
        "type": "object",
        "title": "GitHub install URL",
        "description": "The GitHub page where a team installs the GitHub App.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "githubInstallUrl"
            ]
          },
          "teamId": {
            "type": "string"
          }
        },
        "example": {
          "op": "githubInstallUrl",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "githubInstallUrl",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "GitHub"
        ]
      },
      "Image": {
        "type": "object",
        "description": "An image repository a team deployed from.",
        "required": [
          "repository",
          "built",
          "pushed",
          "versions"
        ],
        "properties": {
          "repository": {
            "type": "string",
            "description": "Repository without tag or digest, e.g. \"docker.io/library/nginx\"."
          },
          "built": {
            "type": "boolean",
            "description": "Built by Pyo from Git, kept in its registry."
          },
          "pushed": {
            "type": "boolean",
            "description": "Pushed by the team to Pyo registry (`<team>/<project>/<service>`)."
          },
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Version"
            }
          }
        }
      },
      "Images": {
        "type": "object",
        "description": "The team's images.",
        "required": [
          "images"
        ],
        "properties": {
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Image"
            }
          }
        }
      },
      "ImportComposeOp": {
        "type": "object",
        "title": "Import Docker Compose",
        "description": "Create a project and its services from a Docker Compose plan (from `POST /compose/preview`, edited if you like), and deploy them in order.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId",
          "plan"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "importCompose"
            ]
          },
          "teamId": {
            "type": "string"
          },
          "clusterId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where they run. The team's default cluster when omitted."
          },
          "projectId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Add them to this project instead of creating one."
          },
          "plan": {
            "$ref": "#/components/schemas/ComposePlan"
          }
        },
        "example": {
          "op": "importCompose",
          "plan": {
            "project": {
              "file": "compose.yaml",
              "name": "Shop",
              "namespace": "shop"
            },
            "services": [],
            "warnings": []
          },
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "importCompose",
            "plan": {
              "project": {
                "file": "compose.yaml",
                "name": "Shop",
                "namespace": "shop"
              },
              "services": [],
              "warnings": []
            },
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Projects"
        ]
      },
      "ImportConnect": {
        "type": "object",
        "description": "A database of the import a service gets connected to.",
        "required": [
          "database",
          "env"
        ],
        "properties": {
          "database": {
            "type": "string",
            "description": "The database's `key` in this plan."
          },
          "env": {
            "type": "object",
            "description": "The service's variables that point at it, each with the database's\nvariable it becomes, as `connectDatabase` maps them:\n`{\"DATABASE_URL\": \"DATABASE_URL\", \"PGHOST\": \"POSTGRES_HOST\"}`.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ImportConnected": {
        "type": "object",
        "description": "A database Pyo connected a service to, in place of the variables that\npointed at the old one.",
        "required": [
          "database",
          "databaseId",
          "variables"
        ],
        "properties": {
          "database": {
            "type": "string",
            "description": "The database's name in Pyo."
          },
          "databaseId": {
            "type": "string"
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The service's variables it set."
          }
        }
      },
      "ImportDatabase": {
        "type": "object",
        "description": "One of their databases.",
        "required": [
          "key",
          "sourceName",
          "name",
          "engine",
          "action",
          "warnings"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "\"db:<id there>\"."
          },
          "sourceName": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Its name in Pyo."
          },
          "engine": {
            "type": "string",
            "description": "Its engine there: \"postgres\", \"mysql\", \"mariadb\", \"mongodb\", \"redis\", \"keydb\", \"dragonfly\", \"clickhouse\" or \"libsql\"."
          },
          "image": {
            "type": "string",
            "description": "Its image there."
          },
          "target": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pyo's engine for it: \"postgres\", \"mysql\" or \"valkey\" (KV). None when Pyo has none."
          },
          "action": {
            "type": "string",
            "description": "\"import\" (made and its data copied), \"create\" (made empty) or \"manual\" (left for you)."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "existingId": {
            "type": [
              "string",
              "null"
            ],
            "description": "A database of the team's with its name already."
          }
        }
      },
      "ImportDomain": {
        "type": "object",
        "required": [
          "hostname",
          "portName"
        ],
        "properties": {
          "service": {
            "type": "string",
            "description": "In a stack: the Compose service it's for."
          },
          "hostname": {
            "type": "string"
          },
          "portName": {
            "type": "string",
            "description": "The service's HTTP port it routes to."
          }
        }
      },
      "ImportItem": {
        "type": "object",
        "description": "One thing an import makes, listed once the platform is read.",
        "required": [
          "key",
          "name",
          "kind"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "\"service\", \"stack\" or \"database\"."
          }
        }
      },
      "ImportPlan": {
        "type": "object",
        "description": "What importing would create, project by project.",
        "required": [
          "platform",
          "host",
          "projects",
          "warnings"
        ],
        "properties": {
          "platform": {
            "type": "string",
            "description": "\"coolify\", \"dokploy\", \"railway\" or \"vercel\"."
          },
          "host": {
            "type": "string",
            "description": "The platform's host, as given (railway.com or vercel.com for those)."
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportProject"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "About the whole import, e.g. a token that can't read variables' values."
          }
        }
      },
      "ImportProject": {
        "type": "object",
        "description": "A project there (in Coolify, one of its environments) and what's in it.",
        "required": [
          "key",
          "name",
          "services",
          "stacks",
          "databases"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Its id there."
          },
          "name": {
            "type": "string",
            "description": "The Pyo project's name."
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportService"
            }
          },
          "stacks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportStack"
            },
            "description": "Compose stacks there: each becomes a project of its own, as Pyo's\nCompose import makes one."
          },
          "databases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportDatabase"
            },
            "description": "Databases belong to the team in Pyo, not to a project."
          },
          "existingProjectId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Pyo project an earlier import made for it."
          }
        }
      },
      "ImportResult": {
        "type": "object",
        "description": "What became of one picked thing.",
        "required": [
          "key",
          "name",
          "state"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "description": "\"created\", \"importing\" (a database whose data is being copied), \"exists\" (an earlier import made it), \"held\" (a service made but not deployed: `message` says why), \"skipped\" (it can't be imported) or \"failed\"."
          },
          "message": {
            "type": "string"
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Pyo service, project or database."
          },
          "projectId": {
            "type": [
              "string",
              "null"
            ]
          },
          "connected": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportConnected"
            },
            "description": "A service: the databases of the import Pyo connected it to."
          }
        }
      },
      "ImportRun": {
        "type": "object",
        "description": "An import, as it runs on the server and once it's done.",
        "required": [
          "id",
          "teamId",
          "platform",
          "status",
          "deploy",
          "items",
          "results",
          "createdBy",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "teamId": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "\"reading\" (the platform), \"importing\", \"done\", \"failed\" (`error` says why) or \"interrupted\" (Pyo restarted during it: import again, what's there is skipped)."
          },
          "deploy": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportItem"
            },
            "description": "What it makes, once the platform is read."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportResult"
            },
            "description": "What became of each item, as each one finishes."
          },
          "error": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix milliseconds."
          },
          "finishedAt": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "ImportService": {
        "type": "object",
        "description": "One of their applications as a Pyo service.",
        "required": [
          "key",
          "sourceName",
          "service",
          "domains",
          "warnings",
          "importable"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "What to pick it by: \"app:<id there>\"."
          },
          "sourceName": {
            "type": "string",
            "description": "Its name there."
          },
          "builder": {
            "type": "string",
            "description": "For a service built from Git: \"dockerfile\", or \"railpack\" (zero config)."
          },
          "service": {
            "$ref": "#/components/schemas/PlanService",
            "description": "The service: its source, ports, variables (no values in a preview), volumes and health check."
          },
          "domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportDomain"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "importable": {
            "type": "boolean",
            "description": "False when it can't be imported (the warnings say why)."
          },
          "existingId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Pyo service an earlier import made from it."
          },
          "connects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportConnect"
            },
            "description": "Databases of this import its variables point at: Pyo connects each\none to it before its first deploy, in place of those variables. One\nthat isn't picked holds its deploy."
          },
          "holds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why Pyo won't deploy it: a variable points at a database Pyo can't\nmatch, or one it doesn't import."
          }
        }
      },
      "ImportStack": {
        "type": "object",
        "description": "A Compose stack there as a Pyo project.",
        "required": [
          "key",
          "sourceName",
          "plan",
          "domains",
          "warnings",
          "importable"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "\"compose:<id there>\"."
          },
          "sourceName": {
            "type": "string"
          },
          "plan": {
            "$ref": "#/components/schemas/ComposePlan"
          },
          "domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportDomain"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "importable": {
            "type": "boolean"
          },
          "existingProjectId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "InviteMemberOp": {
        "type": "object",
        "title": "Invite member",
        "description": "Invite someone to a team by email, as owner, admin, developer or viewer.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "email",
          "role"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "inviteMember"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `mem_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "teamId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "\"owner\", \"admin\", \"developer\" or \"viewer\"."
          }
        },
        "example": {
          "email": "ada@example.com",
          "id": "mem_8kq2x7ad",
          "op": "inviteMember",
          "role": "developer",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "email": "ada@example.com",
            "id": "mem_8kq2x7ad",
            "op": "inviteMember",
            "role": "developer",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "JoinServerOp": {
        "type": "object",
        "title": "Join server",
        "description": "The command that joins a new server to a cluster: `curl -fsSL <url>/server.sh | bash -s -- join <token>`, which runs pyo-server with one token (valid for an hour).\n\nAPI key access: **full**.",
        "required": [
          "op",
          "clusterId",
          "serverName"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "joinServer"
            ]
          },
          "clusterId": {
            "type": "string"
          },
          "serverName": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "op": "joinServer",
          "serverName": "sg-3"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "op": "joinServer",
            "serverName": "sg-3"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "LogLine": {
        "type": "object",
        "required": [
          "at",
          "level",
          "source",
          "message"
        ],
        "properties": {
          "at": {
            "type": "integer",
            "format": "int64",
            "description": "When it was printed, in milliseconds since 1970."
          },
          "level": {
            "type": "string",
            "description": "\"debug\", \"info\", \"warn\" or \"error\"."
          },
          "source": {
            "type": "string",
            "description": "The replica that printed it."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Meta": {
        "type": "object",
        "description": "What this Pyo is.",
        "required": [
          "version",
          "features"
        ],
        "properties": {
          "version": {
            "type": "string",
            "description": "The version of Pyo it runs."
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Features a hosted Pyo turned on. None when self-hosted."
          },
          "publicUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pyo's HTTPS address: on the tailnet (https://pyo.<tailnet>.ts.net), else on its public IP. Null when it has neither."
          }
        }
      },
      "NewDatabase": {
        "type": "object",
        "description": "A new database to import into, as `createDatabase` takes it (the team's\nowners and admins).",
        "required": [
          "id",
          "clusterId",
          "name",
          "size",
          "instances"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "A new id you choose: `mdb_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "clusterId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Lowercase letters, digits and dashes, unique in the team."
          },
          "size": {
            "type": "string",
            "description": "\"small\", \"medium\", \"large\", \"xlarge\", or \"custom\" with `cpuMillis` and `memoryMi`."
          },
          "instances": {
            "type": "integer",
            "format": "int32",
            "description": "1, or high availability as `createDatabase` takes it."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Postgres \"16\", \"17\" or \"18\", by default the newest and never older than the source. MySQL \"8.4\"."
          },
          "storageGi": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "pooler": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Postgres: a connection pooler in front (on by default)."
          },
          "cpuMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "memoryMi": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "readReplicas": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "extensions": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Postgres: more extensions Pyo turns on with it (the source's are turned on anyway)."
          }
        }
      },
      "NewSourceUpload": {
        "type": "object",
        "description": "A folder about to be uploaded.",
        "required": [
          "teamId",
          "size",
          "sha256"
        ],
        "properties": {
          "teamId": {
            "type": "string",
            "description": "The team's id."
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "description": "The archive's size in bytes (a gzipped tar).",
            "minimum": 0
          },
          "sha256": {
            "type": "string",
            "description": "Its SHA-256, in lowercase hex."
          },
          "files": {
            "type": "integer",
            "format": "int32",
            "description": "How many files it holds.",
            "minimum": 0
          },
          "folder": {
            "type": "string",
            "description": "The folder's name, shown with the deployment."
          },
          "machine": {
            "type": "string",
            "description": "The computer's name, shown as \"Uploaded from …\"."
          }
        }
      },
      "NewUpload": {
        "type": "object",
        "description": "A dump about to be uploaded.",
        "required": [
          "teamId",
          "filename",
          "size"
        ],
        "properties": {
          "teamId": {
            "type": "string",
            "description": "The team's id."
          },
          "engine": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"postgres\" or \"mysql\", when known: the file's type is checked for it up front. Else the import says which."
          },
          "filename": {
            "type": "string",
            "description": "The file's name: .sql, .sql.gz, or (Postgres) .dump."
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "description": "Its size in bytes: the file sent must be exactly this.",
            "minimum": 0
          },
          "contentType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its media type, if any. It comes back in `headers`."
          }
        }
      },
      "Op": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CreateTeamOp"
          },
          {
            "$ref": "#/components/schemas/UpdateTeamOp"
          },
          {
            "$ref": "#/components/schemas/DeleteTeamOp"
          },
          {
            "$ref": "#/components/schemas/SetTeamObservabilityOp"
          },
          {
            "$ref": "#/components/schemas/InviteMemberOp"
          },
          {
            "$ref": "#/components/schemas/ResendInviteOp"
          },
          {
            "$ref": "#/components/schemas/SaveTeamBackupSettingsOp"
          },
          {
            "$ref": "#/components/schemas/RemoveTeamBackupSettingsOp"
          },
          {
            "$ref": "#/components/schemas/SetTeamBackupSelectionOp"
          },
          {
            "$ref": "#/components/schemas/RunTeamBackupOp"
          },
          {
            "$ref": "#/components/schemas/CreateDatabaseOp"
          },
          {
            "$ref": "#/components/schemas/SetDatabaseExtensionsOp"
          },
          {
            "$ref": "#/components/schemas/UpdateDatabaseOp"
          },
          {
            "$ref": "#/components/schemas/DeleteDatabaseOp"
          },
          {
            "$ref": "#/components/schemas/ConnectDatabaseOp"
          },
          {
            "$ref": "#/components/schemas/DisconnectDatabaseOp"
          },
          {
            "$ref": "#/components/schemas/RevealDatabasePasswordOp"
          },
          {
            "$ref": "#/components/schemas/SetDatabaseBackupsOp"
          },
          {
            "$ref": "#/components/schemas/RestoreDatabaseOp"
          },
          {
            "$ref": "#/components/schemas/UpdateDatabaseBackupOp"
          },
          {
            "$ref": "#/components/schemas/DeleteDatabaseBackupOp"
          },
          {
            "$ref": "#/components/schemas/RunDatabaseBackupOp"
          },
          {
            "$ref": "#/components/schemas/RevealBackupPasswordOp"
          },
          {
            "$ref": "#/components/schemas/SetObservabilityOp"
          },
          {
            "$ref": "#/components/schemas/UploadCertificateOp"
          },
          {
            "$ref": "#/components/schemas/ReplaceCertificateOp"
          },
          {
            "$ref": "#/components/schemas/RemoveCertificateOp"
          },
          {
            "$ref": "#/components/schemas/SetClusterWebProxyProtocolOp"
          },
          {
            "$ref": "#/components/schemas/SetClusterPublicTrafficOp"
          },
          {
            "$ref": "#/components/schemas/SetClusterFreeDomainAddressOp"
          },
          {
            "$ref": "#/components/schemas/AddFirewallRuleOp"
          },
          {
            "$ref": "#/components/schemas/SetServiceWafOp"
          },
          {
            "$ref": "#/components/schemas/SetServiceBehindCdnOp"
          },
          {
            "$ref": "#/components/schemas/AddWafRuleOp"
          },
          {
            "$ref": "#/components/schemas/UpdateWafRuleOp"
          },
          {
            "$ref": "#/components/schemas/ReorderWafRulesOp"
          },
          {
            "$ref": "#/components/schemas/RemoveWafRuleOp"
          },
          {
            "$ref": "#/components/schemas/UpdateFirewallRuleOp"
          },
          {
            "$ref": "#/components/schemas/ReorderFirewallRulesOp"
          },
          {
            "$ref": "#/components/schemas/RemoveFirewallRuleOp"
          },
          {
            "$ref": "#/components/schemas/GithubInstallUrlOp"
          },
          {
            "$ref": "#/components/schemas/RemoveGithubInstallationOp"
          },
          {
            "$ref": "#/components/schemas/TestGitConnectionOp"
          },
          {
            "$ref": "#/components/schemas/RemoveGitConnectionOp"
          },
          {
            "$ref": "#/components/schemas/CreateDeployHookOp"
          },
          {
            "$ref": "#/components/schemas/RevealDeployHookOp"
          },
          {
            "$ref": "#/components/schemas/RemoveDeployHookOp"
          },
          {
            "$ref": "#/components/schemas/UpdateMemberRoleOp"
          },
          {
            "$ref": "#/components/schemas/RemoveMemberOp"
          },
          {
            "$ref": "#/components/schemas/ResetMemberSignInOp"
          },
          {
            "$ref": "#/components/schemas/CreateProjectOp"
          },
          {
            "$ref": "#/components/schemas/UpdateProjectOp"
          },
          {
            "$ref": "#/components/schemas/DeleteProjectOp"
          },
          {
            "$ref": "#/components/schemas/DeletePreviewOp"
          },
          {
            "$ref": "#/components/schemas/RedeployPreviewOp"
          },
          {
            "$ref": "#/components/schemas/SetProjectIsolationOp"
          },
          {
            "$ref": "#/components/schemas/RotateDataKeyOp"
          },
          {
            "$ref": "#/components/schemas/CreateServiceOp"
          },
          {
            "$ref": "#/components/schemas/SaveServiceOp"
          },
          {
            "$ref": "#/components/schemas/DeleteServiceOp"
          },
          {
            "$ref": "#/components/schemas/DeployOp"
          },
          {
            "$ref": "#/components/schemas/CancelOp"
          },
          {
            "$ref": "#/components/schemas/RestartServiceOp"
          },
          {
            "$ref": "#/components/schemas/StopServiceOp"
          },
          {
            "$ref": "#/components/schemas/ScaleServiceOp"
          },
          {
            "$ref": "#/components/schemas/SaveCronJobOp"
          },
          {
            "$ref": "#/components/schemas/RemoveCronJobOp"
          },
          {
            "$ref": "#/components/schemas/RunCronJobOp"
          },
          {
            "$ref": "#/components/schemas/SetAutoscaleOp"
          },
          {
            "$ref": "#/components/schemas/AddVolumeOp"
          },
          {
            "$ref": "#/components/schemas/DetachVolumeOp"
          },
          {
            "$ref": "#/components/schemas/AttachVolumeOp"
          },
          {
            "$ref": "#/components/schemas/RestoreVolumeOp"
          },
          {
            "$ref": "#/components/schemas/ResizeVolumeOp"
          },
          {
            "$ref": "#/components/schemas/DeleteVolumeOp"
          },
          {
            "$ref": "#/components/schemas/VerifyDomainOp"
          },
          {
            "$ref": "#/components/schemas/RevealSecretOp"
          },
          {
            "$ref": "#/components/schemas/CreateClusterOp"
          },
          {
            "$ref": "#/components/schemas/SetClusterPreviewDomainOp"
          },
          {
            "$ref": "#/components/schemas/UpdateClusterOp"
          },
          {
            "$ref": "#/components/schemas/SetServerTagsOp"
          },
          {
            "$ref": "#/components/schemas/SetServerRegularServicesOp"
          },
          {
            "$ref": "#/components/schemas/RotateAgentTokenOp"
          },
          {
            "$ref": "#/components/schemas/UpdateClusterAgentOp"
          },
          {
            "$ref": "#/components/schemas/DiscardClusterDraftOp"
          },
          {
            "$ref": "#/components/schemas/RemoveClusterOp"
          },
          {
            "$ref": "#/components/schemas/SetServerSchedulableOp"
          },
          {
            "$ref": "#/components/schemas/SetServerMaintenanceOp"
          },
          {
            "$ref": "#/components/schemas/RemoveServerOp"
          },
          {
            "$ref": "#/components/schemas/CancelServerRemovalOp"
          },
          {
            "$ref": "#/components/schemas/JoinServerOp"
          },
          {
            "$ref": "#/components/schemas/SetServerLocationOp"
          },
          {
            "$ref": "#/components/schemas/CreateCloudServerOp"
          },
          {
            "$ref": "#/components/schemas/CreateCloudClusterOp"
          },
          {
            "$ref": "#/components/schemas/DeleteCloudServerOp"
          },
          {
            "$ref": "#/components/schemas/CreateBuilderOp"
          },
          {
            "$ref": "#/components/schemas/RemoveBuilderOp"
          },
          {
            "$ref": "#/components/schemas/RotateBuilderTokenOp"
          },
          {
            "$ref": "#/components/schemas/SaveHetznerOp"
          },
          {
            "$ref": "#/components/schemas/TestHetznerOp"
          },
          {
            "$ref": "#/components/schemas/RemoveHetznerOp"
          },
          {
            "$ref": "#/components/schemas/AddAlertChannelOp"
          },
          {
            "$ref": "#/components/schemas/UpdateAlertChannelOp"
          },
          {
            "$ref": "#/components/schemas/TestAlertChannelOp"
          },
          {
            "$ref": "#/components/schemas/RemoveAlertChannelOp"
          },
          {
            "$ref": "#/components/schemas/CheckSecretImportOp"
          },
          {
            "$ref": "#/components/schemas/SaveRegistryLoginOp"
          },
          {
            "$ref": "#/components/schemas/RemoveRegistryLoginOp"
          },
          {
            "$ref": "#/components/schemas/CreateRegistryTokenOp"
          },
          {
            "$ref": "#/components/schemas/RevokeRegistryTokenOp"
          },
          {
            "$ref": "#/components/schemas/ConnectCloudflareOp"
          },
          {
            "$ref": "#/components/schemas/TestCloudflareOp"
          },
          {
            "$ref": "#/components/schemas/RemoveCloudflareOp"
          },
          {
            "$ref": "#/components/schemas/CreateDnsRecordOp"
          },
          {
            "$ref": "#/components/schemas/DeleteDnsRecordOp"
          },
          {
            "$ref": "#/components/schemas/RemoveDomainOp"
          },
          {
            "$ref": "#/components/schemas/SetClusterTrafficOp"
          },
          {
            "$ref": "#/components/schemas/SetDomainTunnelOp"
          },
          {
            "$ref": "#/components/schemas/RemoveClusterTunnelOp"
          },
          {
            "$ref": "#/components/schemas/SetClusterPathsOp"
          },
          {
            "$ref": "#/components/schemas/SetClusterGatewayOp"
          },
          {
            "$ref": "#/components/schemas/RotateTunnelTokenOp"
          },
          {
            "$ref": "#/components/schemas/ImportComposeOp"
          },
          {
            "$ref": "#/components/schemas/SyncComposeOp"
          }
        ],
        "description": "A change, posted to `/api/v1/ops` as `{\"op\": \"<name>\", …fields}`. The doc\ncomment on each variant is its description in the API reference\n(`cargo run -p pyo-api --bin openapi`), so keep the first line plain.",
        "discriminator": {
          "propertyName": "op",
          "mapping": {
            "addAlertChannel": "#/components/schemas/AddAlertChannelOp",
            "addFirewallRule": "#/components/schemas/AddFirewallRuleOp",
            "addVolume": "#/components/schemas/AddVolumeOp",
            "addWafRule": "#/components/schemas/AddWafRuleOp",
            "attachVolume": "#/components/schemas/AttachVolumeOp",
            "cancel": "#/components/schemas/CancelOp",
            "cancelServerRemoval": "#/components/schemas/CancelServerRemovalOp",
            "checkSecretImport": "#/components/schemas/CheckSecretImportOp",
            "connectCloudflare": "#/components/schemas/ConnectCloudflareOp",
            "connectDatabase": "#/components/schemas/ConnectDatabaseOp",
            "createBuilder": "#/components/schemas/CreateBuilderOp",
            "createCloudCluster": "#/components/schemas/CreateCloudClusterOp",
            "createCloudServer": "#/components/schemas/CreateCloudServerOp",
            "createCluster": "#/components/schemas/CreateClusterOp",
            "createDatabase": "#/components/schemas/CreateDatabaseOp",
            "createDeployHook": "#/components/schemas/CreateDeployHookOp",
            "createDnsRecord": "#/components/schemas/CreateDnsRecordOp",
            "createProject": "#/components/schemas/CreateProjectOp",
            "createRegistryToken": "#/components/schemas/CreateRegistryTokenOp",
            "createService": "#/components/schemas/CreateServiceOp",
            "createTeam": "#/components/schemas/CreateTeamOp",
            "deleteCloudServer": "#/components/schemas/DeleteCloudServerOp",
            "deleteDatabase": "#/components/schemas/DeleteDatabaseOp",
            "deleteDatabaseBackup": "#/components/schemas/DeleteDatabaseBackupOp",
            "deleteDnsRecord": "#/components/schemas/DeleteDnsRecordOp",
            "deletePreview": "#/components/schemas/DeletePreviewOp",
            "deleteProject": "#/components/schemas/DeleteProjectOp",
            "deleteService": "#/components/schemas/DeleteServiceOp",
            "deleteTeam": "#/components/schemas/DeleteTeamOp",
            "deleteVolume": "#/components/schemas/DeleteVolumeOp",
            "deploy": "#/components/schemas/DeployOp",
            "detachVolume": "#/components/schemas/DetachVolumeOp",
            "discardClusterDraft": "#/components/schemas/DiscardClusterDraftOp",
            "disconnectDatabase": "#/components/schemas/DisconnectDatabaseOp",
            "githubInstallUrl": "#/components/schemas/GithubInstallUrlOp",
            "importCompose": "#/components/schemas/ImportComposeOp",
            "inviteMember": "#/components/schemas/InviteMemberOp",
            "joinServer": "#/components/schemas/JoinServerOp",
            "redeployPreview": "#/components/schemas/RedeployPreviewOp",
            "removeAlertChannel": "#/components/schemas/RemoveAlertChannelOp",
            "removeBuilder": "#/components/schemas/RemoveBuilderOp",
            "removeCertificate": "#/components/schemas/RemoveCertificateOp",
            "removeCloudflare": "#/components/schemas/RemoveCloudflareOp",
            "removeCluster": "#/components/schemas/RemoveClusterOp",
            "removeClusterTunnel": "#/components/schemas/RemoveClusterTunnelOp",
            "removeCronJob": "#/components/schemas/RemoveCronJobOp",
            "removeDeployHook": "#/components/schemas/RemoveDeployHookOp",
            "removeDomain": "#/components/schemas/RemoveDomainOp",
            "removeFirewallRule": "#/components/schemas/RemoveFirewallRuleOp",
            "removeGitConnection": "#/components/schemas/RemoveGitConnectionOp",
            "removeGithubInstallation": "#/components/schemas/RemoveGithubInstallationOp",
            "removeHetzner": "#/components/schemas/RemoveHetznerOp",
            "removeMember": "#/components/schemas/RemoveMemberOp",
            "removeRegistryLogin": "#/components/schemas/RemoveRegistryLoginOp",
            "removeServer": "#/components/schemas/RemoveServerOp",
            "removeTeamBackupSettings": "#/components/schemas/RemoveTeamBackupSettingsOp",
            "removeWafRule": "#/components/schemas/RemoveWafRuleOp",
            "reorderFirewallRules": "#/components/schemas/ReorderFirewallRulesOp",
            "reorderWafRules": "#/components/schemas/ReorderWafRulesOp",
            "replaceCertificate": "#/components/schemas/ReplaceCertificateOp",
            "resendInvite": "#/components/schemas/ResendInviteOp",
            "resetMemberSignIn": "#/components/schemas/ResetMemberSignInOp",
            "resizeVolume": "#/components/schemas/ResizeVolumeOp",
            "restartService": "#/components/schemas/RestartServiceOp",
            "restoreDatabase": "#/components/schemas/RestoreDatabaseOp",
            "restoreVolume": "#/components/schemas/RestoreVolumeOp",
            "revealBackupPassword": "#/components/schemas/RevealBackupPasswordOp",
            "revealDatabasePassword": "#/components/schemas/RevealDatabasePasswordOp",
            "revealDeployHook": "#/components/schemas/RevealDeployHookOp",
            "revealSecret": "#/components/schemas/RevealSecretOp",
            "revokeRegistryToken": "#/components/schemas/RevokeRegistryTokenOp",
            "rotateAgentToken": "#/components/schemas/RotateAgentTokenOp",
            "rotateBuilderToken": "#/components/schemas/RotateBuilderTokenOp",
            "rotateDataKey": "#/components/schemas/RotateDataKeyOp",
            "rotateTunnelToken": "#/components/schemas/RotateTunnelTokenOp",
            "runCronJob": "#/components/schemas/RunCronJobOp",
            "runDatabaseBackup": "#/components/schemas/RunDatabaseBackupOp",
            "runTeamBackup": "#/components/schemas/RunTeamBackupOp",
            "saveCronJob": "#/components/schemas/SaveCronJobOp",
            "saveHetzner": "#/components/schemas/SaveHetznerOp",
            "saveRegistryLogin": "#/components/schemas/SaveRegistryLoginOp",
            "saveService": "#/components/schemas/SaveServiceOp",
            "saveTeamBackupSettings": "#/components/schemas/SaveTeamBackupSettingsOp",
            "scaleService": "#/components/schemas/ScaleServiceOp",
            "setAutoscale": "#/components/schemas/SetAutoscaleOp",
            "setClusterFreeDomainAddress": "#/components/schemas/SetClusterFreeDomainAddressOp",
            "setClusterGateway": "#/components/schemas/SetClusterGatewayOp",
            "setClusterPaths": "#/components/schemas/SetClusterPathsOp",
            "setClusterPreviewDomain": "#/components/schemas/SetClusterPreviewDomainOp",
            "setClusterPublicTraffic": "#/components/schemas/SetClusterPublicTrafficOp",
            "setClusterTraffic": "#/components/schemas/SetClusterTrafficOp",
            "setClusterWebProxyProtocol": "#/components/schemas/SetClusterWebProxyProtocolOp",
            "setDatabaseBackups": "#/components/schemas/SetDatabaseBackupsOp",
            "setDatabaseExtensions": "#/components/schemas/SetDatabaseExtensionsOp",
            "setDomainTunnel": "#/components/schemas/SetDomainTunnelOp",
            "setObservability": "#/components/schemas/SetObservabilityOp",
            "setProjectIsolation": "#/components/schemas/SetProjectIsolationOp",
            "setServerLocation": "#/components/schemas/SetServerLocationOp",
            "setServerMaintenance": "#/components/schemas/SetServerMaintenanceOp",
            "setServerRegularServices": "#/components/schemas/SetServerRegularServicesOp",
            "setServerSchedulable": "#/components/schemas/SetServerSchedulableOp",
            "setServerTags": "#/components/schemas/SetServerTagsOp",
            "setServiceBehindCdn": "#/components/schemas/SetServiceBehindCdnOp",
            "setServiceWaf": "#/components/schemas/SetServiceWafOp",
            "setTeamBackupSelection": "#/components/schemas/SetTeamBackupSelectionOp",
            "setTeamObservability": "#/components/schemas/SetTeamObservabilityOp",
            "stopService": "#/components/schemas/StopServiceOp",
            "syncCompose": "#/components/schemas/SyncComposeOp",
            "testAlertChannel": "#/components/schemas/TestAlertChannelOp",
            "testCloudflare": "#/components/schemas/TestCloudflareOp",
            "testGitConnection": "#/components/schemas/TestGitConnectionOp",
            "testHetzner": "#/components/schemas/TestHetznerOp",
            "updateAlertChannel": "#/components/schemas/UpdateAlertChannelOp",
            "updateCluster": "#/components/schemas/UpdateClusterOp",
            "updateClusterAgent": "#/components/schemas/UpdateClusterAgentOp",
            "updateDatabase": "#/components/schemas/UpdateDatabaseOp",
            "updateDatabaseBackup": "#/components/schemas/UpdateDatabaseBackupOp",
            "updateFirewallRule": "#/components/schemas/UpdateFirewallRuleOp",
            "updateMemberRole": "#/components/schemas/UpdateMemberRoleOp",
            "updateProject": "#/components/schemas/UpdateProjectOp",
            "updateTeam": "#/components/schemas/UpdateTeamOp",
            "updateWafRule": "#/components/schemas/UpdateWafRuleOp",
            "uploadCertificate": "#/components/schemas/UploadCertificateOp",
            "verifyDomain": "#/components/schemas/VerifyDomainOp"
          }
        }
      },
      "OpenPort": {
        "type": "object",
        "required": [
          "port"
        ],
        "properties": {
          "port": {
            "type": "integer",
            "format": "int32",
            "description": "The port the sandbox listens on, like 3000.",
            "minimum": 0
          },
          "public": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether anyone can open the URL. A private port needs a sandbox\ntoken. True when left out."
          }
        },
        "additionalProperties": false
      },
      "PlanEnv": {
        "type": "object",
        "required": [
          "key",
          "value"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "secret": {
            "type": "boolean",
            "description": "Sealed like any secret variable, never shown again."
          }
        }
      },
      "PlanPort": {
        "type": "object",
        "required": [
          "name",
          "containerPort",
          "protocol",
          "public"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "containerPort": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "protocol": {
            "type": "string",
            "description": "\"HTTP\", \"TCP\" or \"UDP\"."
          },
          "public": {
            "type": "boolean",
            "description": "Reachable from outside the project."
          },
          "publicPort": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "For a public TCP or UDP port: the port it's reached on.",
            "minimum": 0
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a public HTTP port: the domain it's served on."
          }
        }
      },
      "PlanProject": {
        "type": "object",
        "required": [
          "name",
          "namespace"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "namespace": {
            "type": "string",
            "description": "Its slug, used in service addresses: lowercase letters, digits and dashes."
          },
          "file": {
            "type": "string",
            "description": "The Compose file's name, e.g. \"compose.yaml\". Its services remember\nit, so a later sync finds them."
          }
        }
      },
      "PlanResources": {
        "type": "object",
        "required": [
          "cpuRequest",
          "cpuLimit",
          "memoryRequest",
          "memoryLimit"
        ],
        "properties": {
          "cpuRequest": {
            "type": "integer",
            "format": "int64",
            "description": "Millicores."
          },
          "cpuLimit": {
            "type": "integer",
            "format": "int64"
          },
          "memoryRequest": {
            "type": "integer",
            "format": "int64",
            "description": "MiB."
          },
          "memoryLimit": {
            "type": "integer",
            "format": "int64"
          },
          "gpu": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PlanService": {
        "type": "object",
        "required": [
          "name",
          "composeName",
          "source",
          "ports",
          "env",
          "volumes",
          "healthCheck",
          "replicas",
          "resources",
          "container",
          "dependsOn"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Its name in Pyo, and its address inside the project."
          },
          "composeName": {
            "type": "string",
            "description": "Its name in the Compose file."
          },
          "source": {
            "$ref": "#/components/schemas/PlanSource"
          },
          "ports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanPort"
            }
          },
          "env": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanEnv"
            }
          },
          "volumes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanVolume"
            }
          },
          "healthCheck": {
            "type": "object"
          },
          "replicas": {
            "type": "integer",
            "format": "int32"
          },
          "resources": {
            "$ref": "#/components/schemas/PlanResources"
          },
          "container": {
            "type": "object"
          },
          "dependsOn": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Services it starts after."
          },
          "managed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the file sets, which a sync keeps in line with it: \"source\",\n\"env\", \"ports\", \"volumes\", \"health\", \"replicas\", \"resources.cpuLimit\"\nand the other resources, \"container.command\" and the other container\nsettings, and the `x-pyo` ones (\"domains\", \"behindCdn\", \"placement\",\n\"secrets\"). The rest stays as it is in Pyo."
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`x-pyo.domains`: served on its first web port."
          },
          "behindCdn": {
            "type": [
              "string",
              "null"
            ],
            "description": "`x-pyo.behindCdn`: \"cloudflare\", or none."
          },
          "placement": {
            "type": [
              "object",
              "null"
            ],
            "description": "`x-pyo.placement`: `{\"servers\": [...], \"tags\": [...]}`."
          },
          "secrets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`x-pyo.secrets`: secret variables it needs, by name. Their values\nare set in Pyo, never in the file."
          }
        }
      },
      "PlanSource": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "\"image\", or \"git\" (built from the repository)."
          },
          "image": {
            "type": "string"
          },
          "reference": {
            "type": "string",
            "description": "Tag or digest."
          },
          "repoUrl": {
            "type": "string"
          },
          "branch": {
            "type": "string"
          },
          "buildContext": {
            "type": "string",
            "description": "The build's directory in the repository."
          },
          "dockerfilePath": {
            "type": "string",
            "description": "Relative to the build context."
          },
          "buildArgs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanEnv"
            }
          },
          "installationId": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "private": {
            "type": "boolean"
          }
        }
      },
      "PlanVolume": {
        "type": "object",
        "required": [
          "name",
          "mountPath",
          "sizeGi"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "mountPath": {
            "type": "string"
          },
          "sizeGi": {
            "type": "integer",
            "format": "int64"
          },
          "fromBind": {
            "type": "boolean",
            "description": "Made from a bind mount: it starts empty."
          }
        }
      },
      "PlanWarning": {
        "type": "object",
        "required": [
          "field",
          "message"
        ],
        "properties": {
          "service": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Compose service it's about. None for the whole file."
          },
          "field": {
            "type": "string",
            "description": "The Compose field, e.g. \"volumes\" or \"privileged\"."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Platform": {
        "type": "string",
        "enum": [
          "coolify",
          "dokploy",
          "railway",
          "vercel"
        ]
      },
      "Preview": {
        "type": "object",
        "description": "Whether a site can be shown in a frame.",
        "required": [
          "frameable"
        ],
        "properties": {
          "frameable": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why not: \"private\" (no public domain), \"unreachable\", \"refused\" (it\nforbids framing) or \"error\" (it answered with a server error)."
          }
        }
      },
      "PreviewBody": {
        "type": "object",
        "required": [
          "teamId",
          "platform",
          "token"
        ],
        "properties": {
          "teamId": {
            "type": "string"
          },
          "platform": {
            "$ref": "#/components/schemas/Platform",
            "description": "\"coolify\", \"dokploy\", \"railway\" or \"vercel\"."
          },
          "url": {
            "type": "string",
            "description": "The platform's address, e.g. https://coolify.example.com. Empty for Railway and Vercel: Pyo reads them only from their own API."
          },
          "token": {
            "type": "string",
            "description": "An API token of the platform's: Coolify's with read and read:sensitive, a Dokploy API key, a Railway account, workspace or project token, or a Vercel token. Used for this request only, never stored."
          },
          "team": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vercel only: the team to read (its id or slug). The token's own scope when omitted."
          }
        }
      },
      "RedeployPreviewOp": {
        "type": "object",
        "title": "Redeploy preview",
        "description": "Deploy a pull request's preview again from its head (a failed one tries again, a removed one comes back).\n\nAPI key access: **deploy**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "redeployPreview"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "pvw_8kq2x7ad",
          "op": "redeployPreview"
        },
        "examples": [
          {
            "id": "pvw_8kq2x7ad",
            "op": "redeployPreview"
          }
        ],
        "x-pyo-access": "deploy",
        "x-tags": [
          "Deployments"
        ]
      },
      "RemoveAlertChannelOp": {
        "type": "object",
        "title": "Remove alert channel",
        "description": "Remove an alert channel. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeAlertChannel"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "alc_8kq2x7ad",
          "op": "removeAlertChannel"
        },
        "examples": [
          {
            "id": "alc_8kq2x7ad",
            "op": "removeAlertChannel"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Alerts"
        ]
      },
      "RemoveBuilderOp": {
        "type": "object",
        "title": "Remove builder",
        "description": "Remove a builder.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeBuilder"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "bld_8kq2x7ad",
          "op": "removeBuilder"
        },
        "examples": [
          {
            "id": "bld_8kq2x7ad",
            "op": "removeBuilder"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Builders"
        ]
      },
      "RemoveCertificateOp": {
        "type": "object",
        "title": "Remove certificate",
        "description": "Remove an uploaded certificate no domain uses.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeCertificate"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "crt_8kq2x7ad",
          "op": "removeCertificate"
        },
        "examples": [
          {
            "id": "crt_8kq2x7ad",
            "op": "removeCertificate"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Domains"
        ]
      },
      "RemoveCloudflareOp": {
        "type": "object",
        "title": "Remove cloudflare",
        "description": "Forget the team's Cloudflare token. DNS records Pyo made stay in Cloudflare. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeCloudflare"
            ]
          },
          "teamId": {
            "type": "string"
          }
        },
        "example": {
          "op": "removeCloudflare",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "removeCloudflare",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Integrations"
        ]
      },
      "RemoveClusterOp": {
        "type": "object",
        "title": "Remove cluster",
        "description": "Remove a cluster from Pyo. Its servers keep running.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeCluster"
            ]
          },
          "id": {
            "type": "string"
          },
          "force": {
            "type": "boolean",
            "description": "For a cluster unreachable for 10 minutes, with services on it: Pyo forgets the cluster, its services, databases and volumes. Anything still running there is left alone."
          }
        },
        "example": {
          "force": false,
          "id": "cl_8kq2x7ad",
          "op": "removeCluster"
        },
        "examples": [
          {
            "force": false,
            "id": "cl_8kq2x7ad",
            "op": "removeCluster"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "RemoveClusterTunnelOp": {
        "type": "object",
        "title": "Remove cluster tunnel",
        "description": "Remove a cluster's Cloudflare Tunnel: its routes, the DNS records Pyo made (with `restoreRecords`, the ones they replaced come back), the connector in the cluster, its certificate and the tunnel itself. Pick Public ports or Tailscale only for the cluster first. Team owners and admins. Prefer setClusterPaths.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "clusterId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeClusterTunnel"
            ]
          },
          "clusterId": {
            "type": "string"
          },
          "restoreRecords": {
            "type": "boolean"
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "op": "removeClusterTunnel"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "op": "removeClusterTunnel"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "RemoveCronJobOp": {
        "type": "object",
        "title": "Remove cron job",
        "description": "Remove a cron job from a service.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeCronJob"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "crn_8kq2x7ad",
          "op": "removeCronJob",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "id": "crn_8kq2x7ad",
            "op": "removeCronJob",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Cron jobs"
        ]
      },
      "RemoveDeployHookOp": {
        "type": "object",
        "title": "Remove deploy hook",
        "description": "Remove a deploy hook. Its URL stops working.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeDeployHook"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "hook_8kq2x7ad",
          "op": "removeDeployHook"
        },
        "examples": [
          {
            "id": "hook_8kq2x7ad",
            "op": "removeDeployHook"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Deployments"
        ]
      },
      "RemoveDomainOp": {
        "type": "object",
        "title": "Remove domain",
        "description": "Remove a domain from a service. Traffic to it stops, in place, without a redeploy. A port no other domain uses stops being public. The DNS record Pyo made for it in Cloudflare is deleted too, unless `keepDnsRecord`. Only a record Pyo made, still with its comment, is deleted. For a domain through the Cloudflare Tunnel, `restoreRecords` puts back the records the tunnel replaced (team owners and admins).\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "domainId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeDomain"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "domainId": {
            "type": "string",
            "description": "The domain's `id`, or its hostname."
          },
          "keepDnsRecord": {
            "type": "boolean",
            "description": "Leave the DNS record Pyo made in Cloudflare."
          },
          "restoreRecords": {
            "type": "boolean",
            "description": "Put back the records the tunnel replaced."
          }
        },
        "example": {
          "domainId": "dom_8kq2x7ad",
          "op": "removeDomain",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "domainId": "dom_8kq2x7ad",
            "op": "removeDomain",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Domains"
        ]
      },
      "RemoveFirewallRuleOp": {
        "type": "object",
        "title": "Remove firewall rule",
        "description": "Remove a firewall access rule.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeFirewallRule"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "fwr_8kq2x7ad",
          "op": "removeFirewallRule"
        },
        "examples": [
          {
            "id": "fwr_8kq2x7ad",
            "op": "removeFirewallRule"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "RemoveGitConnectionOp": {
        "type": "object",
        "title": "Remove git connection",
        "description": "Disconnect a Git connection, and remove the webhooks Pyo made. Not\nwhile a service deploys from it. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeGitConnection"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "gitc_8kq2x7ad",
          "op": "removeGitConnection"
        },
        "examples": [
          {
            "id": "gitc_8kq2x7ad",
            "op": "removeGitConnection"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Git providers"
        ]
      },
      "RemoveGithubInstallationOp": {
        "type": "object",
        "title": "Remove GitHub installation",
        "description": "Unlink a GitHub installation from a team.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeGithubInstallation"
            ]
          },
          "teamId": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int64"
          }
        },
        "example": {
          "id": 51234567,
          "op": "removeGithubInstallation",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "id": 51234567,
            "op": "removeGithubInstallation",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "GitHub"
        ]
      },
      "RemoveHetznerOp": {
        "type": "object",
        "title": "Remove hetzner",
        "description": "Forget the team's Hetzner token. Servers Pyo made there keep running.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeHetzner"
            ]
          },
          "teamId": {
            "type": "string"
          }
        },
        "example": {
          "op": "removeHetzner",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "removeHetzner",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Integrations"
        ]
      },
      "RemoveMemberOp": {
        "type": "object",
        "title": "Remove member",
        "description": "Remove a member from a team, or revoke an invite.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeMember"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "mem_8kq2x7ad",
          "op": "removeMember"
        },
        "examples": [
          {
            "id": "mem_8kq2x7ad",
            "op": "removeMember"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "RemoveRegistryLoginOp": {
        "type": "object",
        "title": "Remove registry login",
        "description": "Remove a registry login.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeRegistryLogin"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "rgl_8kq2x7ad",
          "op": "removeRegistryLogin"
        },
        "examples": [
          {
            "id": "rgl_8kq2x7ad",
            "op": "removeRegistryLogin"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Images"
        ]
      },
      "RemoveServerOp": {
        "type": "object",
        "title": "Remove server",
        "description": "Take a server out of its cluster, moving its services off first. `force` removes it at once, for a machine that's gone.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serverId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeServer"
            ]
          },
          "serverId": {
            "type": "string"
          },
          "force": {
            "type": "boolean"
          }
        },
        "example": {
          "op": "removeServer",
          "serverId": "srv_8kq2x7ad"
        },
        "examples": [
          {
            "op": "removeServer",
            "serverId": "srv_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "RemoveTeamBackupSettingsOp": {
        "type": "object",
        "title": "Remove team backup settings",
        "description": "Stop a team's backups.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeTeamBackupSettings"
            ]
          },
          "teamId": {
            "type": "string"
          }
        },
        "example": {
          "op": "removeTeamBackupSettings",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "removeTeamBackupSettings",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Backups"
        ]
      },
      "RemoveWafRuleOp": {
        "type": "object",
        "title": "Remove waf rule",
        "description": "Remove a custom web application firewall rule.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "removeWafRule"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "wfr_8kq2x7ad",
          "op": "removeWafRule"
        },
        "examples": [
          {
            "id": "wfr_8kq2x7ad",
            "op": "removeWafRule"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "Rename": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The new name: up to 63 letters, digits, spaces, dashes, underscores\nand dots. It needn't be unique."
          }
        },
        "additionalProperties": false
      },
      "ReorderFirewallRulesOp": {
        "type": "object",
        "title": "Reorder firewall rules",
        "description": "Put a service's firewall access rules in this order: allow and block rules are checked from the first. List every one of its rules.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "ids"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "reorderFirewallRules"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "ids": [],
          "op": "reorderFirewallRules",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "ids": [],
            "op": "reorderFirewallRules",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "ReorderWafRulesOp": {
        "type": "object",
        "title": "Reorder waf rules",
        "description": "Put a service's custom web application firewall rules in this order. List every one of its rules.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "ids"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "reorderWafRules"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "ids": [],
          "op": "reorderWafRules",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "ids": [],
            "op": "reorderWafRules",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "ReplaceCertificateOp": {
        "type": "object",
        "title": "Replace certificate",
        "description": "Replace a certificate with a renewed one. Services using it switch over in place, without a redeploy.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "certificate",
          "privateKey"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "replaceCertificate"
            ]
          },
          "id": {
            "type": "string"
          },
          "certificate": {
            "type": "string"
          },
          "privateKey": {
            "type": "string"
          }
        },
        "example": {
          "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----",
          "id": "crt_8kq2x7ad",
          "op": "replaceCertificate",
          "privateKey": "-----BEGIN PRIVATE KEY-----\n…\n-----END PRIVATE KEY-----"
        },
        "examples": [
          {
            "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----",
            "id": "crt_8kq2x7ad",
            "op": "replaceCertificate",
            "privateKey": "-----BEGIN PRIVATE KEY-----\n…\n-----END PRIVATE KEY-----"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Domains"
        ]
      },
      "RepoInput": {
        "type": "object",
        "required": [
          "fullName",
          "branch",
          "path"
        ],
        "properties": {
          "fullName": {
            "type": "string",
            "description": "\"owner/repo\"."
          },
          "branch": {
            "type": "string"
          },
          "path": {
            "type": "string",
            "description": "The Compose file's path, e.g. \"compose.yml\" or \"deploy/compose.yml\"."
          }
        }
      },
      "ResendInviteOp": {
        "type": "object",
        "title": "Resend invite",
        "description": "Make a new invite link (the earlier one stops working) and mail it, or with `send: false` only return it to share.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "resendInvite"
            ]
          },
          "id": {
            "type": "string"
          },
          "send": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Mail the new link (default true)."
          }
        },
        "example": {
          "id": "mem_8kq2x7ad",
          "op": "resendInvite",
          "send": true
        },
        "examples": [
          {
            "id": "mem_8kq2x7ad",
            "op": "resendInvite",
            "send": true
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "ResetMemberSignInOp": {
        "type": "object",
        "title": "Reset member sign in",
        "description": "Owners only: a one-time link for a member who lost their password, to choose a new one. It's emailed to them. Without email set up, it's returned to pass on, for an account in this team alone.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "resetMemberSignIn"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "mem_8kq2x7ad",
          "op": "resetMemberSignIn"
        },
        "examples": [
          {
            "id": "mem_8kq2x7ad",
            "op": "resetMemberSignIn"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "ResizeVolumeOp": {
        "type": "object",
        "title": "Resize volume",
        "description": "Grow a volume to `sizeGi` GB (never shrink it). Owners and admins.\nOnly on a storage class that can grow volumes (`allowVolumeExpansion`). A `local-path` volume has no size limit of its own, so there's nothing to grow. The volume shows `resizeTo` until its cluster reports the new size. Some storage classes finish when its service next starts.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "sizeGi"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "resizeVolume"
            ]
          },
          "id": {
            "type": "string"
          },
          "sizeGi": {
            "type": "integer",
            "format": "int64"
          }
        },
        "example": {
          "id": "vol_8kq2x7ad",
          "op": "resizeVolume",
          "sizeGi": 10
        },
        "examples": [
          {
            "id": "vol_8kq2x7ad",
            "op": "resizeVolume",
            "sizeGi": 10
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Volumes"
        ]
      },
      "RestartServiceOp": {
        "type": "object",
        "title": "Restart service",
        "description": "Restart a service's replicas one by one, with the same configuration.\n\nAPI key access: **deploy**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "restartService"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "svc_8kq2x7ad",
          "op": "restartService"
        },
        "examples": [
          {
            "id": "svc_8kq2x7ad",
            "op": "restartService"
          }
        ],
        "x-pyo-access": "deploy",
        "x-tags": [
          "Services"
        ]
      },
      "RestoreDatabaseOp": {
        "type": "object",
        "title": "Restore database",
        "description": "Restore a Postgres or MySQL database into a new one, on the same cluster with the same size and availability: at `targetTime` (RFC 3339, within what its backups cover: from `status.backup.firstRecoverabilityPoint` to now for Postgres, to `status.backup.lastSuccessfulBackup` for MySQL) or the latest when omitted. Developers and up.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "sourceId",
          "name"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "restoreDatabase"
            ]
          },
          "id": {
            "type": "string",
            "description": "The new database's id you choose: `mdb_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "sourceId": {
            "type": "string",
            "description": "The database to restore."
          },
          "name": {
            "type": "string",
            "description": "The new database's name."
          },
          "targetTime": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "id": "mdb_8kq2x7ad",
          "name": "web",
          "op": "restoreDatabase",
          "sourceId": "example"
        },
        "examples": [
          {
            "id": "mdb_8kq2x7ad",
            "name": "web",
            "op": "restoreDatabase",
            "sourceId": "example"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "RestoreVolumeOp": {
        "type": "object",
        "title": "Restore volume",
        "description": "Restore a volume from one of its snapshots (see `listVolumeSnapshots`), replacing its data. Owners and admins.\nIts service stops while the restore runs and starts again afterwards, even when it fails. The snapshot is restored next to the data and swapped in only once complete, so a failed restore leaves the data as it was. The volume needs room for the snapshot while this runs.\nThe volume shows `restore` while it runs, then `restoredAt`, or `restoreError` with why it failed.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "snapshotId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "restoreVolume"
            ]
          },
          "id": {
            "type": "string"
          },
          "snapshotId": {
            "type": "string",
            "description": "The snapshot's `id` (or its first 8 or more characters)."
          }
        },
        "example": {
          "id": "vol_8kq2x7ad",
          "op": "restoreVolume",
          "snapshotId": "example"
        },
        "examples": [
          {
            "id": "vol_8kq2x7ad",
            "op": "restoreVolume",
            "snapshotId": "example"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Volumes"
        ]
      },
      "RevealBackupPasswordOp": {
        "type": "object",
        "title": "Reveal backup password",
        "description": "Show the team's backup repository password, to restore without Pyo. Logged.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "revealBackupPassword"
            ]
          },
          "teamId": {
            "type": "string"
          }
        },
        "example": {
          "op": "revealBackupPassword",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "revealBackupPassword",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Backups"
        ]
      },
      "RevealDatabasePasswordOp": {
        "type": "object",
        "title": "Reveal database password",
        "description": "Show a database's password, and a KV database's REST token and read-only token. Owners and admins. Recorded in the activity log.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "revealDatabasePassword"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "mdb_8kq2x7ad",
          "op": "revealDatabasePassword"
        },
        "examples": [
          {
            "id": "mdb_8kq2x7ad",
            "op": "revealDatabasePassword"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "RevealDeployHookOp": {
        "type": "object",
        "title": "Reveal deploy hook",
        "description": "Show a deploy hook's URL path (its secret token). Developers and up.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "revealDeployHook"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "hook_8kq2x7ad",
          "op": "revealDeployHook"
        },
        "examples": [
          {
            "id": "hook_8kq2x7ad",
            "op": "revealDeployHook"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Deployments"
        ]
      },
      "RevealSecretOp": {
        "type": "object",
        "title": "Reveal secret",
        "description": "Show a secret environment variable's value. Admins only, and logged.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "envId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "revealSecret"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "envId": {
            "type": "string"
          }
        },
        "example": {
          "envId": "env_8kq2x7ad",
          "op": "revealSecret",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "envId": "env_8kq2x7ad",
            "op": "revealSecret",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Services"
        ]
      },
      "RevokeRegistryTokenOp": {
        "type": "object",
        "title": "Revoke registry token",
        "description": "Revoke a Pyo registry token. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "revokeRegistryToken"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "rtk_8kq2x7ad",
          "op": "revokeRegistryToken"
        },
        "examples": [
          {
            "id": "rtk_8kq2x7ad",
            "op": "revokeRegistryToken"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Images"
        ]
      },
      "RotateAgentTokenOp": {
        "type": "object",
        "title": "Rotate agent token",
        "description": "A new connect command for a cluster. The old one stops working.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "rotateAgentToken"
            ]
          },
          "id": {
            "type": "string"
          },
          "thisMachine": {
            "type": "boolean"
          },
          "publicApiUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "As in `createCluster`: over the public internet, at this URL."
          }
        },
        "example": {
          "id": "cl_8kq2x7ad",
          "op": "rotateAgentToken",
          "publicApiUrl": "example",
          "thisMachine": false
        },
        "examples": [
          {
            "id": "cl_8kq2x7ad",
            "op": "rotateAgentToken",
            "publicApiUrl": "example",
            "thisMachine": false
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "RotateBuilderTokenOp": {
        "type": "object",
        "title": "Rotate builder token",
        "description": "A new token for a builder. The old one stops working.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "rotateBuilderToken"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "bld_8kq2x7ad",
          "op": "rotateBuilderToken"
        },
        "examples": [
          {
            "id": "bld_8kq2x7ad",
            "op": "rotateBuilderToken"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Builders"
        ]
      },
      "RotateDataKeyOp": {
        "type": "object",
        "title": "Rotate data key",
        "description": "Give the team a new data key and seal its stored secrets again with it.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "rotateDataKey"
            ]
          },
          "teamId": {
            "type": "string"
          }
        },
        "example": {
          "op": "rotateDataKey",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "rotateDataKey",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "RotateTunnelTokenOp": {
        "type": "object",
        "title": "Rotate tunnel token",
        "description": "Give the cluster's Cloudflare Tunnel a new token and a new certificate. The old token can't connect from then on. Its connectors still connected are cut once the new ones are, or after 5 minutes. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "clusterId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "rotateTunnelToken"
            ]
          },
          "clusterId": {
            "type": "string"
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "op": "rotateTunnelToken"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "op": "rotateTunnelToken"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "RunCronJobOp": {
        "type": "object",
        "title": "Run cron job",
        "description": "Run a cron job now.\n\nAPI key access: **deploy**.",
        "required": [
          "op",
          "serviceId",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "runCronJob"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "crn_8kq2x7ad",
          "op": "runCronJob",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "id": "crn_8kq2x7ad",
            "op": "runCronJob",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "deploy",
        "x-tags": [
          "Cron jobs"
        ]
      },
      "RunDatabaseBackupOp": {
        "type": "object",
        "title": "Run database backup",
        "description": "Back up a database now.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "runDatabaseBackup"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "db_8kq2x7ad",
          "op": "runDatabaseBackup"
        },
        "examples": [
          {
            "id": "db_8kq2x7ad",
            "op": "runDatabaseBackup"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "RunTeamBackupOp": {
        "type": "object",
        "title": "Run team backup",
        "description": "Back up now: one service or volume (by id), or everything selected.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "runTeamBackup"
            ]
          },
          "teamId": {
            "type": "string"
          },
          "target": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "op": "runTeamBackup",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "runTeamBackup",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Backups"
        ]
      },
      "SaveCronJobOp": {
        "type": "object",
        "title": "Save cron job",
        "description": "Add a cron job to a service, or change one (by id).\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "name",
          "schedule",
          "command",
          "paused"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "saveCronJob"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "schedule": {
            "type": "string",
            "description": "Five fields, in UTC: minute, hour, day of month, month, day of week."
          },
          "command": {
            "type": "string",
            "description": "What it runs, through `sh -c`. Empty runs the image's default command."
          },
          "paused": {
            "type": "boolean"
          }
        },
        "example": {
          "command": "python manage.py clearsessions",
          "name": "nightly-cleanup",
          "op": "saveCronJob",
          "paused": false,
          "schedule": "0 3 * * *",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "command": "python manage.py clearsessions",
            "name": "nightly-cleanup",
            "op": "saveCronJob",
            "paused": false,
            "schedule": "0 3 * * *",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Cron jobs"
        ]
      },
      "SaveHetznerOp": {
        "type": "object",
        "title": "Save hetzner",
        "description": "Connect a team to Hetzner Cloud (team admins): a project API token with Read & Write, from the project's Security page. Pyo checks it by listing the locations, and keeps it encrypted. Servers join over your tailnet, so Tailscale comes first.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId",
          "token"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "saveHetzner"
            ]
          },
          "teamId": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "example": {
          "op": "saveHetzner",
          "teamId": "team_8kq2x7ad",
          "token": "example"
        },
        "examples": [
          {
            "op": "saveHetzner",
            "teamId": "team_8kq2x7ad",
            "token": "example"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Integrations"
        ]
      },
      "SaveRegistryLoginOp": {
        "type": "object",
        "title": "Save registry login",
        "description": "Save a login for a private registry, one per host. Pyo checks it with the registry first.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "host",
          "username",
          "password"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "saveRegistryLogin"
            ]
          },
          "id": {
            "type": "string"
          },
          "teamId": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        },
        "example": {
          "host": "ghcr.io",
          "id": "rgl_8kq2x7ad",
          "op": "saveRegistryLogin",
          "password": "a-registry-token",
          "teamId": "team_8kq2x7ad",
          "username": "ci-bot"
        },
        "examples": [
          {
            "host": "ghcr.io",
            "id": "rgl_8kq2x7ad",
            "op": "saveRegistryLogin",
            "password": "a-registry-token",
            "teamId": "team_8kq2x7ad",
            "username": "ci-bot"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Images"
        ]
      },
      "SaveServiceOp": {
        "type": "object",
        "title": "Save service",
        "description": "Save a service's configuration. With `deploymentId`, roll it out too. Changes to its `domains` go live without a deploy once it has been deployed. A variable sent back hidden (`•••`, as reads show it) keeps its saved value. `removeDomain` removes a domain without sending the whole service.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "service"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "saveService"
            ]
          },
          "service": {
            "type": "object",
            "description": "The whole service, as in the snapshot.\nIts ports: `name`, `containerPort`, `protocol` (\"HTTP\", \"TCP\" or \"UDP\"), `exposure` (\"internal\", \"http\" for a website, \"nodeport\", or \"loadbalancer\" for a public TCP or UDP port) and `publicPort`.\nA public TCP or UDP port goes through the gateway unless `proxy` is false. Then, for TCP only, it can have `ipFilter` (`{\"mode\": \"allow\" or \"deny\", \"cidrs\": [...]}`), `connectionLimit` (open connections on the port, from everyone together), `sendProxyProtocol` (\"V1\" or \"V2\", to the service) and `acceptProxyProtocol` (read the visitor's address from a header sent by a load balancer in front, while connections without one still work). Ports 22, 53, 80, 443 and a few others can't be public. Each public port belongs to one service on its cluster.\nIts `healthCheck`, which says when a replica is ready: `type` (\"http\" for a request to `path` on `port` answered with 2xx or 3xx, \"tcp\" for `port` accepting connections, \"exec\" to run `command`, or \"none\" so deploys don't wait for it), `initialDelaySeconds` and `periodSeconds`. With `auto` (\"default\" or \"static\") Pyo picks it from what each build finds: a static site or single-page app gets an HTTP check of `/`. A check without `auto` is kept as it is.\nA Git `source` has `buildArgs` (`[{\"key\": …, \"value\": …}]`), used by its next build: Dockerfile build arguments, or Railpack settings such as `RAILPACK_BUILD_CMD`. They can end up in the image, so no secrets.\nIts `serveAs`, for a build Pyo detects as a static site: \"static\" (the default) serves the build's output as static files from the cluster's shared static server, \"service\" runs it as a service of its own. Takes effect with the next deploy.\nIts `domains`: `id`, `hostname`, `portName` (the HTTP port it routes to), `tlsMode`, `redirectHttps`, and its rules in Pyo Gateway. `redirects` (at most 15): `[{\"path\": \"/old\", \"toHost\": …, \"toPath\": \"/new\", \"status\": 301 or 302, \"keepPath\": true}]`, each sending requests under `path` to another hostname or path, query kept. A domain without a `portName` only redirects, with a redirect of \"/\" (like www.example.com to example.com). `headers`: `{\"response\": {\"set\": [{\"name\": …, \"value\": …}], \"remove\": [names]}, \"request\": {…}}`, at most 16 per list. Hop-by-hop headers, `Host`, `X-Forwarded-*`, `X-Real-Ip`, `X-Envoy-*`, `Cf-*` and `X-Pyo-*` can't be changed. `path` (like \"/api\") routes only that path of the hostname, and `stripPrefix` sends it to the service without the prefix: services of one team on one cluster can share a hostname by path, and the longest path wins. The first entry for a hostname holds it (its DNS record, certificate, tunnel, redirects and HTTPS settings). The others show `\"primary\": false` and follow it. Rules go live in place.\nIts `placement`, where it runs: `{\"servers\": [...], \"tags\": [...]}` runs it only on the servers named and on every server with one of the tags, tagged now or later. Absent or null: any server of its cluster. A service with a volume keeps its volume's server, and one with a GPU needs a GPU server. A change goes live without a deploy. The older `serverTags` is read as its tags."
          },
          "deploymentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirm": {
            "type": "boolean",
            "description": "Go ahead with a very large replica change: without it, one that goes to 20 or more replicas and to more than 10 times what the service had, or more than twice what its servers have room for, is refused with 409 and `needsConfirm: true`. Ask the user before sending it."
          }
        },
        "example": {
          "op": "saveService",
          "service": {
            "clusterId": "cl_8kq2x7ad",
            "domains": [],
            "env": [],
            "id": "svc_8kq2x7ad",
            "name": "web",
            "ports": [
              {
                "containerPort": 80,
                "exposure": "http",
                "name": "http",
                "protocol": "TCP"
              },
              {
                "containerPort": 6379,
                "exposure": "loadbalancer",
                "ipFilter": {
                  "cidrs": [
                    "203.0.113.0/24"
                  ],
                  "mode": "allow"
                },
                "name": "redis",
                "protocol": "TCP",
                "proxy": true,
                "publicPort": 6379
              }
            ],
            "projectId": "prj_8kq2x7ad",
            "replicas": 2,
            "source": {
              "image": "nginx:1.29",
              "type": "image"
            }
          }
        },
        "examples": [
          {
            "op": "saveService",
            "service": {
              "clusterId": "cl_8kq2x7ad",
              "domains": [],
              "env": [],
              "id": "svc_8kq2x7ad",
              "name": "web",
              "ports": [
                {
                  "containerPort": 80,
                  "exposure": "http",
                  "name": "http",
                  "protocol": "TCP"
                },
                {
                  "containerPort": 6379,
                  "exposure": "loadbalancer",
                  "ipFilter": {
                    "cidrs": [
                      "203.0.113.0/24"
                    ],
                    "mode": "allow"
                  },
                  "name": "redis",
                  "protocol": "TCP",
                  "proxy": true,
                  "publicPort": 6379
                }
              ],
              "projectId": "prj_8kq2x7ad",
              "replicas": 2,
              "source": {
                "image": "nginx:1.29",
                "type": "image"
              }
            }
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Services"
        ]
      },
      "SaveTeamBackupSettingsOp": {
        "type": "object",
        "title": "Save team backup settings",
        "description": "Back up a team's volumes and databases: where, how often and how many to keep. A blank secret keeps the saved one.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId",
          "enabled",
          "schedule",
          "hour",
          "keep",
          "endpoint",
          "region",
          "bucket",
          "prefix",
          "accessKey"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "saveTeamBackupSettings"
            ]
          },
          "teamId": {
            "type": "string"
          },
          "destination": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"s3\" (any S3-compatible storage) when given."
          },
          "enabled": {
            "type": "boolean"
          },
          "schedule": {
            "type": "string",
            "description": "\"daily\" or \"weekly\"."
          },
          "hour": {
            "type": "integer",
            "format": "int32",
            "description": "The hour of day it runs, 0 to 23 (UTC).",
            "minimum": 0
          },
          "keep": {
            "type": "integer",
            "format": "int32",
            "description": "How many backups to keep, 1 to 365.",
            "minimum": 0
          },
          "endpoint": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "bucket": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "accessKey": {
            "type": "string"
          },
          "secretKey": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "accessKey": "AKIAEXAMPLE",
          "bucket": "acme-backups",
          "enabled": true,
          "endpoint": "https://s3.eu-central-1.amazonaws.com",
          "hour": 2,
          "keep": 14,
          "op": "saveTeamBackupSettings",
          "prefix": "pyo/",
          "region": "eu-central-1",
          "schedule": "daily",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "accessKey": "AKIAEXAMPLE",
            "bucket": "acme-backups",
            "enabled": true,
            "endpoint": "https://s3.eu-central-1.amazonaws.com",
            "hour": 2,
            "keep": 14,
            "op": "saveTeamBackupSettings",
            "prefix": "pyo/",
            "region": "eu-central-1",
            "schedule": "daily",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Backups"
        ]
      },
      "ScaleServiceOp": {
        "type": "object",
        "title": "Scale service",
        "description": "Change a service's number of replicas without a new deployment: 1 or more, with no maximum. Replicas that don't fit on the servers wait until there's room, and the response's `warning` says so.\n\nAPI key access: **deploy**.",
        "required": [
          "op",
          "id",
          "replicas"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "scaleService"
            ]
          },
          "id": {
            "type": "string"
          },
          "replicas": {
            "type": "integer",
            "format": "int32"
          },
          "confirm": {
            "type": "boolean",
            "description": "Go ahead with a very large replica change: without it, one that goes to 20 or more replicas and to more than 10 times what the service had, or more than twice what its servers have room for, is refused with 409 and `needsConfirm: true`. Ask the user before sending it."
          }
        },
        "example": {
          "id": "svc_8kq2x7ad",
          "op": "scaleService",
          "replicas": 3
        },
        "examples": [
          {
            "id": "svc_8kq2x7ad",
            "op": "scaleService",
            "replicas": 3
          }
        ],
        "x-pyo-access": "deploy",
        "x-tags": [
          "Services"
        ]
      },
      "ServiceLogs": {
        "type": "object",
        "description": "A service's recent output.",
        "required": [
          "logs",
          "fetchedAt"
        ],
        "properties": {
          "logs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogLine"
            },
            "description": "The last lines of each replica (300, or `tail`), oldest first. `source` is the replica."
          },
          "fetchedAt": {
            "type": "integer",
            "format": "int64",
            "description": "When they were read, in milliseconds since 1970."
          }
        }
      },
      "SetAutoscaleOp": {
        "type": "object",
        "title": "Set autoscale",
        "description": "Turn autoscaling on or change it. Null turns it off.\n\nAPI key access: **deploy**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setAutoscale"
            ]
          },
          "id": {
            "type": "string"
          },
          "autoscale": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Autoscale"
              }
            ]
          },
          "confirm": {
            "type": "boolean",
            "description": "Go ahead with a very large replica change: without it, one that goes to 20 or more replicas and to more than 10 times what the service had, or more than twice what its servers have room for, is refused with 409 and `needsConfirm: true`. Ask the user before sending it."
          }
        },
        "example": {
          "autoscale": {
            "max": 5,
            "min": 1,
            "targetCpu": 70,
            "targetMemory": 80
          },
          "confirm": true,
          "id": "svc_8kq2x7ad",
          "op": "setAutoscale"
        },
        "examples": [
          {
            "autoscale": {
              "max": 5,
              "min": 1,
              "targetCpu": 70,
              "targetMemory": 80
            },
            "confirm": true,
            "id": "svc_8kq2x7ad",
            "op": "setAutoscale"
          }
        ],
        "x-pyo-access": "deploy",
        "x-tags": [
          "Services"
        ]
      },
      "SetClusterFreeDomainAddressOp": {
        "type": "object",
        "title": "Set cluster free domain address",
        "description": "Where the cluster's free domains (`<name>.<ip>.nip.io`) point: \"public\" (its public IP, for everyone) or \"tailscale\" (its Tailscale IP, only from the tailnet). With \"tailscale\", services are reachable from your tailnet on ports 80 and 443 whether or not the cluster takes public traffic. Free domains on it move to the new address in place, except ones on the public IP, which stay there while the cluster has one. By default it's public when the cluster takes public traffic and a server has its public IP itself (on a network card or as its ExternalIP), a load balancer gives it one, or its cloud maps one to it and Let's Encrypt reached it there. Behind NAT, it's Tailscale.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "clusterId",
          "address"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setClusterFreeDomainAddress"
            ]
          },
          "clusterId": {
            "type": "string"
          },
          "address": {
            "type": "string"
          }
        },
        "example": {
          "address": "example",
          "clusterId": "cl_8kq2x7ad",
          "op": "setClusterFreeDomainAddress"
        },
        "examples": [
          {
            "address": "example",
            "clusterId": "cl_8kq2x7ad",
            "op": "setClusterFreeDomainAddress"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "SetClusterGatewayOp": {
        "type": "object",
        "title": "Set cluster gateway",
        "description": "A cluster's gateway settings. Unset fields stay as they are. `http3`: HTTP/3 on UDP port 443 next to HTTPS. It needs public ports on and UDP port 443 free on the servers, and the servers' firewalls must let UDP 443 in. Turning it on or off drops open connections on each server's public ports once, one server at a time. `tlsMin`: \"1.2\" or \"1.3\". Changing it drops every open HTTPS connection once. `compression`: Zstd, Brotli and Gzip on services' HTTPS domains. `requestTimeout` (seconds, 1 to 3600, or 0 for no limit) and `idleTimeout` (how long a WebSocket or stream may stay quiet, 60 to 86400 seconds, at least the request timeout): the defaults for services without their own. Compression and the defaults change routes only, without dropping connections. `drops` in the answer says whether open connections drop once. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "clusterId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setClusterGateway"
            ]
          },
          "clusterId": {
            "type": "string"
          },
          "http3": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "compression": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tlsMin": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestTimeout": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "idleTimeout": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "op": "setClusterGateway"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "op": "setClusterGateway"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "SetClusterPathsOp": {
        "type": "object",
        "title": "Set cluster paths",
        "description": "Turn a cluster's traffic paths on or off: public ports 80 and 443 (`public`), Cloudflare Tunnel (`tunnel`, with `defaultDomain` and `accountId` as for setClusterTraffic) and websites on the tailnet (`tailnet`: ts.net names and free domains on the servers' Tailscale addresses; the servers stay on the tailnet). Unset fields stay as they are. At least one path stays on. Each domain takes one path, and a domain whose path is off isn't served. When a path turned off still has domains, nothing changes: `status` is \"confirm\" and `domains` lists them, each with `outcome` \"moves\" or \"stops\". Send it again with `confirm` to go ahead. Turning public ports off with the tunnel on moves the domains in the tunnel's Cloudflare account to the tunnel first (`moveToTunnel`, on by default), and the ports close once every one of them is on it (`status` \"moving\"): its record has moved and Cloudflare has had time to serve it. Published TCP and UDP ports pause for a few seconds when public ports go on or off, as they move between Services. Turning the tunnel off with public ports on switches its domains back first, then removes the tunnel at Cloudflare. `dashboardDrops`: switching Tailnet drops open connections to Pyo's dashboard on the tailnet once (the cluster Pyo runs on, with ts.net names, until its connect command has run for this release). Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "clusterId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setClusterPaths"
            ]
          },
          "clusterId": {
            "type": "string"
          },
          "public": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tunnel": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tailnet": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "publicPorts": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "TCP and UDP ports on the servers while public ports are off."
          },
          "proxyProtocol": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Read the visitor's address from a PROXY protocol header on ports 80 and 443. Saving drops open web connections once."
          },
          "defaultDomain": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountId": {
            "type": [
              "string",
              "null"
            ]
          },
          "moveToTunnel": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "restoreRecords": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "With turning the tunnel off: put back the records its domains replaced. On by default."
          },
          "confirm": {
            "type": "boolean"
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "op": "setClusterPaths"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "op": "setClusterPaths"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "SetClusterPreviewDomainOp": {
        "type": "object",
        "title": "Set cluster preview domain",
        "description": "Set the domain previews on a cluster use (`<service>-pr-<n>.<domain>`, a wildcard record pointing at the cluster), or null for nip.io. Admins only.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setClusterPreviewDomain"
            ]
          },
          "id": {
            "type": "string"
          },
          "domain": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "domain": "example",
          "id": "cl_8kq2x7ad",
          "op": "setClusterPreviewDomain"
        },
        "examples": [
          {
            "domain": "example",
            "id": "cl_8kq2x7ad",
            "op": "setClusterPreviewDomain"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "SetClusterPublicTrafficOp": {
        "type": "object",
        "title": "Set cluster public traffic",
        "description": "Whether a cluster takes public traffic: the gateway answers on every\nserver but build-only ones (ports 80 and 443, and public TCP and UDP\nports through it). Off: services are only reachable inside the cluster. Prefer setClusterPaths.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "clusterId",
          "on"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setClusterPublicTraffic"
            ]
          },
          "clusterId": {
            "type": "string"
          },
          "on": {
            "type": "boolean"
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "on": true,
          "op": "setClusterPublicTraffic"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "on": true,
            "op": "setClusterPublicTraffic"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "SetClusterTrafficOp": {
        "type": "object",
        "title": "Set cluster traffic",
        "description": "How a cluster takes web traffic: \"public\" (ports 80 and 443 on every server but build-only ones), \"tailscale\" (only from the tailnet, or only inside the cluster without Tailscale) or \"tunnel\" (through Cloudflare Tunnel, with no ports 80 and 443 open). For \"tunnel\", the team's Cloudflare token needs Cloudflare Tunnel:Edit and SSL and Certificates:Edit, and the cluster's install must be Pyo's (run its connect command first when it's older). Domains in zones of the tunnel's account move to the tunnel. Those with a DNS record Pyo didn't make wait for `setDomainTunnel` with `replace`. Pyo does the Cloudflare work in the background: the cluster's `tunnel` shows how it's going. Team owners and admins. Prefer setClusterPaths.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "clusterId",
          "mode"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setClusterTraffic"
            ]
          },
          "clusterId": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "defaultDomain": {
            "type": [
              "string",
              "null"
            ],
            "description": "A zone of the token (its apex, like \"example.com\"): services get names under it, and `*.example.com` goes through the tunnel. Optional."
          },
          "accountId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Cloudflare account for the tunnel, when the token's zones are in more than one."
          },
          "portsPublic": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Public TCP and UDP ports stay on the servers in tunnel mode (they don't go through the tunnel). On by default."
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "mode": "example",
          "op": "setClusterTraffic"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "mode": "example",
            "op": "setClusterTraffic"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "SetClusterWebProxyProtocolOp": {
        "type": "object",
        "title": "Set cluster web proxy protocol",
        "description": "Read the visitor's address from a PROXY protocol header on the\ncluster's websites (ports 80 and 443), for a cluster behind another\nload balancer. Connections without one still work. Prefer setClusterPaths.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "clusterId",
          "on"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setClusterWebProxyProtocol"
            ]
          },
          "clusterId": {
            "type": "string"
          },
          "on": {
            "type": "boolean"
          }
        },
        "example": {
          "clusterId": "cl_8kq2x7ad",
          "on": true,
          "op": "setClusterWebProxyProtocol"
        },
        "examples": [
          {
            "clusterId": "cl_8kq2x7ad",
            "on": true,
            "op": "setClusterWebProxyProtocol"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "SetDatabaseBackupsOp": {
        "type": "object",
        "title": "Set database backups",
        "description": "Turn a database's backups on or off, to the team's Backups destination. Postgres: every change archived continuously and a base backup daily, so it can be restored to any moment in the last `retentionDays`. MySQL: a full backup daily with the changes since the last one, so it can be restored to any moment in the last `retentionDays` up to its latest backup. Both are stored in the team's folder of the destination. KV: a snapshot `schedule`d daily or weekly, the last `keep` kept, listed in Backups with the team's other databases. Developers and up.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "enabled"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setDatabaseBackups"
            ]
          },
          "id": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "retentionDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Postgres and MySQL: 1 to 90, 7 by default.",
            "minimum": 0
          },
          "hour": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The hour backups run, 0 to 23 (UTC). Defaults to 3 for Postgres and MySQL, and 2 for KV.",
            "minimum": 0
          },
          "schedule": {
            "type": [
              "string",
              "null"
            ],
            "description": "KV: \"daily\" (default) or \"weekly\"."
          },
          "keep": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "KV: how many snapshots to keep, 1 to 365, 14 by default.",
            "minimum": 0
          }
        },
        "example": {
          "enabled": true,
          "id": "mdb_8kq2x7ad",
          "op": "setDatabaseBackups"
        },
        "examples": [
          {
            "enabled": true,
            "id": "mdb_8kq2x7ad",
            "op": "setDatabaseBackups"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "SetDatabaseExtensionsOp": {
        "type": "object",
        "title": "Set database extensions",
        "description": "Turn a Postgres database's extensions or a KV database's modules on and off. `extensions` is the full list to have on, from `listDatabaseExtensions` with `section` \"pyo\" for its engine. The database's owner adds Postgres's \"additional\" ones with CREATE EXTENSION. Some load a library, which restarts the database (`restart`). With high availability, it restarts one instance at a time and the primary hands over last. Every KV module restarts the database and needs KV 8.1. Turning a Postgres extension off drops it (DROP EXTENSION, without CASCADE). Postgres refuses while other objects depend on it, and the database's `extensions` shows this. Developers and up.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "extensions"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setDatabaseExtensions"
            ]
          },
          "id": {
            "type": "string"
          },
          "extensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "extensions": [],
          "id": "mdb_8kq2x7ad",
          "op": "setDatabaseExtensions"
        },
        "examples": [
          {
            "extensions": [],
            "id": "mdb_8kq2x7ad",
            "op": "setDatabaseExtensions"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "SetDomainTunnelOp": {
        "type": "object",
        "title": "Set domain tunnel",
        "description": "Serve a domain through the cluster's Cloudflare Tunnel (`on`), or move it back. Pyo adds the tunnel's route first, then points the name at the tunnel with a proxied CNAME, so both paths answer while it moves. When records Pyo didn't make have the name, the domain's `dnsRecord.status` turns \"conflict\" and `existing` lists them (at once, in the answer too, when Cloudflare can be asked). Send it again with `replace` to replace them (team owners and admins): Pyo keeps a copy. Moving back with `restore` puts that copy back (team owners and admins), or without one, points the name at the cluster's public IP. A name one level under the tunnel's default domain always goes through the tunnel, so moving it back is refused unless a record it replaced comes back. A new name one level under the default domain gets no record of its own when nothing else at Cloudflare answers for it: the default domain's wildcard record has it, and the answer is `status: \"active\"`. A name that's already only through the tunnel stays that way while its own record is made. After the record moves, both paths stay open until Cloudflare's edge sends the name through the tunnel. With `on` and `finish` (Finish now, team owners and admins), a domain whose record is on the tunnel goes only through the tunnel at once: the direct path closes, and visitors Cloudflare still sends the old way get 404.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "domainId",
          "on"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setDomainTunnel"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "domainId": {
            "type": "string"
          },
          "on": {
            "type": "boolean"
          },
          "replace": {
            "type": "boolean",
            "description": "Replace the records in the way."
          },
          "finish": {
            "type": "boolean",
            "description": "With `on`: Finish now. Close the direct path without waiting for Cloudflare's edge."
          },
          "restore": {
            "type": "boolean",
            "description": "Moving back: put back the records the tunnel replaced. On by default."
          }
        },
        "example": {
          "domainId": "dom_8kq2x7ad",
          "on": true,
          "op": "setDomainTunnel",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "domainId": "dom_8kq2x7ad",
            "on": true,
            "op": "setDomainTunnel",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Domains"
        ]
      },
      "SetObservabilityOp": {
        "type": "object",
        "title": "Set observability",
        "description": "Turn observability (analytics, request logs, firewall and WAF history, usage history) on or off for the whole installation. Only the installation's admin can do this. Off stops storing and showing history and frees its memory. What was stored is kept for when it's back on. Live logs, current usage, deploys and the firewall keep working.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "enabled"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setObservability"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "example": {
          "enabled": true,
          "op": "setObservability"
        },
        "examples": [
          {
            "enabled": true,
            "op": "setObservability"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Observability"
        ]
      },
      "SetProjectIsolationOp": {
        "type": "object",
        "title": "Set project isolation",
        "description": "Isolate a project's network: only its own services and the web server reach them.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "isolate"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setProjectIsolation"
            ]
          },
          "id": {
            "type": "string"
          },
          "isolate": {
            "type": "boolean"
          }
        },
        "example": {
          "id": "prj_8kq2x7ad",
          "isolate": true,
          "op": "setProjectIsolation"
        },
        "examples": [
          {
            "id": "prj_8kq2x7ad",
            "isolate": true,
            "op": "setProjectIsolation"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Projects"
        ]
      },
      "SetServerLocationOp": {
        "type": "object",
        "title": "Set server region",
        "description": "Set a server's region: a name (\"US East\", \"Singapore, SG\"), or \"\" to detect it again.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serverId",
          "location"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setServerLocation"
            ]
          },
          "serverId": {
            "type": "string"
          },
          "location": {
            "type": "string"
          }
        },
        "example": {
          "location": "Singapore, SG",
          "op": "setServerLocation",
          "serverId": "srv_8kq2x7ad"
        },
        "examples": [
          {
            "location": "Singapore, SG",
            "op": "setServerLocation",
            "serverId": "srv_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "SetServerMaintenanceOp": {
        "type": "object",
        "title": "Set server maintenance",
        "description": "Put a server in maintenance (its services move elsewhere), or bring it back.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serverId",
          "on"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setServerMaintenance"
            ]
          },
          "serverId": {
            "type": "string"
          },
          "on": {
            "type": "boolean"
          }
        },
        "example": {
          "on": true,
          "op": "setServerMaintenance",
          "serverId": "srv_8kq2x7ad"
        },
        "examples": [
          {
            "on": true,
            "op": "setServerMaintenance",
            "serverId": "srv_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "SetServerRegularServicesOp": {
        "type": "object",
        "title": "Set server regular services",
        "description": "On a GPU server: also run regular services, or keep it for GPU work. Null goes back to the default.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serverId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setServerRegularServices"
            ]
          },
          "serverId": {
            "type": "string"
          },
          "on": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "example": {
          "op": "setServerRegularServices",
          "serverId": "srv_8kq2x7ad"
        },
        "examples": [
          {
            "op": "setServerRegularServices",
            "serverId": "srv_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "SetServerSchedulableOp": {
        "type": "object",
        "title": "Set server schedulable",
        "description": "Whether new work may be placed on a server.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serverId",
          "schedulable"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setServerSchedulable"
            ]
          },
          "serverId": {
            "type": "string"
          },
          "schedulable": {
            "type": "boolean"
          }
        },
        "example": {
          "op": "setServerSchedulable",
          "schedulable": true,
          "serverId": "srv_8kq2x7ad"
        },
        "examples": [
          {
            "op": "setServerSchedulable",
            "schedulable": true,
            "serverId": "srv_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "SetServerTagsOp": {
        "type": "object",
        "title": "Set server tags",
        "description": "Set a server's tags.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serverId",
          "tags"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setServerTags"
            ]
          },
          "serverId": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "op": "setServerTags",
          "serverId": "srv_8kq2x7ad",
          "tags": [
            "gpu"
          ]
        },
        "examples": [
          {
            "op": "setServerTags",
            "serverId": "srv_8kq2x7ad",
            "tags": [
              "gpu"
            ]
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Servers"
        ]
      },
      "SetServiceBehindCdnOp": {
        "type": "object",
        "title": "Set service behind cdn",
        "description": "Put a service's websites behind a CDN, or take them out of it. Behind Cloudflare, only Cloudflare's address ranges reach its websites, and the visitor is the address Cloudflare forwards (taken only from connections that come from those ranges): firewall rules, rate limits and analytics see that visitor. Over plain HTTP only Cloudflare's connections are checked, so set Cloudflare's SSL mode to Full (strict). Let's Encrypt's challenges always get through.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setServiceBehindCdn"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "cdn": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"cloudflare\", or null for none."
          }
        },
        "example": {
          "op": "setServiceBehindCdn",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "op": "setServiceBehindCdn",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "SetServiceWafOp": {
        "type": "object",
        "title": "Set service waf",
        "description": "A service's web application firewall (WAF) settings, for all its domains. \"log\" or \"block\" turns it on: the WAF starts on the service's cluster with the first service there that turns it on, and stops after the last one turns it off.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "mode"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setServiceWaf"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "description": "\"off\" (a new service's), \"log\" (log only) or \"block\"."
          },
          "level": {
            "type": "integer",
            "format": "int32",
            "description": "How strict, 1 (fewest false alarms) to 4: the Core Rule Set's paranoia level.",
            "minimum": 0
          },
          "exceptions": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Rule ids not applied to this service, e.g. 942100."
          },
          "threshold": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The inbound anomaly score at which a request is blocked: 5 (the default), 10, 20 or 50.",
            "minimum": 0
          }
        },
        "example": {
          "mode": "off",
          "op": "setServiceWaf",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "mode": "off",
            "op": "setServiceWaf",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "SetTeamBackupSelectionOp": {
        "type": "object",
        "title": "Set team backup selection",
        "description": "Choose what a team backs up: \"all\" but `exceptions`, or only the \"selected\" ones.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId",
          "mode",
          "exceptions"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setTeamBackupSelection"
            ]
          },
          "teamId": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "description": "\"all\" or \"selected\"."
          },
          "exceptions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Service and volume ids: left out with \"all\", the only ones with \"selected\"."
          }
        },
        "example": {
          "exceptions": [
            "svc_8kq2x7ad"
          ],
          "mode": "all",
          "op": "setTeamBackupSelection",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "exceptions": [
              "svc_8kq2x7ad"
            ],
            "mode": "all",
            "op": "setTeamBackupSelection",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Backups"
        ]
      },
      "SetTeamObservabilityOp": {
        "type": "object",
        "title": "Set team observability",
        "description": "A team's observability: what its servers collect and keep. Owners and admins. Left out, a setting stays as it is.\n\nAddress and query string settings are at most the installation's limit, and \"default\" follows the installation's default. Passwords, tokens and other sensitive query values are never kept.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "setTeamObservability"
            ]
          },
          "teamId": {
            "type": "string"
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the team's servers collect analytics, request logs and usage history. Off keeps what was collected."
          },
          "requestLogs": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the team's servers keep its requests and connections (the request log). Off still counts them in analytics."
          },
          "ipMode": {
            "type": [
              "string",
              "null"
            ],
            "description": "What's kept of visitors' IP addresses: \"anonymized\", \"none\", \"full\" or \"default\"."
          },
          "queryStrings": {
            "type": [
              "string",
              "null"
            ],
            "description": "What's kept of query strings: \"names\" (parameter names only), \"keep\", \"none\" or \"default\"."
          },
          "requestLogMaxMb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Most of the request log each of the team's clusters keeps, in MB: 100 to 20480.",
            "minimum": 0
          },
          "requestLogMaxDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Most days of the request log each of the team's clusters keeps: 1 to 31.",
            "minimum": 0
          },
          "analyticsMonths": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Keep the team's analytics 3, 6 or 12 months, at most as long as the installation. 0 keeps them as long as the installation does.",
            "minimum": 0
          }
        },
        "example": {
          "op": "setTeamObservability",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "setTeamObservability",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "StartImport": {
        "type": "object",
        "description": "An import: where to (`databaseId`, or `newDatabase`), and from where\n(`url`, or `uploadId`).",
        "required": [
          "teamId",
          "engine"
        ],
        "properties": {
          "teamId": {
            "type": "string"
          },
          "engine": {
            "type": "string",
            "description": "\"postgres\" or \"mysql\"."
          },
          "databaseId": {
            "type": [
              "string",
              "null"
            ],
            "description": "An existing, empty database of the team's to import into."
          },
          "newDatabase": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NewDatabase",
                "description": "Or a new database, made for the import."
              }
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The database to copy, as a URL the cluster can reach: `postgres://user:password@host:5432/database` or `mysql://user:password@host:3306/database`, with `?sslmode=require` (or `ssl-mode=REQUIRED`), `verify-ca` or `verify-full` for TLS."
          },
          "uploadId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Or a dump uploaded first (`createDatabaseDumpUpload`, then its file sent)."
          }
        }
      },
      "StopServiceOp": {
        "type": "object",
        "title": "Stop service",
        "description": "Stop a service. Deploy it again to start it.\n\nAPI key access: **deploy**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "stopService"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "svc_8kq2x7ad",
          "op": "stopService"
        },
        "examples": [
          {
            "id": "svc_8kq2x7ad",
            "op": "stopService"
          }
        ],
        "x-pyo-access": "deploy",
        "x-tags": [
          "Services"
        ]
      },
      "SyncBody": {
        "type": "object",
        "description": "A Compose file to sync: its text, or a file in one of the team's GitHub\nrepositories, and the project it goes to.",
        "required": [
          "teamId"
        ],
        "properties": {
          "teamId": {
            "type": "string",
            "description": "The team it's for."
          },
          "projectId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The project to sync. Without it: the team's project made from a\nCompose file of the same name, when there's one."
          },
          "file": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Compose file's text, when it isn't read from a repository."
          },
          "env": {
            "type": [
              "string",
              "null"
            ],
            "description": "A .env file's text, for `${VAR}`s and `env_file: .env`."
          },
          "repo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RepoInput",
                "description": "Or: a repository the team's GitHub App installations can see."
              }
            ]
          },
          "clusterId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cluster new services go to: their public web ports get a free\ndomain on it."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The project's name, when the file has none."
          },
          "fileName": {
            "type": [
              "string",
              "null"
            ],
            "description": "The file's name, e.g. \"compose.yaml\". Services remember it."
          }
        }
      },
      "SyncChange": {
        "type": "object",
        "required": [
          "field"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "What changes, e.g. \"image\", \"replicas\", \"env LOG_LEVEL\", \"domain app.example.com\"."
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "description": "As it is now. Variables' values are never shown."
          },
          "to": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SyncComposeOp": {
        "type": "object",
        "title": "Sync Docker Compose",
        "description": "Bring a project in line with a Docker Compose file: `file` from `POST /compose/sync-plan`, which shows what this does. Only what the file says differently changes, so settings changed in Pyo that the file doesn't mention stay, and a secret's value is never changed. An image's tag or digest follows the file only when the file changed it since the last sync, so one a deploy set stays. Services whose settings change are deployed. What can't change in place (a volume that would move, another kind of source) is left as it is.\nA service no longer in the file stays, unless `prune`.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "projectId",
          "plan"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "syncCompose"
            ]
          },
          "projectId": {
            "type": "string"
          },
          "clusterId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where services new in the file run. Where the project's services run when omitted."
          },
          "plan": {
            "$ref": "#/components/schemas/ComposePlan"
          },
          "prune": {
            "type": "boolean",
            "description": "Delete the services made from this file that are no longer in it. Their volumes are kept, detached."
          },
          "confirm": {
            "type": "boolean",
            "description": "Go ahead with a very large replica change: without it, one that goes to 20 or more replicas and to more than 10 times what the service had, or more than twice what its servers have room for, is refused with 409 and `needsConfirm: true`. Ask the user before sending it."
          }
        },
        "example": {
          "op": "syncCompose",
          "plan": {
            "project": {
              "file": "compose.yaml",
              "name": "Shop",
              "namespace": "shop"
            },
            "services": [],
            "warnings": []
          },
          "projectId": "prj_8kq2x7ad"
        },
        "examples": [
          {
            "op": "syncCompose",
            "plan": {
              "project": {
                "file": "compose.yaml",
                "name": "Shop",
                "namespace": "shop"
              },
              "services": [],
              "warnings": []
            },
            "projectId": "prj_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Projects"
        ]
      },
      "SyncNote": {
        "type": "object",
        "required": [
          "field",
          "message"
        ],
        "properties": {
          "field": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "SyncPlan": {
        "type": "object",
        "description": "What a sync would change.",
        "required": [
          "services",
          "warnings",
          "file"
        ],
        "properties": {
          "project": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SyncProject",
                "description": "The project it syncs. None when there's none for this file yet: then\n`importCompose` makes it from `file`."
              }
            ]
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncService"
            },
            "description": "The file's services in deploy order, then the project's services that\naren't in the file."
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanWarning"
            },
            "description": "What the file has that Pyo doesn't carry over."
          },
          "file": {
            "$ref": "#/components/schemas/ComposePlan",
            "description": "The file as Pyo reads it: pass it to `syncCompose` (or `importCompose`)."
          }
        }
      },
      "SyncProject": {
        "type": "object",
        "required": [
          "id",
          "name",
          "namespace"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "namespace": {
            "type": "string"
          }
        }
      },
      "SyncService": {
        "type": "object",
        "required": [
          "name",
          "status",
          "changes",
          "notes",
          "manual",
          "deploy"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Its name in Pyo."
          },
          "composeName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its name in the file. None when it isn't in the file."
          },
          "serviceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "None for a service the sync would add."
          },
          "status": {
            "type": "string",
            "description": "\"added\", \"changed\", \"unchanged\" or \"notInFile\"."
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncChange"
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncNote"
            },
            "description": "What stays as it is in Pyo, and why."
          },
          "manual": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncNote"
            },
            "description": "What can't change in place. It's left as it is: change it by hand."
          },
          "deploy": {
            "type": "boolean",
            "description": "The sync deploys it."
          },
          "fromFile": {
            "type": "boolean",
            "description": "For a service not in the file: it was made from this file, so\n`prune` deletes it."
          }
        }
      },
      "TestAlertChannelOp": {
        "type": "object",
        "title": "Test alert channel",
        "description": "Send a test alert to a channel now. When it doesn't arrive, the error says why. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "testAlertChannel"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "alc_8kq2x7ad",
          "op": "testAlertChannel"
        },
        "examples": [
          {
            "id": "alc_8kq2x7ad",
            "op": "testAlertChannel"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Alerts"
        ]
      },
      "TestCloudflareOp": {
        "type": "object",
        "title": "Test cloudflare",
        "description": "Check the saved Cloudflare token again: the zones it covers now, whether each can use Cloudflare Tunnel, and what it's missing (`problems`). Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "testCloudflare"
            ]
          },
          "teamId": {
            "type": "string"
          }
        },
        "example": {
          "op": "testCloudflare",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "testCloudflare",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Integrations"
        ]
      },
      "TestGitConnectionOp": {
        "type": "object",
        "title": "Test git connection",
        "description": "Check what a Git connection's token can do now. `problems` says what's\nmissing, and `working` whether it works at all. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "testGitConnection"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "gitc_8kq2x7ad",
          "op": "testGitConnection"
        },
        "examples": [
          {
            "id": "gitc_8kq2x7ad",
            "op": "testGitConnection"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Git providers"
        ]
      },
      "TestHetznerOp": {
        "type": "object",
        "title": "Test hetzner",
        "description": "List the locations the team's Hetzner token sees.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "teamId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "testHetzner"
            ]
          },
          "teamId": {
            "type": "string"
          }
        },
        "example": {
          "op": "testHetzner",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "op": "testHetzner",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Integrations"
        ]
      },
      "UpdateAlertChannelOp": {
        "type": "object",
        "title": "Update alert channel",
        "description": "Change an alert channel. What you leave out stays as it is. An empty `secret` stops signing. Team owners and admins.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateAlertChannel"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "webhookUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "token": {
            "type": [
              "string",
              "null"
            ]
          },
          "chatId": {
            "type": [
              "string",
              "null"
            ]
          },
          "secret": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "chatId": "-1001234567890",
          "events": [
            "deploy_failed",
            "server_offline"
          ],
          "id": "alc_8kq2x7ad",
          "name": "Ops chat",
          "op": "updateAlertChannel",
          "secret": "a-long-random-secret",
          "token": "123456789:AAExampleBotTokenFromBotFather0000",
          "webhookUrl": "https://hooks.slack.com/services/T0000/B0000/XXXXXXXX"
        },
        "examples": [
          {
            "chatId": "-1001234567890",
            "events": [
              "deploy_failed",
              "server_offline"
            ],
            "id": "alc_8kq2x7ad",
            "name": "Ops chat",
            "op": "updateAlertChannel",
            "secret": "a-long-random-secret",
            "token": "123456789:AAExampleBotTokenFromBotFather0000",
            "webhookUrl": "https://hooks.slack.com/services/T0000/B0000/XXXXXXXX"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Alerts"
        ]
      },
      "UpdateClusterAgentOp": {
        "type": "object",
        "title": "Update cluster agent",
        "description": "On a hosted Pyo: update a cluster's agent to Pyo's version now.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateClusterAgent"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "example": {
          "id": "cl_8kq2x7ad",
          "op": "updateClusterAgent"
        },
        "examples": [
          {
            "id": "cl_8kq2x7ad",
            "op": "updateClusterAgent"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "UpdateClusterOp": {
        "type": "object",
        "title": "Update cluster",
        "description": "Rename a cluster or change its description, location or tags.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateCluster"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "description": "Storefront and its workers",
          "id": "cl_8kq2x7ad",
          "location": "Singapore, SG",
          "name": "edge",
          "op": "updateCluster",
          "tags": [
            "gpu"
          ]
        },
        "examples": [
          {
            "description": "Storefront and its workers",
            "id": "cl_8kq2x7ad",
            "location": "Singapore, SG",
            "name": "edge",
            "op": "updateCluster",
            "tags": [
              "gpu"
            ]
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Clusters"
        ]
      },
      "UpdateDatabaseBackupOp": {
        "type": "object",
        "title": "Update database backup",
        "description": "Change a backed-up database's schedule, or pause its backups.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "enabled",
          "schedule",
          "hour",
          "keep"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateDatabaseBackup"
            ]
          },
          "id": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "schedule": {
            "type": "string"
          },
          "hour": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "keep": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        },
        "example": {
          "enabled": true,
          "hour": 2,
          "id": "db_8kq2x7ad",
          "keep": 14,
          "op": "updateDatabaseBackup",
          "schedule": "daily"
        },
        "examples": [
          {
            "enabled": true,
            "hour": 2,
            "id": "db_8kq2x7ad",
            "keep": 14,
            "op": "updateDatabaseBackup",
            "schedule": "daily"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "UpdateDatabaseOp": {
        "type": "object",
        "title": "Update database",
        "description": "Change a database's size, instances, storage, version, pooler, REST API, read replicas or deletion protection. Instances are 1 for a single server, or for high availability 2 to 8 replicas for Postgres, 2 to 4 for KV, or 2 or 4 for MySQL. MySQL instances only grow. Storage only grows and the version only goes up. Only owners and admins can turn deletion protection off. Connected services get changed variables on their next deploy.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateDatabase"
            ]
          },
          "id": {
            "type": "string"
          },
          "size": {
            "type": [
              "string",
              "null"
            ]
          },
          "instances": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "storageGi": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          },
          "pooler": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "rest": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "deletionProtection": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "readReplicas": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Dedicated read replicas, each the database's size: 1 to 5 for Postgres, or 1 to 4 for KV. 0 turns them off. They only serve reads and never become the primary. Postgres: connected services get DATABASE_URL_READ (through their own pooler) while they're on. KV: REDIS_URL sends reads to them automatically."
          },
          "cpuMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "With size \"custom\": CPU per instance in millicores (125 to 8000, steps of 125)."
          },
          "memoryMi": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "With size \"custom\": memory per instance in MiB, from 512 for Postgres, 1024 for MySQL or 256 for KV, up to 32768, in steps of 256."
          }
        },
        "example": {
          "cpuMillis": 1,
          "deletionProtection": true,
          "id": "mdb_8kq2x7ad",
          "instances": 1,
          "memoryMi": 1,
          "op": "updateDatabase",
          "pooler": true,
          "readReplicas": 1,
          "rest": true,
          "size": "example",
          "storageGi": 1,
          "version": "example"
        },
        "examples": [
          {
            "cpuMillis": 1,
            "deletionProtection": true,
            "id": "mdb_8kq2x7ad",
            "instances": 1,
            "memoryMi": 1,
            "op": "updateDatabase",
            "pooler": true,
            "readReplicas": 1,
            "rest": true,
            "size": "example",
            "storageGi": 1,
            "version": "example"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Databases"
        ]
      },
      "UpdateFirewallRuleOp": {
        "type": "object",
        "title": "Update firewall rule",
        "description": "Change a firewall access rule. Omitted fields stay as they are (as in `addFirewallRule`).\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateFirewallRule"
            ]
          },
          "id": {
            "type": "string"
          },
          "action": {
            "type": [
              "string",
              "null"
            ]
          },
          "operator": {
            "type": [
              "string",
              "null"
            ]
          },
          "sources": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "requests": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "per": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "action": "example",
          "id": "fwr_8kq2x7ad",
          "note": "example",
          "op": "updateFirewallRule",
          "operator": "example",
          "per": "example",
          "requests": 1,
          "sources": []
        },
        "examples": [
          {
            "action": "example",
            "id": "fwr_8kq2x7ad",
            "note": "example",
            "op": "updateFirewallRule",
            "operator": "example",
            "per": "example",
            "requests": 1,
            "sources": []
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "UpdateMemberRoleOp": {
        "type": "object",
        "title": "Update member role",
        "description": "Change a member's role: \"owner\", \"admin\", \"developer\" or \"viewer\".\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "role"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateMemberRole"
            ]
          },
          "id": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "example": {
          "id": "mem_8kq2x7ad",
          "op": "updateMemberRole",
          "role": "developer"
        },
        "examples": [
          {
            "id": "mem_8kq2x7ad",
            "op": "updateMemberRole",
            "role": "developer"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "UpdateProjectOp": {
        "type": "object",
        "title": "Update project",
        "description": "Rename a project or change its description.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateProject"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "description": "Storefront and its workers",
          "id": "prj_8kq2x7ad",
          "name": "Shop",
          "op": "updateProject"
        },
        "examples": [
          {
            "description": "Storefront and its workers",
            "id": "prj_8kq2x7ad",
            "name": "Shop",
            "op": "updateProject"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Projects"
        ]
      },
      "UpdateTeamOp": {
        "type": "object",
        "title": "Update team",
        "description": "Rename a team, change its description, default cluster or preferences.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateTeam"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultClusterId": {
            "type": [
              "string",
              "null"
            ]
          },
          "preferences": {
            "type": [
              "object",
              "null"
            ],
            "description": "The team's dashboard preferences, saved as given. Its `requestLogs` (`maxMb`, `maxDays`) still works but is deprecated: use `setTeamObservability`'s `requestLogMaxMb` and `requestLogMaxDays`."
          },
          "agentUpdates": {
            "type": [
              "string",
              "null"
            ],
            "description": "On a hosted Pyo: \"auto\" updates the team's agents when Pyo has a new version, \"manual\" leaves it to you."
          },
          "analyticsMonths": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Deprecated: use `setTeamObservability`'s `analyticsMonths`. Keep the team's analytics 3, 6 or 12 months, at most as long as the installation. 0 keeps them as long as the installation does.",
            "deprecated": true,
            "minimum": 0
          }
        },
        "example": {
          "agentUpdates": "auto",
          "analyticsMonths": 1,
          "defaultClusterId": "cl_8kq2x7ad",
          "description": "Storefront and its workers",
          "id": "team_8kq2x7ad",
          "name": "Acme",
          "op": "updateTeam",
          "preferences": {}
        },
        "examples": [
          {
            "agentUpdates": "auto",
            "analyticsMonths": 1,
            "defaultClusterId": "cl_8kq2x7ad",
            "description": "Storefront and its workers",
            "id": "team_8kq2x7ad",
            "name": "Acme",
            "op": "updateTeam",
            "preferences": {}
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Teams"
        ]
      },
      "UpdateWafRuleOp": {
        "type": "object",
        "title": "Update waf rule",
        "description": "Change a custom web application firewall rule. Omitted fields stay as they are.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "updateWafRule"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "match": {
            "type": [
              "string",
              "null"
            ]
          },
          "conditions": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ConditionInput"
            }
          },
          "action": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "example": {
          "action": "example",
          "conditions": [],
          "enabled": true,
          "id": "wfr_8kq2x7ad",
          "match": "example",
          "name": "web",
          "op": "updateWafRule"
        },
        "examples": [
          {
            "action": "example",
            "conditions": [],
            "enabled": true,
            "id": "wfr_8kq2x7ad",
            "match": "example",
            "name": "web",
            "op": "updateWafRule"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Firewall"
        ]
      },
      "UploadCertificateOp": {
        "type": "object",
        "title": "Upload certificate",
        "description": "Upload a certificate for the team's domains: the chain and its private key, PEM.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "id",
          "teamId",
          "name",
          "certificate",
          "privateKey"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "uploadCertificate"
            ]
          },
          "id": {
            "type": "string",
            "description": "A new id you choose: `crt_` then 4 to 40 lowercase letters, digits, dashes or underscores."
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "certificate": {
            "type": "string",
            "description": "The certificate chain, PEM."
          },
          "privateKey": {
            "type": "string",
            "description": "Its private key, PEM."
          }
        },
        "example": {
          "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----",
          "id": "crt_8kq2x7ad",
          "name": "shop.example.com",
          "op": "uploadCertificate",
          "privateKey": "-----BEGIN PRIVATE KEY-----\n…\n-----END PRIVATE KEY-----",
          "teamId": "team_8kq2x7ad"
        },
        "examples": [
          {
            "certificate": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----",
            "id": "crt_8kq2x7ad",
            "name": "shop.example.com",
            "op": "uploadCertificate",
            "privateKey": "-----BEGIN PRIVATE KEY-----\n…\n-----END PRIVATE KEY-----",
            "teamId": "team_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Domains"
        ]
      },
      "User": {
        "type": "object",
        "description": "A Pyo account.",
        "required": [
          "id",
          "name",
          "email",
          "timezone",
          "isAdmin",
          "mustSetUp"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "isAdmin": {
            "type": "boolean",
            "description": "Administers this installation (outgoing email and the like)."
          },
          "mustSetUp": {
            "type": "boolean",
            "description": "Still on the installer's printed sign-in: nothing else works until\nthey've chosen their own email and password."
          }
        }
      },
      "VerifyDomainOp": {
        "type": "object",
        "title": "Verify domain",
        "description": "Check a domain's DNS now.\n\nAPI key access: **full**.",
        "required": [
          "op",
          "serviceId",
          "domainId"
        ],
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "verifyDomain"
            ]
          },
          "serviceId": {
            "type": "string"
          },
          "domainId": {
            "type": "string"
          }
        },
        "example": {
          "domainId": "dom_8kq2x7ad",
          "op": "verifyDomain",
          "serviceId": "svc_8kq2x7ad"
        },
        "examples": [
          {
            "domainId": "dom_8kq2x7ad",
            "op": "verifyDomain",
            "serviceId": "svc_8kq2x7ad"
          }
        ],
        "x-pyo-access": "full",
        "x-tags": [
          "Domains"
        ]
      },
      "Version": {
        "type": "object",
        "description": "One version of an image that was deployed.",
        "required": [
          "image",
          "label",
          "firstDeployed",
          "lastDeployed",
          "deployments",
          "serviceIds",
          "live",
          "expired"
        ],
        "properties": {
          "image": {
            "type": "string",
            "description": "What the deployment asked for (a tag, or a digest)."
          },
          "label": {
            "type": "string",
            "description": "The tag, commit or image reference shown for it."
          },
          "digest": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstDeployed": {
            "type": "integer",
            "format": "int64",
            "description": "In milliseconds since 1970."
          },
          "lastDeployed": {
            "type": "integer",
            "format": "int64"
          },
          "deployments": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "serviceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The services that deployed it."
          },
          "live": {
            "type": "boolean",
            "description": "A service runs it now."
          },
          "expired": {
            "type": "boolean",
            "description": "Removed from Pyo's registry by retention."
          },
          "size": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "In bytes, for images Pyo built.",
            "minimum": 0
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "pyo_…",
        "description": "An API key from the dashboard's API keys page: `Authorization: Bearer pyo_…`. Keys can expire, and an expired one gets a 401."
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Who you are, and what this Pyo is."
    },
    {
      "name": "State",
      "description": "Everything you can see, in one read."
    },
    {
      "name": "Operations",
      "description": "Every change: one operation per request to `/ops`."
    },
    {
      "name": "Teams",
      "description": "Teams, their members and invites."
    },
    {
      "name": "Projects",
      "description": "Projects group a team's services."
    },
    {
      "name": "Services",
      "description": "Create, change, scale and stop services, and read their logs and traffic."
    },
    {
      "name": "Deployments",
      "description": "Deploy, roll back and cancel, deploy an uploaded folder, manage deploy hooks, and remove or redeploy previews."
    },
    {
      "name": "Cron jobs",
      "description": "Commands a service runs on a schedule, and their runs."
    },
    {
      "name": "Domains",
      "description": "Domains and their certificates."
    },
    {
      "name": "Volumes",
      "description": "Persistent storage for services."
    },
    {
      "name": "Databases",
      "description": "Postgres, MySQL and KV databases Pyo runs, and databases it backs up."
    },
    {
      "name": "Backups",
      "description": "A team's backups of its volumes and databases."
    },
    {
      "name": "Clusters",
      "description": "Groups of servers that run services."
    },
    {
      "name": "Firewall",
      "description": "Per service: who may reach it, and its web application firewall."
    },
    {
      "name": "Servers",
      "description": "Add, tag, pause and remove servers."
    },
    {
      "name": "Builders",
      "description": "Where images are built from Git."
    },
    {
      "name": "Images",
      "description": "The images a team deployed, and logins for private registries."
    },
    {
      "name": "GitHub",
      "description": "Repositories to deploy from."
    },
    {
      "name": "Git providers",
      "description": "GitLab connections and their repositories to deploy from."
    },
    {
      "name": "Integrations",
      "description": "Keys for outside services, and secret stores."
    },
    {
      "name": "Alerts",
      "description": "Where a team's alerts go: Telegram, Discord, Slack or a webhook."
    },
    {
      "name": "Observability",
      "description": "Usage of servers and services, website traffic and request logs."
    },
    {
      "name": "Sandboxes",
      "description": "Isolated machines made on demand on your sandbox servers, for agents, code and previews."
    }
  ]
}
