{
  "openapi": "3.1.0",
  "info": {
    "title": "WP Waterfall API",
    "version": "0.8.0",
    "description": "WP Waterfall API: identity, companies, API keys, and activity; nodes, sites, environments, tools, files, database, logs, cron, jobs, code, SSH, and SFTP; domains, DNS, the edge, observability, billing, webhooks, and MCP connections. Node-changing writes return 202 with the Job object. This is the customer document: it leaves out the operations only WP Waterfall staff can call, and the fields and parameters only they can use.",
    "x-wpwaterfall-audience": "customer"
  },
  "servers": [
    {
      "url": "https://api.wpwaterfall.com/v1"
    }
  ],
  "tags": [
    {
      "name": "Me"
    },
    {
      "name": "Companies"
    },
    {
      "name": "Members"
    },
    {
      "name": "Invitations"
    },
    {
      "name": "SSO"
    },
    {
      "name": "Activity"
    },
    {
      "name": "Health"
    },
    {
      "name": "Status"
    },
    {
      "name": "Pricing"
    },
    {
      "name": "Referral invite"
    },
    {
      "name": "Pay"
    },
    {
      "name": "Data rights"
    },
    {
      "name": "Assistant"
    },
    {
      "name": "Sandbox"
    },
    {
      "name": "Transfers"
    },
    {
      "name": "Company add-ons"
    },
    {
      "name": "Dedicated nodes"
    },
    {
      "name": "Sign in"
    },
    {
      "name": "Account security"
    },
    {
      "name": "API keys"
    },
    {
      "name": "Platform"
    },
    {
      "name": "Regions"
    },
    {
      "name": "Nodes"
    },
    {
      "name": "Sites"
    },
    {
      "name": "Environments"
    },
    {
      "name": "Tools"
    },
    {
      "name": "Files"
    },
    {
      "name": "Database"
    },
    {
      "name": "Logs"
    },
    {
      "name": "Cron"
    },
    {
      "name": "Jobs"
    },
    {
      "name": "Bulk actions"
    },
    {
      "name": "Labels"
    },
    {
      "name": "Notifications"
    },
    {
      "name": "Saved views"
    },
    {
      "name": "Code"
    },
    {
      "name": "SSH and SFTP"
    },
    {
      "name": "WordPress users"
    },
    {
      "name": "Backups"
    },
    {
      "name": "Plugins and themes"
    },
    {
      "name": "Domains"
    },
    {
      "name": "DNS"
    },
    {
      "name": "Caching"
    },
    {
      "name": "Redirects"
    },
    {
      "name": "IP deny"
    },
    {
      "name": "Bot protection"
    },
    {
      "name": "Analytics"
    },
    {
      "name": "Monitor"
    },
    {
      "name": "Push"
    },
    {
      "name": "Add-ons"
    },
    {
      "name": "Billing"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Promo codes"
    },
    {
      "name": "Referrals"
    },
    {
      "name": "Connections"
    },
    {
      "name": "Nami assistant"
    },
    {
      "name": "Google"
    },
    {
      "name": "Migrations"
    },
    {
      "name": "Audit log"
    },
    {
      "name": "Accessibility"
    }
  ],
  "paths": {
    "/users/me": {
      "get": {
        "tags": [
          "Me"
        ],
        "operationId": "getMe",
        "summary": "Current user",
        "description": "Returns the signed-in person: their profile, the workspaces they can switch into with their role in each, the current company, and the role and permissions they hold there. Needs a dashboard session: an API key gets 401 and checks itself with GET /api-keys/current instead.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "User",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "tags": [
          "Me"
        ],
        "operationId": "updateMe",
        "summary": "Update current user",
        "description": "Changes the person's own `name`, `locale`, `assistant_mode`, or `marketing_consent`. Fields left out keep their value. `marketing_consent: true` records the time of the opt-in, `false` clears it, and the audit log records each change of consent. Needs a dashboard session.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "User",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/sessions/{id}": {
      "delete": {
        "tags": [
          "Me"
        ],
        "operationId": "revokeSession",
        "summary": "Revoke a session",
        "description": "Ends one of the person's own sign-in sessions, the current one included, and records a security event. Answers 204, or 404 when the session is not theirs. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id of the session, from the session list."
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies": {
      "post": {
        "tags": [
          "Companies"
        ],
        "operationId": "createCompany",
        "summary": "Create a business (an individual account only)",
        "description": "Creates a business and makes the caller its owner. Only a person working in their individual account may call it: any other account answers 403. One person owns at most 5 businesses, and the next one answers 409. Answers 201 with the company. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Business",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Company"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only an individual account can create a business",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/users/me/workspace": {
      "post": {
        "tags": [
          "Me"
        ],
        "operationId": "switchWorkspace",
        "summary": "Switch the active workspace (an individual account or an agency)",
        "description": "Makes `company_id` the active workspace of this session and returns that workspace with the caller's role in it. Answers 403 when the caller is not a member of the workspace or it is closed. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "You are not a member of that workspace",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/companies/me": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompany",
        "summary": "Current company",
        "description": "Returns the company the call acts in. `deletion` is set while a deletion of the company is scheduled and is null otherwise. Every role may read it, and an API key needs the `sites:read` scope.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Company",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Company"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "tags": [
          "Companies"
        ],
        "operationId": "updateCompany",
        "summary": "Update current company",
        "description": "Changes the company `name` or `mfa_enforced`, the rule that every member signs in with two-factor. Owners and Admins of a business or enterprise account may call it: an individual account answers 403. A change to `mfa_enforced` also needs a recent sign-in. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Company",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Company"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/transfer-ownership": {
      "post": {
        "tags": [
          "Companies"
        ],
        "operationId": "transferOwnership",
        "summary": "Start handing the company to an Admin",
        "description": "Owner only, with a recent sign-in. The body names the Admin (member_id) and the company name typed exactly (confirmation). The Admin needs a verified email and two-factor sign-in when the company requires it. Nothing changes yet: the Admin gets an email with a link that works for 7 days. Starting a new transfer replaces a pending one. Answers 409 when the Admin or the Owner changed meanwhile.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "The pending transfer",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the Owner can start it, and it needs a recent sign-in",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "The member cannot receive ownership, or the name does not match",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/companies/me/ownership-transfer": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getOwnershipTransfer",
        "summary": "Read the pending ownership transfer",
        "description": "Returns { pending: null } when no transfer waits. Owners and Admins can read it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The pending transfer or null",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "tags": [
          "Companies"
        ],
        "operationId": "cancelOwnershipTransfer",
        "summary": "Cancel the pending ownership transfer",
        "description": "Owner only. The link in the email stops working. Nothing else changes.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Cancelled",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No transfer is pending",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/ownership-transfers/preview": {
      "post": {
        "tags": [
          "Companies"
        ],
        "operationId": "previewOwnershipTransfer",
        "summary": "See what an ownership link offers",
        "description": "The signed-in Admin named in the email sends the token. Changes nothing. Answers the company name, who is handing it over, and whether billing emails go to that person.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The offer",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The link is not for this account, or it is not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "The link expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/ownership-transfers/accept": {
      "post": {
        "tags": [
          "Companies"
        ],
        "operationId": "acceptOwnershipTransfer",
        "summary": "Accept ownership of a company",
        "description": "The signed-in Admin named in the email sends the token. The Admin becomes the Owner and the former Owner becomes an Admin, in one step. When billing emails go to the former Owner, billing_contact must be keep or new_owner. Needs a verified email, and two-factor sign-in when the company requires it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "You are the Owner",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The link is not for this account, or it is not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Owner or the Admin changed since the link was sent",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "The link expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "A requirement is not met, or a choice is missing",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/companies/me/close": {
      "post": {
        "tags": [
          "Companies"
        ],
        "operationId": "closeCompany",
        "summary": "Close a business. Owner only, with the business name typed to confirm",
        "description": "Only the owner may call it, after a recent sign-in, with `confirmation` set to the exact business name (422 otherwise). A paid term runs to its end with no refund and the sites keep serving until then. With no term running the business closes now and its sites are suspended. Answers 202, and the business is erased 30 days after it closes unless the owner undoes the close. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Closure scheduled",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the business owner can close it",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "The typed business name does not match",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/companies/me/members": {
      "get": {
        "tags": [
          "Members"
        ],
        "operationId": "listMembers",
        "summary": "List members",
        "description": "Lists the people in the company with their roles, in pages of up to 200 (default 50). A Site Admin or Site Developer row carries `site_ids`, and a caller who is limited to some sites sees only their own sites there. The Billing role cannot read the list, and an API key needs the `users:read` scope.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: at most 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ]
      }
    },
    "/members/{id}": {
      "patch": {
        "tags": [
          "Members"
        ],
        "operationId": "updateMember",
        "summary": "Update a member role",
        "description": "Changes a member's `role`. Owners and Admins may call it after a recent sign-in. It answers 422 for a change to `owner`, for the owner's own row (ownership moves only through a transfer), and for the caller's own role. The person gets an email, and the API keys they made are limited to the new role. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id of the member, from the member list."
          }
        ],
        "responses": {
          "200": {
            "description": "Member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Member"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "tags": [
          "Members"
        ],
        "operationId": "removeMember",
        "summary": "Remove a member",
        "description": "Removes a person from the company, along with their access to each site, and the API keys they made stop working. Owners and Admins may call it after a recent sign-in. The owner cannot be removed (422). Answers 204. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id of the member, from the member list."
          }
        ],
        "responses": {
          "204": {
            "description": "Removed",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/invitations": {
      "get": {
        "tags": [
          "Invitations"
        ],
        "operationId": "listInvitations",
        "summary": "List invitations",
        "description": "Lists the company's invitations with the invited email and role, in pages of up to 200 (default 50). A Site Admin or Site Developer cannot read them and gets 403.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Invitations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: at most 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ]
      },
      "post": {
        "tags": [
          "Invitations"
        ],
        "operationId": "createInvitation",
        "summary": "Invite a teammate",
        "description": "Emails an invitation code that works for 7 days and answers 201 with the invitation. `site_ids` (up to 100) limits a Site Admin or Site Developer invitation to those sites, and the `owner` role answers 422. A signed-in person needs a recent sign-in for every role above Viewer. An API key needs the `users:write` scope and cannot invite an Admin or a Billing user (403). A company sends at most 30 invitation emails an hour.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Invitation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invitation"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing users:write",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/invitations/{id}/resend": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "operationId": "resendInvitation",
        "summary": "Resend an invitation",
        "description": "Makes a new code for the invitation, valid for 7 days, and emails it again, so the earlier code stops working. It counts toward the 30 invitation emails a company may send in an hour. Answers 404 when the invitation was not found.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id of the invitation."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Invitation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invitation"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/invitations/{id}": {
      "delete": {
        "tags": [
          "Invitations"
        ],
        "operationId": "revokeInvitation",
        "summary": "Revoke an invitation",
        "description": "Deletes an invitation, so its code no longer works. Owners and Admins may call it. Answers 204, or 404 when the invitation was not found.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id of the invitation."
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/api-keys/current": {
      "get": {
        "tags": [
          "Me"
        ],
        "operationId": "getCurrentApiKey",
        "summary": "Validate the current API key",
        "description": "Returns the key the call was made with: its `id`, `name`, `scopes`, the company it acts in (`company_id`), and `company_ids`, the companies it is limited to, or null when it has no such limit. Use it to check that a key works. A dashboard session gets 401.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentApiKey"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/activity": {
      "get": {
        "tags": [
          "Activity"
        ],
        "operationId": "listActivity",
        "summary": "Company activity",
        "description": "Returns the company's audit log in pages of up to 200 entries (default 50). Filter with `actor`, `action`, `from`, and `to`. A Site Admin or Site Developer gets 403 and reads one site's log with GET /sites/{id}/activity instead. An API key needs the `activity:read` scope.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "actor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 200
            },
            "description": "How many rows to return in one page."
          }
        ],
        "responses": {
          "200": {
            "description": "Activity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditEventList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "operationId": "getHealth",
        "summary": "Health check",
        "description": "Answers `status: ok` when the API is up. It needs no sign-in and no API key, and it is not rate limited.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/pricing": {
      "get": {
        "tags": [
          "Pricing"
        ],
        "operationId": "getPublicPricing",
        "security": [],
        "summary": "Public plan and tier prices",
        "description": "Every plan on sale and every site tier with their prices, with no sign-in (ADR 216). Anyone may buy any size. The same amounts as GET /billing/licenses and checkout. A plan costs the same in every data center (ADR 215). Enterprise has no public price.",
        "responses": {
          "200": {
            "description": "Prices",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPricing"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/ready": {
      "get": {
        "tags": [
          "Health"
        ],
        "operationId": "getReady",
        "security": [],
        "summary": "Readiness check",
        "description": "No sign-in. Answers 200 when the API can reach its database and 503 when it cannot, with the same body. The body also says whether the node gateway accepts a connection; that never changes the status code. GET /health only says the process is running, and GET /health/deep also checks the queue.",
        "responses": {
          "200": {
            "description": "The API can serve requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Readiness"
                }
              }
            }
          },
          "503": {
            "description": "The database did not answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Readiness"
                }
              }
            }
          }
        }
      }
    },
    "/health/deep": {
      "get": {
        "tags": [
          "Health"
        ],
        "operationId": "getDeepHealth",
        "security": [],
        "summary": "Deep health check",
        "description": "No sign-in. Answers 200 when the database answers and every queue has a consumer, and 503 when one of them does not. It does not say which, and it reuses an answer for 10 seconds, so it is safe to poll. Point an uptime monitor here. GET /health only says the process is running.",
        "responses": {
          "200": {
            "description": "The API, its database, and its queue work",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeepHealth"
                }
              }
            }
          },
          "503": {
            "description": "The database or the queue does not work",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeepHealth"
                }
              }
            }
          }
        }
      }
    },
    "/referrals/invite/{code}": {
      "get": {
        "tags": [
          "Referral invite"
        ],
        "operationId": "getReferralInvite",
        "security": [],
        "summary": "Who shared a referral link, and what the new customer gets",
        "description": "No sign-in. Answers the first name of the person who shared the link (or the company name) and the credit a new customer gets after their first payment. An unknown, switched off, or malformed code answers 404. Limited to 30 reads a minute per address, and 429 past that.",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The invite",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralInvite"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "No such referral link",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many reads from this address",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/pay/{name}": {
      "get": {
        "tags": [
          "Pay"
        ],
        "operationId": "getPayInvoice",
        "security": [],
        "summary": "An invoice to pay, by the name in its emailed link",
        "description": "No sign-in. The name is the random value in the link WP Waterfall emails with an invoice. Answers what the invoice page shows: the amount, the due date, the lines, who it is for, and, while the invoice is open, the client secret the Stripe Payment Element pays it with. A paid or void invoice answers its plain state until the link ends. A link ends the later of 60 days after it is sent and 30 days after the due date, or when staff end it; after that it answers 404 like an unknown name, so a name cannot be tested for. The answer is never cached and never indexed. Limited per address and per link, and 429 past that.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The invoice number and the token, joined by a hyphen, such as 2VRBR54J-0003 and 26 lowercase letters and digits (a to z, 2 to 7). At most 64 characters of letters, digits, and hyphens. The server uses only the last 26 characters.",
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The invoice",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoicePage"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "No such invoice link. The same answer for an unknown, malformed, revoked, and expired name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many calls from this address or for this link",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/pay/{name}/refresh": {
      "post": {
        "tags": [
          "Pay"
        ],
        "operationId": "refreshPayInvoice",
        "security": [],
        "summary": "A fresh client secret for an invoice link",
        "description": "No sign-in. Send no body. Answers the same invoice as the read, with a new client secret while the invoice is open, after a payment attempt ended or the page sat open a while. The state is current too, so a page that finds the invoice paid shows it. Limited to 20 renewals a minute per link.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The invoice number and the token, joined by a hyphen, such as 2VRBR54J-0003 and 26 lowercase letters and digits (a to z, 2 to 7). At most 64 characters of letters, digits, and hyphens. The server uses only the last 26 characters.",
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9-]+$"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The invoice, with a fresh client secret while it is open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoicePage"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "No such invoice link. The same answer for an unknown, malformed, revoked, and expired name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many calls from this address or for this link",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/pay/{name}/pdf": {
      "get": {
        "tags": [
          "Pay"
        ],
        "operationId": "getPayInvoicePdf",
        "security": [],
        "summary": "The PDF of an invoice, by the name in its emailed link",
        "description": "No sign-in. The invoice's PDF, sent inline from this address so the customer never sees a Stripe address. The file is read from Stripe each time with a size limit of 5 MB and a time limit of 10 seconds, and is never stored here. 404 for an unknown name or an invoice with no PDF.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The invoice number and the token, joined by a hyphen, such as 2VRBR54J-0003 and 26 lowercase letters and digits (a to z, 2 to 7). At most 64 characters of letters, digits, and hyphens. The server uses only the last 26 characters.",
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "No such invoice link. The same answer for an unknown, malformed, revoked, and expired name.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many calls from this address or for this link",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "The PDF could not be fetched. Try again in a moment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/status": {
      "get": {
        "tags": [
          "Status"
        ],
        "operationId": "getPublicStatus",
        "security": [],
        "summary": "Public status board",
        "description": "No sign-in. The overall state, every component with its current status and a 90 day daily series, the announcement if staff set one, active incidents, upcoming maintenance, and incidents resolved in the last 14 days. Every data center WP Waterfall offers is a component with a status, a percent, and days. `measured_by` says where they come from: `probes` is our own checks, and `provider` is a data center where we run no server, read from Google Cloud's public incident record for its region. Hidden incidents, false alarms with the minutes they covered, and removed updates never appear. When staff set a start of the public history (`history_start`), days before it read `no_data` and count for nothing, and incidents that ended before it are left out. The first four fields (dashboard, api, edge, url) keep the shape the sign-in page reads. Cached for 30 seconds, and a staff write clears the cache. Probes run every minute, so a status here is at most about a minute old plus the cache.",
        "responses": {
          "200": {
            "description": "The status board",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusBoard"
                }
              }
            }
          }
        }
      }
    },
    "/status/history": {
      "get": {
        "tags": [
          "Status"
        ],
        "operationId": "getStatusHistory",
        "security": [],
        "summary": "Incident history for a month",
        "description": "No sign-in. Every incident that started in the month (YYYY-MM, default the current month), newest first, with its updates. Hidden incidents, false alarms, removed updates, and incidents that ended before the start of the public history never appear.",
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Incidents of the month",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusHistory"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "422": {
            "description": "The month is not YYYY-MM",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/status/incidents/{id}": {
      "get": {
        "tags": [
          "Status"
        ],
        "operationId": "getStatusIncident",
        "security": [],
        "summary": "One incident with its update timeline",
        "description": "No sign-in. Answers 404 for a hidden incident, a false alarm, and an incident that ended before the start of the public history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the incident."
          }
        ],
        "responses": {
          "200": {
            "description": "The incident",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusIncident"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "No such incident",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/contact": {
      "post": {
        "tags": [
          "Contact"
        ],
        "operationId": "sendContactMessage",
        "security": [],
        "summary": "Send a message to WP Waterfall from the contact form",
        "description": "No sign-in. Emails the message to the WP Waterfall staff inbox with the sender's address as the reply address, and stores nothing. Limited to 5 messages an hour per address. When Turnstile is on, send the widget token as turnstile_token. A filled honeypot field is accepted and dropped.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Received",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The Turnstile check failed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many messages from this address",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Mail is not set up on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/companies/me/nami-site-content": {
      "put": {
        "tags": [
          "Companies"
        ],
        "operationId": "setNamiSiteContent",
        "summary": "Turn Nami AI's access to site content on or off",
        "description": "Owner or Admin, in a signed-in dashboard session; an API key and WP Waterfall staff acting as the customer are refused. Off: Nami AI refuses the tools that read site content (files, database rows, logs, WP-CLI output, WordPress users, and traffic), and Safe Updates decides by the required match alone, without its AI review. Nothing else changes. On by default. Writes the audit entry company.nami_site_content.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetNamiSiteContent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The company, with nami_site_content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Company"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only an Owner or an Admin in the dashboard can change it",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/ad-conversions": {
      "post": {
        "tags": [
          "Companies"
        ],
        "operationId": "recordAdConversion",
        "summary": "Record an ad conversion once per company",
        "description": "Signed-in dashboard session only. The dashboard calls it after sign up (sign_up) and after a checkout returns (purchase). The first call for an event records the time on the company, writes the audit entry company.ad_conversion, and answers fire true; every later call answers fire false and writes nothing. sign_up counts only for the owner of a company made in the last 7 days. purchase answers fire true only once the company has paid, with value_usd, the monthly price of its license in US dollars; before that it answers fire false and records nothing. WP Waterfall staff acting as the customer always get fire false. tx is an opaque hash for the ad platforms to drop a repeat report. Only with fire true does the dashboard report the conversion, through the public site and only when the visitor accepted advertising there.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdConversionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether this call is the first for the event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdConversionResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/public/vitals": {
      "post": {
        "tags": [
          "Web vitals"
        ],
        "operationId": "sendWebVitals",
        "security": [],
        "summary": "Report the web vitals of a marketing page",
        "description": "No sign-in, no cookie. Send a page path and up to five metrics (LCP, INP, CLS, FCP, TTFB) measured in the visitor's browser. A visitor who denied analytics, or whose browser sends Global Privacy Control, sends nothing. WP Waterfall keeps a count, a sum, and how many were good, needs improvement, or poor, for each page, metric, and day. It stores no address, no query string, and nothing that names the visitor, and it deletes rows after 90 days. Limited to 120 requests an hour per address. After 300 different pages in one day, new pages count as /other.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebVitalsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Received",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebVitalsResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many reports from this address",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/invitations/accept": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "operationId": "acceptInvitation",
        "summary": "Accept an invitation with its code",
        "description": "A signed-in session only. No API key may call it. The person signs in with the invited email address and sends the code from the invitation email. They join the company with the invited role, and a site role gets one membership for each invited site. An unknown code and a code for another address both answer 404, so a code never leaks.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptInvitationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The company the person joined",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "company_id": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "site_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "company_id",
                    "role",
                    "site_ids"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such invitation for this address",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The person already belongs to this company",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "The invitation has expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/users/me/step-up": {
      "get": {
        "tags": [
          "Me"
        ],
        "operationId": "getStepUpStatus",
        "summary": "Tell whether the session confirmed it is the person recently",
        "description": "A signed-in session only. No API key may call it. Answers whether this session passed the confirmation (the password, or a passkey that checks the person) in the last 10 minutes, and when that ends. The field password_set is false for a person who signs in with Google, GitHub, or a company identity provider only. The field passkey_available is true when the person has a passkey that checks them. The field proof_available is true when either can confirm: a person who has neither cannot confirm and is not asked. The field recent_sign_in is true when the session started in the last 15 minutes, the time in which a person with neither can add a first passkey or a first password without more. After that they also send the 6 digit code emailed by POST /users/me/security/first-factor-code. The field google_only is true for a person who signs in with Google and has no password or passkey: they confirm with Google. The field google_fresh is true when that Google sign in began this session in the last 10 minutes, and then fresh is true too. The field expires_at is when the confirmation ends, for the password, a passkey, and Google alike. The field seconds_left is the whole seconds until then by the server's clock, and 0 when the session is not fresh. The dashboard reads both when a tool that needs a confirmation opens, so it asks before the person types and not after (ADR 301). It changes nothing. The hosted MCP server reads it before it accepts an approval from a person who has two-factor authentication on and a way to confirm.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Whether the confirmation is still fresh",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fresh": {
                      "type": "boolean"
                    },
                    "expires_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "seconds_left": {
                      "type": "integer"
                    },
                    "password_set": {
                      "type": "boolean"
                    },
                    "passkey_available": {
                      "type": "boolean"
                    },
                    "proof_available": {
                      "type": "boolean"
                    },
                    "recent_sign_in": {
                      "type": "boolean"
                    },
                    "google_only": {
                      "type": "boolean"
                    },
                    "google_fresh": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "fresh",
                    "expires_at",
                    "seconds_left",
                    "password_set",
                    "passkey_available",
                    "proof_available",
                    "recent_sign_in",
                    "google_only",
                    "google_fresh"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "tags": [
          "Me"
        ],
        "operationId": "stepUp",
        "summary": "Confirm the password for a sensitive action",
        "description": "A signed-in session only. No API key may call it. Marks the session as freshly signed in for 10 minutes, which credential reveals and similar actions need. Wrong passwords are counted per session, and too many answer 429.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepUpRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "When the confirmation was recorded and when it ends",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verified_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "verified_at",
                    "expires_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The password is not right",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many wrong passwords. Try again in a few minutes",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/users/me/step-up/passkey/options": {
      "post": {
        "tags": [
          "Me"
        ],
        "operationId": "startStepUpWithPasskey",
        "summary": "Start confirming with a passkey",
        "description": "A signed-in session only. No API key may call it. For a person who has a passkey that checks them (PIN, fingerprint, or face), including a person who signs in with Google, GitHub, or a company identity provider and has no password. Answers the WebAuthn options for the browser. The challenge is made by the server, works once, lasts three minutes, and is bound to this session (and to the acting session when staff act as a customer). It needs a browser.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "WebAuthn options",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "options": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "options"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "No passkey that checks the person is set up",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many wrong answers. Try again in a few minutes",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/users/me/step-up/passkey": {
      "post": {
        "tags": [
          "Me"
        ],
        "operationId": "stepUpWithPasskey",
        "summary": "Confirm with a passkey for a sensitive action",
        "description": "A signed-in session only. No API key may call it. Checks the browser's WebAuthn answer against the saved key, the origin, the relying party id, the counter, and that the authenticator checked the person. A right answer marks the session as freshly signed in for 10 minutes, the same as the password does. A wrong answer is counted with the wrong passwords and answers 403 with the code passkey_failed.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepUpPasskeyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "When the confirmation was recorded and when it ends",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verified_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "verified_at",
                    "expires_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The passkey did not work",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many wrong answers. Try again in a few minutes",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/referrals/links/{code}": {
      "get": {
        "tags": [
          "Referral invite"
        ],
        "operationId": "followReferralLink",
        "summary": "Follow a referral link",
        "description": "No sign-in. Records the click, sets the first-party referral cookie unless one is already set, and redirects with 302 to the sign-up page with ?ref. An unknown code still redirects to the marketing site, and sets nothing. Limited per address.",
        "security": [],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the sign-up page or the marketing site",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many visits from this address",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The program is not set up on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/referrals/visits": {
      "post": {
        "tags": [
          "Referral invite"
        ],
        "operationId": "recordReferralVisit",
        "summary": "Record a visit that arrived with a referral code",
        "description": "No sign-in. The dashboard posts the code from ?ref once. The answer sets the same first-party cookie as the referral link and never moves the browser. recorded is false for an unknown or switched off code, and when an earlier referral stands. Limited per address.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralVisitRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether the visit was recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralVisitResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "The code is missing or too long",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many visits from this address",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The program is not set up on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/assistant/messages": {
      "post": {
        "tags": [
          "Assistant"
        ],
        "operationId": "askAssistant",
        "summary": "Ask the dashboard assistant a question",
        "description": "A signed-in session only. No API key may call it. The assistant answers with reads that run as the caller's own session, so it sees what the caller sees. It answers 503 until the model is set up on the server.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantMessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer, with the reads it used and the ones it refused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantAnswer"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The session has no active company",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "The assistant is not set up on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/sandbox": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "getSandbox",
        "summary": "Whether this company is a sandbox, and when it was last reset",
        "description": "Test mode. Answers sandbox false for a normal company. Test keys work in a sandbox company and nowhere else. A sandbox keeps its sites until an Owner or Admin resets it. A key needs the sites:read scope.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The sandbox state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The caller may not read sites",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/sandbox/reset": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "resetSandbox",
        "summary": "Reset the sandbox now",
        "description": "A signed-in session only. No API key may call it. For an Owner or Admin of a sandbox company. Removes the sandbox's sites and seeds it again. A company that is not a sandbox answers 404.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The reset that ran",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxReset"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The caller may not delete sites",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "This company is not a sandbox",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/companies/me/add-ons/bulk": {
      "post": {
        "tags": [
          "Company add-ons"
        ],
        "operationId": "bulkChangeAddons",
        "summary": "Add or remove an add-on on many targets at once",
        "description": "A signed-in session only. No API key may call it. Needs an Owner, an Admin, or a Billing user. Up to 200 targets. add needs addon_key and, for a per environment add-on, an environment_id on each target. remove needs an addon_id on each target. Answers 202 with one child job for each change that touches a node, and the amount of each line.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkAddonRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The group and its child jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "group_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "add",
                        "remove"
                      ]
                    },
                    "preview_cents": {
                      "type": "integer"
                    },
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "company_id": {
                            "type": "string"
                          },
                          "addon_id": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "amount_cents": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "company_id",
                          "addon_id",
                          "amount_cents"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "children": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "company_id": {
                            "type": "string"
                          },
                          "addon_id": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "job_id": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "company_id",
                          "addon_id",
                          "job_id"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "group_id",
                    "action",
                    "preview_cents",
                    "lines",
                    "children"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The caller may not change billing",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "One of the add-ons is already off",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "A target or the add-on is not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/companies/me/dedicated": {
      "get": {
        "tags": [
          "Dedicated nodes"
        ],
        "operationId": "listDedicated",
        "summary": "This company's dedicated nodes and older quotes",
        "description": "A signed-in session only. No API key may call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Quotes and nodes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "quotes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "region": {
                            "type": "string"
                          },
                          "shape": {
                            "type": "string"
                          },
                          "monthly_cents": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "expires_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "purchased_at": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "region",
                          "shape",
                          "monthly_cents",
                          "status",
                          "created_at",
                          "expires_at",
                          "purchased_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nodes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "quote_id": {
                            "type": "string"
                          },
                          "node_id": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "region": {
                            "type": "string"
                          },
                          "shape": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "staff_approval_required": {
                            "type": "boolean"
                          },
                          "staff_approved_at": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "progress_note": {
                            "oneOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "job_id": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "id",
                          "quote_id",
                          "node_id",
                          "region",
                          "shape",
                          "status",
                          "staff_approval_required",
                          "staff_approved_at",
                          "progress_note",
                          "job_id",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "quotes",
                    "nodes"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/nodes/{id}/disaster-recovery": {
      "post": {
        "tags": [
          "Dedicated nodes"
        ],
        "operationId": "enableDisasterRecovery",
        "summary": "Turn on disaster recovery for a node the company owns",
        "description": "A signed-in session only. No API key may call it. Needs billing access. Sets up a standby bucket in another region and schedules a restore test.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the server."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisasterRecoveryRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The disaster recovery setup",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "node_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "standby_region": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "bucket_name": {
                      "type": "string"
                    },
                    "proration_cents": {
                      "type": "integer"
                    },
                    "restore_test": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "cadence": {
                          "type": "string"
                        },
                        "next_run_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "id",
                        "cadence",
                        "next_run_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "node_id",
                    "standby_region",
                    "provider",
                    "bucket_name",
                    "proration_cents",
                    "restore_test"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The caller may not spend money",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such node in this company",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Disaster recovery is already on for this node, or not on sale",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/sites/{id}/transfer": {
      "get": {
        "tags": [
          "Transfers"
        ],
        "operationId": "getOpenSiteTransfer",
        "summary": "The open transfer of a site",
        "description": "A signed-in session only. No API key may call it. Owner only. `pending` is the transfer that waits for the receiving Owner or is moving the site, or null when none is open. `available` is false while the server cannot move a site to another company yet; starting a transfer then answers 503. `blocked` is the first reason the site cannot transfer now (a test site, a job running, a pause, a dedicated server, Standby Failover, an additional preview environment, a migration, a server move, or a takedown), or null. `domains` lists the custom domains that move with the site. A domain with `dns_stays` true has its DNS records in the sending company's hosted zone: the zone stays there, the records keep routing the domain, and the receiving company sees it as a domain with DNS outside its account. It is no reason to block a transfer.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          }
        ],
        "responses": {
          "200": {
            "description": "The open transfer, if any, whether the server can move a site yet, what blocks it, and the custom domains that move with the site",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pending": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "site_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "from_company_id": {
                              "type": "string"
                            },
                            "to_company_id": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "to_owner_email": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "awaiting_receiver",
                                "moving",
                                "completed",
                                "cancelled",
                                "declined",
                                "failed"
                              ]
                            },
                            "step": {
                              "type": "string",
                              "enum": [
                                "waiting",
                                "preparing",
                                "copying",
                                "labeling",
                                "moving",
                                "finishing",
                                "done"
                              ]
                            },
                            "sender_confirmed_at": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "receiver_confirmed_at": {
                              "oneOf": [
                                {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "completed_at": {
                              "oneOf": [
                                {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "expires_at": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "job_id": {
                              "oneOf": [
                                {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "created_at": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "addons_ended": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "addon_key": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "addon_key",
                                  "name"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "error": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "site_id",
                            "from_company_id",
                            "to_company_id",
                            "to_owner_email",
                            "status",
                            "step",
                            "sender_confirmed_at",
                            "receiver_confirmed_at",
                            "completed_at",
                            "expires_at",
                            "job_id",
                            "created_at",
                            "addons_ended",
                            "error"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "available": {
                      "type": "boolean"
                    },
                    "blocked": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "hostname": {
                            "type": "string"
                          },
                          "dns_stays": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "hostname",
                          "dns_stays"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "dedicated_server": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "tier": {
                              "type": "string"
                            },
                            "region_name": {
                              "type": "string"
                            },
                            "monthly_cents": {
                              "type": "integer"
                            },
                            "first_invoice_at": {
                              "oneOf": [
                                {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "tier",
                            "region_name",
                            "monthly_cents",
                            "first_invoice_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "pending"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the Owner may read it",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such site",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "tags": [
          "Transfers"
        ],
        "operationId": "startSiteTransfer",
        "summary": "Start moving a site to another company",
        "description": "A signed-in session only. No API key may call it. Owner only, with a recent sign-in. With `to_owner_email` the sender confirms by starting it, and the Owner of the receiving company confirms by accepting. The site moves only when both have. With `to_company_id` the receiver is another account the same person owns: the server checks from the signed-in user and the database that they are an Owner of both companies, the receiving company is a different open company, and it has a free site license, and then it starts the move at once (status `moving`) with no second step. An Enterprise account has unlimited sites and buys one Single tier for each (ADR 273): when the receiving account is an Enterprise account with no free site license, the move buys the site's own 1 site license on that account's saved card at `tier` (left out, Single 20GB) at its level price, so it needs a card and billing details there. A license staff applied with a free slot is used first and buys nothing. `tier` goes with `to_company_id` only. An account the person does not own answers 404, the same as one that does not exist. Send exactly one of the two.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteTransferRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The transfer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "site_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "from_company_id": {
                      "type": "string"
                    },
                    "to_company_id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to_owner_email": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "awaiting_receiver",
                        "moving",
                        "completed",
                        "cancelled",
                        "declined",
                        "failed"
                      ]
                    },
                    "step": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "preparing",
                        "copying",
                        "labeling",
                        "moving",
                        "finishing",
                        "done"
                      ]
                    },
                    "sender_confirmed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receiver_confirmed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "job_id": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "addons_ended": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "addon_key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "addon_key",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "from_company_id",
                    "to_company_id",
                    "to_owner_email",
                    "status",
                    "step",
                    "sender_confirmed_at",
                    "receiver_confirmed_at",
                    "completed_at",
                    "expires_at",
                    "job_id",
                    "created_at",
                    "addons_ended",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The receiving account is not Enterprise and has no free site license (no_free_credit), or an invoice is open (billing_hold). Only with to_company_id",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Only the Owner may transfer a site",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such site, or (with to_company_id) no such account of yours",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The site cannot be transferred in its current state (code site_transfer_blocked), it already has an open transfer (site_transfer_open), or an Enterprise receiver has no saved card (no_payment_method) or billing details (billing_details_required) for the license",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Both or neither of to_owner_email and to_company_id were sent, to_company_id is the account the site is in, or tier was sent without to_company_id or for an account that is not Enterprise",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/site-transfers": {
      "get": {
        "tags": [
          "Transfers"
        ],
        "operationId": "listIncomingSiteTransfers",
        "summary": "Site transfers waiting for you",
        "description": "A signed-in session only. No API key may call it. Owner only. The transfers addressed to your email that wait for you to accept or that are moving a site into your company, and the ones that finished in the last 7 days, with the site and the sending company named.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "responses": {
          "200": {
            "description": "The transfers that wait",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "site_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "from_company_id": {
                            "type": "string"
                          },
                          "to_company_id": {
                            "oneOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "to_owner_email": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "awaiting_receiver",
                              "moving",
                              "completed",
                              "cancelled",
                              "declined",
                              "failed"
                            ]
                          },
                          "step": {
                            "type": "string",
                            "enum": [
                              "waiting",
                              "preparing",
                              "copying",
                              "labeling",
                              "moving",
                              "finishing",
                              "done"
                            ]
                          },
                          "sender_confirmed_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "receiver_confirmed_at": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "completed_at": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expires_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "job_id": {
                            "oneOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "addons_ended": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "addon_key": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "addon_key",
                                "name"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "error": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "site_name": {
                            "oneOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "from_company_name": {
                            "oneOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dedicated_server": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "tier": {
                                    "type": "string"
                                  },
                                  "region_name": {
                                    "type": "string"
                                  },
                                  "monthly_cents": {
                                    "type": "integer"
                                  },
                                  "first_invoice_at": {
                                    "oneOf": [
                                      {
                                        "type": "string",
                                        "format": "date-time"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "tier",
                                  "region_name",
                                  "monthly_cents",
                                  "first_invoice_at"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "site_id",
                          "from_company_id",
                          "to_company_id",
                          "to_owner_email",
                          "status",
                          "step",
                          "sender_confirmed_at",
                          "receiver_confirmed_at",
                          "completed_at",
                          "expires_at",
                          "job_id",
                          "created_at",
                          "addons_ended",
                          "error",
                          "site_name",
                          "from_company_name",
                          "dedicated_server"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the Owner may read them",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/site-transfers/destinations": {
      "get": {
        "tags": [
          "Transfers"
        ],
        "operationId": "listSiteTransferDestinations",
        "summary": "Your other accounts that can take a site",
        "description": "A signed-in session only. No API key may call it. Owner only. The open companies, other than the one you are in, that you are an Owner of by membership, each with the site licenses its plans have free (`free_site_licenses`, null for no limit) and whether an unpaid invoice holds it (`on_hold`). A site moves to one of them with `to_company_id` on the start, with no second acceptance. A company that is closed or being deleted is left out.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Your other accounts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteTransferDestinationList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the Owner may read them",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/site-transfers/{id}": {
      "get": {
        "tags": [
          "Transfers"
        ],
        "operationId": "getSiteTransfer",
        "summary": "One site transfer",
        "description": "A signed-in session only. No API key may call it. Owner only. A transfer the caller cannot see answers 404.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site transfer."
          }
        ],
        "responses": {
          "200": {
            "description": "The transfer, with the dedicated server that goes with the site",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "site_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "from_company_id": {
                      "type": "string"
                    },
                    "to_company_id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to_owner_email": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "awaiting_receiver",
                        "moving",
                        "completed",
                        "cancelled",
                        "declined",
                        "failed"
                      ]
                    },
                    "step": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "preparing",
                        "copying",
                        "labeling",
                        "moving",
                        "finishing",
                        "done"
                      ]
                    },
                    "sender_confirmed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receiver_confirmed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "job_id": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "addons_ended": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "addon_key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "addon_key",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dedicated_server": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "tier": {
                              "type": "string"
                            },
                            "region_name": {
                              "type": "string"
                            },
                            "monthly_cents": {
                              "type": "integer"
                            },
                            "first_invoice_at": {
                              "oneOf": [
                                {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "tier",
                            "region_name",
                            "monthly_cents",
                            "first_invoice_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "from_company_id",
                    "to_company_id",
                    "to_owner_email",
                    "status",
                    "step",
                    "sender_confirmed_at",
                    "receiver_confirmed_at",
                    "completed_at",
                    "expires_at",
                    "job_id",
                    "created_at",
                    "addons_ended",
                    "error",
                    "dedicated_server"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the Owner may read a transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "tags": [
          "Transfers"
        ],
        "operationId": "cancelSiteTransfer",
        "summary": "Cancel an open site transfer",
        "description": "A signed-in session only. No API key may call it. Owner only. Works while the transfer waits for the receiving Owner. Once that Owner accepted, the site is moving and the answer is 409 (site_transfer_moving).",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site transfer."
          }
        ],
        "responses": {
          "200": {
            "description": "The cancelled transfer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "site_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "from_company_id": {
                      "type": "string"
                    },
                    "to_company_id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to_owner_email": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "awaiting_receiver",
                        "moving",
                        "completed",
                        "cancelled",
                        "declined",
                        "failed"
                      ]
                    },
                    "step": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "preparing",
                        "copying",
                        "labeling",
                        "moving",
                        "finishing",
                        "done"
                      ]
                    },
                    "sender_confirmed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receiver_confirmed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "job_id": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "addons_ended": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "addon_key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "addon_key",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "from_company_id",
                    "to_company_id",
                    "to_owner_email",
                    "status",
                    "step",
                    "sender_confirmed_at",
                    "receiver_confirmed_at",
                    "completed_at",
                    "expires_at",
                    "job_id",
                    "created_at",
                    "addons_ended",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the Owner may cancel a transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The transfer is moving, or already done, declined, or cancelled",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/site-transfers/{id}/accept": {
      "post": {
        "tags": [
          "Transfers"
        ],
        "operationId": "acceptSiteTransfer",
        "summary": "Accept a site transfer",
        "description": "A signed-in session only. No API key may call it. Owner of the receiving company only, with a recent sign-in. It claims the transfer once and queues the `transfer_site` job; the answer is the transfer with status `moving`, and the site is the receiving company's when the job ends. A company that is not Enterprise and has no free site license gets 402 with the code no_free_credit and the transfer keeps waiting. An Enterprise company has unlimited sites and buys one Single tier for each (ADR 273): with no free site license, accepting buys the site's own 1 site license on the saved card at the level price, for the Single tier in the optional body `tier` (left out, Single 20GB), as `POST /v1/sites` does. It then needs a card and billing details, and answers the same 409 codes (no_payment_method, billing_details_required) with nothing charged and the transfer still waiting. A license staff applied with a free slot is used first and buys nothing. Any other company that sends `tier` gets 422.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site transfer."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptSiteTransferRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The accepted transfer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "site_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "from_company_id": {
                      "type": "string"
                    },
                    "to_company_id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to_owner_email": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "awaiting_receiver",
                        "moving",
                        "completed",
                        "cancelled",
                        "declined",
                        "failed"
                      ]
                    },
                    "step": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "preparing",
                        "copying",
                        "labeling",
                        "moving",
                        "finishing",
                        "done"
                      ]
                    },
                    "sender_confirmed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receiver_confirmed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "job_id": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "addons_ended": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "addon_key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "addon_key",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "from_company_id",
                    "to_company_id",
                    "to_owner_email",
                    "status",
                    "step",
                    "sender_confirmed_at",
                    "receiver_confirmed_at",
                    "completed_at",
                    "expires_at",
                    "job_id",
                    "created_at",
                    "addons_ended",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The receiving company is not Enterprise and has no free site license (no_free_credit), or an invoice is open (billing_hold)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Only the receiving Owner may accept",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The transfer is not waiting any more, the site cannot move now, the sender is no longer an Owner, the site left the sending company, or an Enterprise company has no saved card (no_payment_method) or billing details (billing_details_required) for the license",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "The transfer expired (site_transfer_expired)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "tier was sent for a company that is not Enterprise, or is not a tier",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/site-transfers/{id}/decline": {
      "post": {
        "tags": [
          "Transfers"
        ],
        "operationId": "declineSiteTransfer",
        "summary": "Decline a site transfer",
        "description": "A signed-in session only. No API key may call it. Owner of the receiving company only. The transfer ends, nothing moves, and the sender is told.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site transfer."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The declined transfer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "site_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "from_company_id": {
                      "type": "string"
                    },
                    "to_company_id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to_owner_email": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "awaiting_receiver",
                        "moving",
                        "completed",
                        "cancelled",
                        "declined",
                        "failed"
                      ]
                    },
                    "step": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "preparing",
                        "copying",
                        "labeling",
                        "moving",
                        "finishing",
                        "done"
                      ]
                    },
                    "sender_confirmed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receiver_confirmed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "job_id": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "addons_ended": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "addon_key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "addon_key",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "from_company_id",
                    "to_company_id",
                    "to_owner_email",
                    "status",
                    "step",
                    "sender_confirmed_at",
                    "receiver_confirmed_at",
                    "completed_at",
                    "expires_at",
                    "job_id",
                    "created_at",
                    "addons_ended",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the receiving Owner may decline",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The transfer is not waiting any more",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/site-transfers/{id}/retry": {
      "post": {
        "tags": [
          "Transfers"
        ],
        "operationId": "retrySiteTransfer",
        "summary": "Run a stopped site transfer again",
        "description": "A signed-in session only. No API key may call it. Owner of the receiving company only. For a transfer that is moving after the site changed company: it queues the next run of the job, which finishes what the last run left. Not within a minute of the last run.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site transfer."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The transfer, with the new run",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "site_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "from_company_id": {
                      "type": "string"
                    },
                    "to_company_id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to_owner_email": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "awaiting_receiver",
                        "moving",
                        "completed",
                        "cancelled",
                        "declined",
                        "failed"
                      ]
                    },
                    "step": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "preparing",
                        "copying",
                        "labeling",
                        "moving",
                        "finishing",
                        "done"
                      ]
                    },
                    "sender_confirmed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receiver_confirmed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "job_id": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "addons_ended": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "addon_key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "addon_key",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "from_company_id",
                    "to_company_id",
                    "to_owner_email",
                    "status",
                    "step",
                    "sender_confirmed_at",
                    "receiver_confirmed_at",
                    "completed_at",
                    "expires_at",
                    "job_id",
                    "created_at",
                    "addons_ended",
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the receiving Owner may run it again",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The transfer is not moving, or a run started a moment ago",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/domain-transfers": {
      "post": {
        "tags": [
          "Transfers"
        ],
        "operationId": "startDomainTransfer",
        "summary": "Start moving a DNS zone to another company",
        "description": "A signed-in session only. No API key may call it. Owner only. Both Owners confirm before the zone moves.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomainTransferRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The transfer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "zone"
                      ]
                    },
                    "object_id": {
                      "type": "string"
                    },
                    "from_company_id": {
                      "type": "string"
                    },
                    "to_company_id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to_owner_email": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "sender_confirmed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receiver_confirmed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "object_id",
                    "from_company_id",
                    "to_company_id",
                    "to_owner_email",
                    "status",
                    "sender_confirmed_at",
                    "receiver_confirmed_at",
                    "completed_at",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the Owner may transfer a zone",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such zone",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The zone cannot be transferred in its current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Only a DNS zone can be transferred",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/domain-transfers/{id}": {
      "get": {
        "tags": [
          "Transfers"
        ],
        "operationId": "getDomainTransfer",
        "summary": "One DNS zone transfer",
        "description": "A signed-in session only. No API key may call it. Owner only. A transfer the caller cannot see answers 404.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone transfer."
          }
        ],
        "responses": {
          "200": {
            "description": "The transfer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "zone"
                      ]
                    },
                    "object_id": {
                      "type": "string"
                    },
                    "from_company_id": {
                      "type": "string"
                    },
                    "to_company_id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to_owner_email": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "sender_confirmed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receiver_confirmed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "object_id",
                    "from_company_id",
                    "to_company_id",
                    "to_owner_email",
                    "status",
                    "sender_confirmed_at",
                    "receiver_confirmed_at",
                    "completed_at",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the Owner may read a transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/domain-transfers/{id}/accept": {
      "post": {
        "tags": [
          "Transfers"
        ],
        "operationId": "acceptDomainTransfer",
        "summary": "Accept a DNS zone transfer",
        "description": "A signed-in session only. No API key may call it. Owner of the receiving company only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone transfer."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The accepted transfer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "zone"
                      ]
                    },
                    "object_id": {
                      "type": "string"
                    },
                    "from_company_id": {
                      "type": "string"
                    },
                    "to_company_id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to_owner_email": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "sender_confirmed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "receiver_confirmed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completed_at": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "object_id",
                    "from_company_id",
                    "to_company_id",
                    "to_owner_email",
                    "status",
                    "sender_confirmed_at",
                    "receiver_confirmed_at",
                    "completed_at",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the receiving Owner may accept",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such transfer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The transfer is already done or cancelled",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/company/data-export": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "requestCompanyDataExport",
        "summary": "Request an export of the company data",
        "description": "Starts a job that builds one archive of the company data: JSON files and a README that explains each file. It holds no passwords, hashes, API key values, deploy keys, private keys, or card data. Only the company owner can ask, with a sign-in from the last 10 minutes (403 step-up-required otherwise). One request is allowed a day: a second one answers 429 with Retry-After. The archive stays 48 hours.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataExportRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataExport"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed, or a recent sign-in is needed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "One export a day",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "tags": [
          "Data rights"
        ],
        "operationId": "getCompanyDataExport",
        "summary": "The newest export of the company data",
        "description": "Status of the newest request and when the next one is allowed. It never holds a link: ask for one with the download-link call.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Export state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataExportState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/company/data-export/{id}/download-link": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "createCompanyDataExportLink",
        "summary": "Get a short lived download link for the company export",
        "description": "Signs a link that works for 15 minutes and writes an audit entry. The export must be ready and not expired.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the data export."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "A signed link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataExportLink"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed, or a recent sign-in is needed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such export",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The export is not ready",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "The export expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Downloads are not available on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/data-export": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "requestMyDataExport",
        "summary": "Request an export of your own data",
        "description": "Starts a job that builds one archive of your own data: JSON files and a README that explains each file. It holds no passwords, hashes, API key values, deploy keys, private keys, or card data. Only the signed in person can ask, with a sign-in from the last 10 minutes (403 step-up-required otherwise). One request is allowed a day: a second one answers 429 with Retry-After. The archive stays 48 hours.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataExportRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataExport"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed, or a recent sign-in is needed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "One export a day",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "tags": [
          "Data rights"
        ],
        "operationId": "getMyDataExport",
        "summary": "The newest export of your own data",
        "description": "Status of the newest request and when the next one is allowed. It never holds a link: ask for one with the download-link call.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Export state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataExportState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/data-export/{id}/download-link": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "createMyDataExportLink",
        "summary": "Get a short lived download link for your own export",
        "description": "Signs a link that works for 15 minutes and writes an audit entry. The export must be ready and not expired.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the data export."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "A signed link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataExportLink"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed, or a recent sign-in is needed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No such export",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The export is not ready",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "The export expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Downloads are not available on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/company": {
      "delete": {
        "tags": [
          "Data rights"
        ],
        "operationId": "deleteCompany",
        "summary": "Delete the company after a 30 day grace period",
        "description": "Owner only, for a business, with a sign-in from the last 10 minutes and the company name typed in `confirm`. While a plan is live the call answers 409 unless `cancel_plan=true` agrees to end it (at the end of the paid period, or now inside the 30 day money-back window). An unpaid invoice answers 409 until it is paid. After the grace period the company is erased in a fixed order and only invoices and payment records stay, with the personal data removed. The owner can undo it until then.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "confirm",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cancel_plan",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Deletion scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyDeletion"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the owner can delete the company",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "A live plan or an unpaid invoice stops the deletion",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The typed name does not match",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/company/deletion-request": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "requestCompanyErase",
        "summary": "Ask to erase the business now and email a confirmation link",
        "description": "Erase now (ADR 320). Owner only, for a business, with a sign-in from the last 10 minutes and the business name typed in `confirm`, as Delete business asks. Sends one single use link to the owner's address, valid for 60 minutes. Nothing changes on the business until the link is confirmed. The same limits as the account link apply: 60 seconds between emails and 5 an hour (429). Answers 409 with a plain sentence while an invoice is unpaid, a dedicated server remains (a yearly or 3 year one cannot end early), or a site runs on its standby. Session only: no API key and no MCP tool.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyEraseRequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The email was sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionRequest"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the business owner, with a recent sign-in",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Something must be settled first, or a deletion already waits",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The typed name does not match",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many emails, or one was sent less than a minute ago",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The email could not be sent",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/company/deletion-request/preview": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "previewCompanyErase",
        "summary": "See what erasing the business now does",
        "description": "The owner named in the email sends the token. Changes nothing. Answers the business, what it holds, and the day the erase starts.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountDeletionLinkBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What goes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyErasePreview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The link is not for this person, or it is not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Something must be settled first",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "The link expired or was used",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/company/deletion-confirm": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "confirmCompanyErase",
        "summary": "Confirm erasing the business now",
        "description": "The owner named in the email sends the token, with a sign-in from the last 10 minutes, and the link works once. Every subscription and recurring charge of the business ends now with no proration and no refund, even a prepaid term, and no account credit is paid back. Standby Failover stops and its standby is released. Every member is emailed once. The 30 day wait starts today, and the owner can undo the deletion until it ends; an undo does not bring back a plan that ended. Session only: no API key and no MCP tool.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountDeletionLinkBody"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Deletion scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyDeletion"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Only the business owner, with a recent sign-in",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "The link is not for this person, or it is not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Something must be settled first, or a deletion already waits",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "The link expired or was used",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/users/me/deletion-request": {
      "get": {
        "tags": [
          "Data rights"
        ],
        "operationId": "getAccountDeletion",
        "summary": "Where you are on deleting your account",
        "description": "Says whether a confirmation link was sent and still works, and whether the erase of your personal workspace is scheduled and can be undone.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "requestAccountDeletion",
        "summary": "Ask to delete your account and email a confirmation link",
        "description": "Needs a sign-in from the last 10 minutes and your account address typed in `email`. Sends one single use link to that address, valid for 60 minutes, and retires an older link. Nothing changes on the account until the link is confirmed. The same call sends the link again: it waits 60 seconds after the last email and allows 5 emails an hour (429 with Retry-After). A staff account cannot be deleted (403). Session only: no API key and no MCP tool.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountDeletionRequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The email was sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionRequest"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "A staff account, or a recent sign-in is needed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Something must be settled first: the only Owner of a business, an unpaid invoice, or a dedicated server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The typed address does not match the account",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many emails, or one was sent less than a minute ago",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The email could not be sent",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "delete": {
        "tags": [
          "Data rights"
        ],
        "operationId": "cancelAccountDeletionRequest",
        "summary": "Cancel the confirmation link",
        "description": "Retires the link that was sent. Nothing had changed on the account.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Cancelled",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/deletion-request/preview": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "previewAccountDeletion",
        "summary": "See what deleting your account removes",
        "description": "The signed in person named in the email sends the token. Changes nothing. Answers the personal workspace with its counts, the businesses you leave, and the day the erase starts.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountDeletionLinkBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What goes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionPreview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The link is not for this account, or it is not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Something must be settled first",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "The link expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/users/me/deletion-confirm": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "confirmAccountDeletion",
        "summary": "Confirm deleting your account",
        "description": "The signed in person named in the email sends the token, and the link works once. By default subscriptions end at the end of the term already paid with no refund, and the 30 day wait starts then. With erase_now (ADR 320) every subscription ends now with no refund for the time left, even a prepaid term, and the 30 day wait starts today; erase_now also needs a sign in from the last 10 minutes. Either way the personal workspace is scheduled for the erase of ADR 111 and can be undone until the wait ends; an undo does not bring back a plan that ended. You leave your businesses at once. The record of your account is erased at the end of that job. A person with no personal workspace is erased now. Session only: no API key and no MCP tool.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountDeletionConfirm"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Scheduled, or erased",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "A staff account cannot be deleted",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "The link is not for this account, or it is not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Something must be settled first",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "410": {
            "description": "The link expired or was used",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/users/me/company-deletions": {
      "get": {
        "tags": [
          "Data rights"
        ],
        "operationId": "listCompanyDeletions",
        "summary": "Companies you own that are waiting to be deleted",
        "description": "Works from any workspace, so an owner can find a company that is already closed.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Pending deletions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PendingCompanyDeletionList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ]
      }
    },
    "/users/me/company-deletions/{company_id}/undo": {
      "post": {
        "tags": [
          "Data rights"
        ],
        "operationId": "undoCompanyDeletion",
        "summary": "Undo the deletion of a company you own",
        "description": "Only before the erase starts. A plan that was set to end stays set to end until you keep it on the Plan page.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "company_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id of the company whose deletion to undo."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Deletion cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyDeletion"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No pending deletion for that company",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The erase already started",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/platform": {
      "get": {
        "tags": [
          "Platform"
        ],
        "operationId": "getPlatform",
        "summary": "What this deployment allows",
        "description": "Test sites, provisioning state, default region, the regions open for new sites, and how old Google's list prices are (price_refresh: the last successful refresh, its age in hours, and the 48 hour warning line).",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Platform settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Platform"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/roadmap": {
      "get": {
        "tags": [
          "Platform"
        ],
        "operationId": "getRoadmap",
        "summary": "The product roadmap",
        "description": "What is in progress, planned, and being considered, and what shipped recently, written for customers with no dates for future work. Every role in a company with an active plan may read it. A company with no plan gets 403.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Roadmap items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Roadmap"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/regions": {
      "get": {
        "tags": [
          "Regions"
        ],
        "operationId": "listRegions",
        "summary": "List regions",
        "description": "The data center locations a site may use, the default first. Every region where Google lists the node shape is open, and a plan costs the same in each (ADR 215). has_data_center is false when none runs there yet: the first site opens one (a few minutes) at no extra charge. Show label (the city, never the country), not the code. WP Waterfall staff also see regions that take no sites, with status closed and a closed_reason; a site there answers 422 region_closed. A region with status unavailable is open but cannot start a data center right now (the cloud account is at its quota): unavailable_reason says so, it stays listed, and a site there answers 409 region_unavailable before anything is charged: pick another location.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: at most 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Regions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegionList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/nodes": {
      "get": {
        "tags": [
          "Nodes"
        ],
        "operationId": "listNodes",
        "summary": "List nodes",
        "description": "Lists the servers your company owns, in pages of up to 200 (default 50). Filter with `region` and `status`.",
        "security": [
          {
            "bearerAuth": [
              "nodes:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "provisioning",
                "online",
                "degraded",
                "offline",
                "draining",
                "deleting"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "nodes:read",
        "x-wpwaterfall-permission": "nodes.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Nodes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/nodes/{id}": {
      "get": {
        "tags": [
          "Nodes"
        ],
        "operationId": "getNode",
        "summary": "Get a node",
        "description": "Returns one server your company owns: its name, region, status, addresses, agent version, capacity, and what is allocated on it. A server that is not your company's answers 404.",
        "security": [
          {
            "bearerAuth": [
              "nodes:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the server."
          }
        ],
        "x-wpwaterfall-scope": "nodes:read",
        "x-wpwaterfall-permission": "nodes.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Node",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Node"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/nodes/{id}/capacity": {
      "get": {
        "tags": [
          "Nodes"
        ],
        "operationId": "getNodeCapacity",
        "summary": "Node capacity and headroom",
        "description": "Returns the server's `capacity`, what is `allocated`, and what is `available`: capacity minus the allocation minus the 20% headroom, never below zero. `accepting_sites` says whether new sites may land on it. A server that is not your company's answers 404.",
        "security": [
          {
            "bearerAuth": [
              "nodes:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the server."
          }
        ],
        "x-wpwaterfall-scope": "nodes:read",
        "x-wpwaterfall-permission": "nodes.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Capacity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeCapacity"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "listSites",
        "summary": "List sites",
        "description": "Filter by label, region, node, PHP version, or a search term.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "label",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "node_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            }
          },
          {
            "name": "php",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "8.1",
                "8.2",
                "8.3",
                "8.4",
                "8.5"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "staging",
                "provisioning",
                "attention"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Sites",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteList"
                },
                "example": {
                  "data": [
                    {
                      "id": "01934f2a-7c1e-7d3b-9a52-6e8f1b2c3d4e",
                      "name": "Acme blog",
                      "slug": "acme-blog",
                      "status": "active",
                      "test": false,
                      "template": "fresh_wordpress",
                      "multisite_mode": null,
                      "labels": [
                        {
                          "id": "01934d10-aaaa-7bbb-8ccc-dddd0000eeee",
                          "name": "Clients",
                          "color": "#2563eb"
                        }
                      ],
                      "live_environment": {
                        "id": "01934f2a-7c1f-7a10-8b21-3c4d5e6f7a8b",
                        "node_id": "01934e10-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                        "node_name": "us-east4-a-01",
                        "region": "us-east4",
                        "php_version": "8.3",
                        "wordpress_version": "6.7.1",
                        "wordpress": "installed",
                        "temp_hostname": "acme-blog.wpwaterfall.dev",
                        "status": "live",
                        "disk_bytes": 734003200,
                        "health": "healthy",
                        "health_note": null,
                        "updates": null
                      },
                      "staging_environment": null,
                      "launch_state": "launched",
                      "provisioning_job_id": null,
                      "created_at": "2026-11-02T14:05:11.000Z",
                      "updated_at": "2026-11-10T09:12:40.000Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "createSite",
        "summary": "Create a site",
        "description": "Starts provisioning. Returns 402 with problem type payment-required when the company has no plan, unless `test` is true. Each site picks its own region, and a plan costs the same in every region, so one plan's sites may sit in different regions (ADR 215). A region that is not open answers 422 with the code region_closed. A region that cannot start a data center right now answers 409 with the code region_unavailable, before a site, a slot, or a charge exists. Site names are unique across all customers, compared by the same lowercase, DNS-safe label the temporary address uses, so `Elric`, `elric`, and `Elric!` are one name: a name whose label is taken answers 409 with the code site_name_taken (`That name is already taken. Choose another.`), and a reserved name (`www`, `api`, `live`, and the rest) answers 422 with the code site_name_reserved. Check a name first with GET /sites/name-available. PHP 8.1 and 8.2 are closed to new use, so a `php_version` of `8.1` or `8.2` answers 422 with the code php_version_end_of_life. Existing sites on them keep working, and only a migration (POST /migrations) may start a site on one. An Enterprise company's new site is always a sandbox (ADR 276): staging only, no site tier, no site license, no charge, and no saved card needed. A `subscription_id`, `tier`, or `sandbox` in the body of an Enterprise company's create answers 422 with the code sandbox_no_plan_at_create: leave them out, and choose the tier when you launch the site live. A `sandbox` field on an account that is not Enterprise answers 403 with the code sandbox_enterprise_only, because only Enterprise accounts have sandboxes; a `tier` there answers 422, because its site starts at the included tier.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.create",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSiteRequest"
              },
              "example": {
                "name": "Acme blog",
                "region": "us-east4",
                "php_version": "8.3"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "example": {
                  "id": "01934f2b-0d5e-7f61-9a72-8b9c0d1e2f3a",
                  "type": "provision_environment",
                  "status": "queued",
                  "environment_id": "01934f2a-7c1f-7a10-8b21-3c4d5e6f7a8b",
                  "site_id": "01934f2a-7c1e-7d3b-9a52-6e8f1b2c3d4e",
                  "node_id": "01934e10-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                  "group_id": null,
                  "progress": 0,
                  "attempts": 0,
                  "error": null,
                  "result": null,
                  "requested_by": {
                    "type": "api_key",
                    "id": "01934d00-1111-7222-8333-444455556666",
                    "label": "CI deploys"
                  },
                  "idempotency_key": "5f1c2a9e-8b7d-4e3f-9a61-2c4d8e0b7f13",
                  "created_at": "2026-11-10T09:15:00.000Z",
                  "started_at": null,
                  "finished_at": null,
                  "updated_at": "2026-11-10T09:15:00.000Z",
                  "site_name": "Acme blog"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/name-available": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "checkSiteName",
        "summary": "Check whether a site name is free",
        "description": "Answers `available` and the `label` the name gives, for the Add site and rename forms. A taken name answers `available: false` with the reason `taken` and never says who holds it. A reserved name answers the reason `reserved`. Send `site_id` when a site renames, so its own current name stays available to it. Needs a signed-in person or an API key, and answers 429 past 60 checks a minute for one caller.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "required": true
          },
          {
            "name": "site_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            },
            "description": "The site that renames. Its own current label stays available to it."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Availability of the name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteNameAvailability"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/rename-impact": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "getSiteRenameImpact",
        "summary": "Check what a rename does to the custom domains",
        "description": "Ask before a rename with `name`. A domain connected with A and AAAA records does not depend on the site name and is not listed. Only a domain that still has an older CNAME to the site's temporary address is: a rename removes that address at once, with no grace period. Each listed domain has `update: automatic` when WP Waterfall hosts its DNS and replaces the CNAME with the A and AAAA records during the rename, or `update: manual` when its DNS is at another provider and the customer must replace the CNAME with the records in `new_addresses`. `new_target` is always null. A name that is taken or reserved answers the same errors as the rename.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.update",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "What the rename changes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteRenameImpact"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "getSite",
        "summary": "Get a site",
        "description": "Returns one site. While WP Waterfall moves the site to another server the answer carries `move`, and while a rename changes the addresses of its environments it carries `address_job_id`, the job to watch.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Site",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Site"
                },
                "example": {
                  "id": "01934f2a-7c1e-7d3b-9a52-6e8f1b2c3d4e",
                  "name": "Acme blog",
                  "slug": "acme-blog",
                  "status": "active",
                  "test": false,
                  "template": "fresh_wordpress",
                  "multisite_mode": null,
                  "labels": [
                    {
                      "id": "01934d10-aaaa-7bbb-8ccc-dddd0000eeee",
                      "name": "Clients",
                      "color": "#2563eb"
                    }
                  ],
                  "live_environment": {
                    "id": "01934f2a-7c1f-7a10-8b21-3c4d5e6f7a8b",
                    "node_id": "01934e10-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                    "node_name": "us-east4-a-01",
                    "region": "us-east4",
                    "php_version": "8.3",
                    "wordpress_version": "6.7.1",
                    "wordpress": "installed",
                    "temp_hostname": "acme-blog.wpwaterfall.dev",
                    "status": "live",
                    "disk_bytes": 734003200,
                    "health": "healthy",
                    "health_note": null,
                    "updates": null
                  },
                  "staging_environment": null,
                  "launch_state": "launched",
                  "provisioning_job_id": null,
                  "created_at": "2026-11-02T14:05:11.000Z",
                  "updated_at": "2026-11-10T09:12:40.000Z"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "Sites"
        ],
        "operationId": "updateSite",
        "summary": "Rename a site or change its labels",
        "description": "A new name shows at once. The site's label follows the name, and a job (`rename_site`) moves the temporary address of every environment to the new label (`live-<label>`, `staging-<label>`, `<preview name>-<label>`, and the subsite addresses of a subdomain network) and runs a search and replace of the old address in each environment's database. The job's id is `address_job_id` on the site while it runs. The old temporary addresses stop resolving. A custom domain that is primary is not touched. A custom domain connected with A and AAAA records is not affected. A domain that still has an older CNAME to the old temporary address is: WP Waterfall replaces the CNAME with the A and AAAA records itself when it hosts the domain's DNS. For a domain with DNS at another provider the customer replaces the record, and `GET /sites/{id}/rename-impact` lists those before the rename. If the job fails, the site keeps its old name and addresses. A taken name answers 409 with the code site_name_taken, a reserved name 422 with site_name_reserved, and a site that is still being created answers 409.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSiteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Site",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Site"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Sites"
        ],
        "operationId": "deleteSite",
        "summary": "Delete a site",
        "description": "Deletes the site and its environments. Needs confirm=true; a signed-in person also sends confirm_name, the exact site name, and an API key that sends it must send it exactly. Returns 202 with a job when the site has a container on a node. Returns 204 with no body when nothing is left on a node (the site never reached one, or its node failed or was deleted): the site is gone at once.",
        "security": [
          {
            "bearerAuth": [
              "danger:destroy"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          },
          {
            "name": "confirm_name",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "description": "The site name, typed to confirm. A signed-in session must send it. API keys may."
          }
        ],
        "x-wpwaterfall-scope": "danger:destroy",
        "x-wpwaterfall-permission": "sites.delete",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/reset": {
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "resetSite",
        "summary": "Reset a site",
        "description": "Resets staging. The body repeats the site name. Before launch, staging is wiped and WordPress is installed again from the template. Once live runs, staging gets live's code, database, and uploads again, after a restore point of staging (reset staging). Live itself is never reset: `environment: live` answers 409 (live_is_immutable), because live changes only through a promote from staging or a restore.",
        "security": [
          {
            "bearerAuth": [
              "danger:destroy"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "danger:destroy",
        "x-wpwaterfall-permission": "sites.delete",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetSiteRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/php-performance": {
      "put": {
        "tags": [
          "Sites"
        ],
        "operationId": "setSitePhpPerformance",
        "summary": "Set PHP performance for the live environment",
        "description": "Sets `php_threads` (1 to 256) on the site's live environment and returns 202 with the Job. Send `php_pool_mb` as it is now: a different value answers 403. A thread count that does not fit the pool answers 422, and a site with no environment yet answers 409.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhpPerformance"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/environments": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "listSiteEnvironments",
        "summary": "List a site's environments",
        "description": "Lists the environments of one site (live, staging, and previews) with their state, in pages of up to 200.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Environments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvironmentList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "createEnvironment",
        "summary": "Create a staging or preview environment",
        "description": "Makes a Git branch with the same name as the environment from the last commit of the source environment's branch, clones its database and content store, replaces the hostname, and builds a release of the branch. The new environment starts in Git mode (a read-only release) unless code_mode is classic (SFTP mode). A source in SFTP mode with uncommitted changes answers 409: commit them first. The source defaults to the site's staging environment. Pick live as the source for a full copy of live's database and uploads. The names master, main, live, staging, and HEAD, a name with a slash, and a name ending in .lock answer 422, because the Git branch is the name. Every site includes its staging environment and 5 preview environments. The next preview environment is an additional one: the same environment, in one of the company's additional preview slots. A slot is a license for one additional preview at a time, set with PUT /billing/additional-previews. Without a free slot the call answers 409 with code additional_preview_slot_needed and creates nothing (GET /sites/{id}/environments/additional-preview-quote says whether a slot is free first). Slots cost nothing until an environment uses one. A site can have 25 additional preview environments. Returns the job. While the site's migration is in progress it answers 409 `site_migrating` and does nothing.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnvironmentRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/activity": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "listSiteActivity",
        "summary": "Activity for one site",
        "description": "Returns the audit entries of one site, in pages of up to 200 (default 50). Filter with `actor`, `actor_type`, `action`, `category`, `from`, `to`, and `q`, a search of up to 200 characters over the sentence, the action name, and the person. A member limited to some sites, and an API key, see IP addresses and browsers only on their own entries.",
        "security": [
          {
            "bearerAuth": [
              "activity:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "actor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "actor_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "user",
                "api_key",
                "mcp_agent",
                "system"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "logins",
                "users",
                "plugins",
                "content",
                "code",
                "domains",
                "settings"
              ]
            },
            "description": "Keeps one kind of action, such as `plugins`."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Matches the sentence, the action name, or the person, ignoring case."
          }
        ],
        "x-wpwaterfall-scope": "activity:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "This site's slice of the audit log",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditEventList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/members": {
      "get": {
        "tags": [
          "Sites"
        ],
        "operationId": "listSiteMembers",
        "summary": "List the people who belong to a site",
        "description": "Lists the people who hold a Site Admin or Site Developer role on this site, with their name, email, and role, in pages of up to 200 (default 50). Members with a company wide role reach every site and are not listed here.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: at most 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Site members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteMemberList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Sites"
        ],
        "operationId": "addSiteMember",
        "summary": "Give a company member access to a site",
        "description": "Gives a company member the `site_admin` or `site_developer` role on this site. Name the person with `user_id` or `email`. Someone who is not in the company answers 404 (invite them first), and a member with a company wide role answers 422 because they already reach every site. Answers 201 with the site member.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "site_members.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddSiteMemberRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Site member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteMember"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/members/{member_id}": {
      "patch": {
        "tags": [
          "Sites"
        ],
        "operationId": "updateSiteMember",
        "summary": "Change a site member's role",
        "description": "Changes the role a person holds on this site. `member_id` is the `id` of the site membership, not the user id. A lower role also takes away what only the higher role allowed on this site, such as the SSH keys and SFTP users the person made.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site member."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "site_members.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSiteMemberRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Site member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteMember"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Sites"
        ],
        "operationId": "deleteSiteMember",
        "summary": "Remove a person from one site",
        "description": "Removes only this site. The person stays in the company.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site member."
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "site_members.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "204": {
            "description": "Removed",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "getEnvironment",
        "summary": "Get an environment",
        "description": "Secrets are masked. Use the credentials endpoints to reveal them.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Environment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "Environments"
        ],
        "operationId": "updateEnvironment",
        "summary": "Change the PHP version",
        "description": "Rolls back automatically when the homepage returns a 5xx. Changing to PHP 8.1 or 8.2 answers 422 with the code php_version_end_of_life, because both are closed to new use. A site already on one can move to a newer version.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchEnvironmentRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Environments"
        ],
        "operationId": "deleteEnvironment",
        "summary": "Delete a preview environment",
        "description": "Keeps a snapshot for 30 days and keeps the Git branch unless delete_branch=true. Live and staging cannot be deleted this way: delete the site. A live environment whose launch failed can be deleted, so the owner can launch again. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "danger:destroy"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          },
          {
            "name": "delete_branch",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "default": "false"
            }
          }
        ],
        "x-wpwaterfall-scope": "danger:destroy",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/php-performance": {
      "put": {
        "tags": [
          "Environments"
        ],
        "operationId": "setPhpPerformance",
        "summary": "Set PHP threads and memory",
        "description": "Rebalances the threads and memory inside the environment's pool. A staging or preview environment runs the included profile, so its PHP performance is fixed: it answers 409 with the code environment_php_fixed. Live follows its plan's rules.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhpPerformance"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/webroot": {
      "put": {
        "tags": [
          "Environments"
        ],
        "operationId": "setWebroot",
        "summary": "Serve the site from a subfolder",
        "description": "Serves the site from `subfolder` and returns 202 with the Job. The folder cannot be wp-content or a folder inside its uploads or cache folder. Needs `confirm: true`, and answers 409 while the environment is still being created or is not running.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutWebrootRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/wordpress": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "getWordPressFact",
        "summary": "Whether WordPress is installed",
        "description": "ADR 172. `installed`, `not_installed`, or `unknown` (never checked, or the check could not tell), the version, and whether WordPress runs a Multisite network. When the stored answer is older than 5 minutes, the API asks the node again first (at most once at a time per environment, and never for a sleeping environment), so the dashboard calls this in the background when a site opens. Without WordPress, the WordPress-only routes answer 409 with the code wordpress_not_installed. `unknown` counts as installed. `update` (ADR 357) names the newest release of the major version the environment runs, when it runs an older one, and when WP Waterfall starts to install it. It comes from the platform's list of releases, which is read from wordpress.org every hour.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "What the node said",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WordPressFact"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/wordpress/check": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "checkWordPress",
        "summary": "Check for WordPress again",
        "description": "Asks the node now, whatever the age of the stored answer, and saves the answer. A read on the node: nothing on the site changes. A sleeping environment answers 409; wake it first. The node checks by itself after every deploy, promote, restore, import, copy, and file manager upload, every 10 minutes while WordPress is not installed, and every day otherwise. It also reads the list of WordPress releases from wordpress.org when the platform's copy is older than a minute (ADR 357), so `update` names a release that is minutes old. That read is shared by every site and every caller.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.update",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "What the node said",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WordPressFact"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/wake": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "wakeEnvironment",
        "summary": "Wake up a sleeping environment",
        "description": "Staging and previews stop after 30 minutes without use and start again on the first visit. This starts one now and answers with a job that finishes when the site answers (a few seconds). An environment that is awake finishes at once. Live never sleeps and answers 409.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/sleep": {
      "put": {
        "tags": [
          "Environments"
        ],
        "operationId": "setSleepSetting",
        "summary": "Turn Sleep when idle on or off",
        "description": "On by default for staging and previews. Only an additional preview environment can turn it off, because its resources are reserved; WP Waterfall staff can change any non live environment. Live answers 409: it never sleeps.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSleepSettingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The setting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SleepSetting"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/suspend": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "suspendEnvironment",
        "summary": "Suspend an environment",
        "description": "Owner and Admin only. The environment stops serving: every visitor sees a plain suspended page. Its files, database, domains, backups, and SSH and SFTP access stay as they were, and hosting charges continue. Undo it with POST /environments/{id}/resume. The live environment also needs confirm_name set to the exact site name. An environment that billing or a removed PHP version paused answers 409.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.delete",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuspendEnvironmentRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/resume": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "resumeEnvironment",
        "summary": "Resume a suspended environment",
        "description": "Owner and Admin only. The environment serves its site again. Answers with a job. An environment that billing or a removed PHP version paused answers 409.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.delete",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/credentials/rotate": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "rotateCredentials",
        "summary": "Rotate SFTP or database credentials",
        "description": "Makes new passwords for the `targets` you name: `sftp`, `database`, or both. Returns 202 with the Job. No response and no job event shows the new passwords: read them with the credentials endpoints. Needs `confirm: true`.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateCredentialsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/credentials/sftp": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "revealSftpCredentials",
        "summary": "Reveal SFTP credentials",
        "description": "Needs a recent sign-in. Session only. Every reveal is audited.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "credentials.reveal",
        "x-wpwaterfall-confirm": false,
        "x-wpwaterfall-step-up": true,
        "responses": {
          "200": {
            "description": "SFTP credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SftpCredentialsReveal"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/credentials/database": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "revealDatabaseCredentials",
        "summary": "Reveal database credentials",
        "description": "Needs a recent sign-in. Session only. Every reveal is audited.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "credentials.reveal",
        "x-wpwaterfall-confirm": false,
        "x-wpwaterfall-step-up": true,
        "responses": {
          "200": {
            "description": "Database credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseCredentialsReveal"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/ssh-keys": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "createSshKey",
        "summary": "Add an SSH key",
        "description": "Adds an OpenSSH public key to the environment and returns 202 with the Job that writes it to the server. Send a `name` of up to 80 characters and the `public_key`. A key that does not parse answers 422. A signed-in person needs a recent sign-in, and the call answers 409 while an outside repository is connected to the site.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "ssh.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSshKeyRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/ssh-keys/{key_id}": {
      "delete": {
        "tags": [
          "Environments"
        ],
        "operationId": "deleteSshKey",
        "summary": "Remove an SSH key",
        "description": "Removes the key from the environment and returns 202 with the Job. On staging or a preview, a key that is also on a member's account keeps working: only this environment's record of it goes. Answers 404 when the key is not on this environment.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the SSH key."
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "ssh.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api-keys": {
      "get": {
        "tags": [
          "API keys"
        ],
        "operationId": "listApiKeys",
        "summary": "List API keys",
        "description": "Lists the API keys of the signed-in person, whichever company is selected (ADR 211). A key belongs to a person and reaches all their companies or only the ones named in company_ids. The connection of an AI assistant may list them too when the person gave it the keys:read scope; the answer then marks the key the connection acts with (current) and the keys behind assistant connections (assistant_connection). A plain API key cannot call this route.",
        "security": [
          {
            "bearerAuth": [
              "keys:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: at most 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "keys:read",
        "x-wpwaterfall-permission": "api_keys.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "API keys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "API keys"
        ],
        "operationId": "createApiKey",
        "summary": "Create an API key",
        "description": "A signed-in person makes a key with any scope their role allows in at least one company the key reaches; what it may do in a company is decided by their role there on every call. Send company_ids to limit it to some companies, or leave it out for every company the person belongs to, now and later. A call with the key names its company in the X-Company-Id header (optional when the key reaches one). The connection of an AI assistant may make one when the person gave it the keys:write scope and sends confirm: true. A key made that way never holds more scopes than the connection or the person's role, never danger:destroy, and never a connection only scope (keys:read, keys:write, ssh-keys:read, ssh-keys:write). It always expires: 30 days when expires_at is left out, 365 days at most. The secret is shown once, in this answer. A plain API key cannot call this route.",
        "security": [
          {
            "bearerAuth": [
              "keys:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "keys:write",
        "x-wpwaterfall-permission": "api_keys.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The key, with its secret shown once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedApiKey"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/api-keys/{id}": {
      "delete": {
        "tags": [
          "API keys"
        ],
        "operationId": "revokeApiKey",
        "summary": "Revoke an API key",
        "description": "A signed-in person revokes one of their own keys. The connection of an AI assistant may revoke a key when it holds the keys:write scope and sends confirm=true. It cannot revoke the key behind another assistant connection. Revoking the key it acts with also ends its connection and needs confirm_self=true. A plain API key cannot call this route.",
        "security": [
          {
            "bearerAuth": [
              "keys:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the API key."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "The person's yes. A connection that revokes without it gets a 422. A session leaves it out."
          },
          {
            "name": "confirm_self",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Needed to revoke the key the connection itself acts with, which ends the connection."
          }
        ],
        "x-wpwaterfall-scope": "keys:write",
        "x-wpwaterfall-permission": "api_keys.write",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "204": {
            "description": "Revoked",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/users/me/ssh-keys": {
      "get": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "listAccountSshKeys",
        "summary": "List the SSH keys of your account",
        "description": "These keys work for Git over SSH on every staging and preview environment you may push code to (the code.deploy permission), in each company you belong to. A signed-in session, or an AI assistant connection with the ssh-keys:read scope. A plain API key cannot call this route.",
        "security": [
          {
            "bearerAuth": [
              "ssh-keys:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "ssh-keys:read",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Your SSH keys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSshKeyList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "createAccountSshKey",
        "summary": "Add an SSH key to your account",
        "description": "Checks the key, saves it, and queues one Change SSH settings job for each environment that should accept it (at most 100 per company; the rest follow when someone opens the Code panel). Needs a recent sign-in. A person keeps at most 20 keys. A signed-in session needs a recent sign-in. An AI assistant connection with the ssh-keys:write scope may add a key for the person who approved it when it sends confirm: true; the person gets a notice and an audit entry names the connection. A plain API key cannot call this route.",
        "security": [
          {
            "bearerAuth": [
              "ssh-keys:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "ssh-keys:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "x-wpwaterfall-step-up": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountSshKeyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The saved key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSshKey"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/users/me/ssh-keys/{key_id}": {
      "delete": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "deleteAccountSshKey",
        "summary": "Remove an SSH key from your account",
        "description": "Removes the key and queues a Change SSH settings job on each environment that accepted it, unless another key of the environment or of another member has the same fingerprint. A signed-in session needs a recent sign-in. An AI assistant connection with the ssh-keys:write scope may remove a key of the person who approved it when it sends confirm=true. A plain API key cannot call this route.",
        "security": [
          {
            "bearerAuth": [
              "ssh-keys:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the SSH key."
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "ssh-keys:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "x-wpwaterfall-step-up": true,
        "responses": {
          "204": {
            "description": "Removed",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/cache/clear": {
      "post": {
        "tags": [
          "Tools"
        ],
        "operationId": "clearCache",
        "summary": "Clear the server cache",
        "description": "Clears the page cache on the server and returns 202 with the Job. Send `paths` (up to 100) to clear only those paths, or leave it out to clear everything. To clear the edge cache as well, use POST /environments/{id}/cache/purge.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClearCacheRequest"
              },
              "example": {}
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "example": {
                  "id": "01934f2b-0d5e-7f61-9a72-8b9c0d1e2f3a",
                  "type": "clear_server_cache",
                  "status": "queued",
                  "environment_id": "01934f2a-7c1f-7a10-8b21-3c4d5e6f7a8b",
                  "site_id": "01934f2a-7c1e-7d3b-9a52-6e8f1b2c3d4e",
                  "node_id": "01934e10-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                  "group_id": null,
                  "progress": 0,
                  "attempts": 0,
                  "error": null,
                  "result": null,
                  "requested_by": {
                    "type": "api_key",
                    "id": "01934d00-1111-7222-8333-444455556666",
                    "label": "CI deploys"
                  },
                  "idempotency_key": "5f1c2a9e-8b7d-4e3f-9a61-2c4d8e0b7f13",
                  "created_at": "2026-11-10T09:15:00.000Z",
                  "started_at": null,
                  "finished_at": null,
                  "updated_at": "2026-11-10T09:15:00.000Z"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/php/restart": {
      "post": {
        "tags": [
          "Tools"
        ],
        "operationId": "restartPhp",
        "summary": "Restart PHP",
        "description": "Restarts PHP for the environment and returns 202 with the Job. The body is an empty object. An environment on a PHP version that WP Waterfall removed is refused: change its version first.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestartPhpRequest"
              },
              "example": {}
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "example": {
                  "id": "01934f2b-0d5e-7f61-9a72-8b9c0d1e2f3a",
                  "type": "restart_php",
                  "status": "queued",
                  "environment_id": "01934f2a-7c1f-7a10-8b21-3c4d5e6f7a8b",
                  "site_id": "01934f2a-7c1e-7d3b-9a52-6e8f1b2c3d4e",
                  "node_id": "01934e10-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                  "group_id": null,
                  "progress": 0,
                  "attempts": 0,
                  "error": null,
                  "result": null,
                  "requested_by": {
                    "type": "api_key",
                    "id": "01934d00-1111-7222-8333-444455556666",
                    "label": "CI deploys"
                  },
                  "idempotency_key": "5f1c2a9e-8b7d-4e3f-9a61-2c4d8e0b7f13",
                  "created_at": "2026-11-10T09:15:00.000Z",
                  "started_at": null,
                  "finished_at": null,
                  "updated_at": "2026-11-10T09:15:00.000Z"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/php-settings": {
      "put": {
        "tags": [
          "Tools"
        ],
        "operationId": "setPhpSettings",
        "summary": "Change PHP settings",
        "description": "Changing the PHP version to 8.1 or 8.2 answers 422 with the code php_version_end_of_life, because both are closed to new use. A site already on one can move to a newer version.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhpSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/search-replace": {
      "post": {
        "tags": [
          "Tools"
        ],
        "operationId": "searchReplace",
        "summary": "Search and replace in the database",
        "description": "dry_run defaults to true and returns per-table counts in the job result. A real run needs dry_run=false and confirm=true. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key applying the change (dry_run false) must say yes: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchReplaceRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/settings": {
      "patch": {
        "tags": [
          "Tools"
        ],
        "operationId": "updateToolSettings",
        "summary": "Change tool settings",
        "description": "WordPress debug mode, password protection, and stripping Set-Cookie from cached responses. When the body sets wp_debug, this needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolSettingsPatchRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/wp-cli": {
      "post": {
        "tags": [
          "Tools"
        ],
        "operationId": "runWpCli",
        "summary": "Run an allowlisted WP-CLI command",
        "description": "The allowlist applies at the API and again at the agent. Commands that are not allowed return 422 with a link to the docs. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WpCliRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/files/usage": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "getFilesUsage",
        "summary": "Disk usage breakdown",
        "description": "Measures the disk the environment uses now: `total_bytes`, the quota in `limit_bytes`, a breakdown by category, and the largest folders and files (`top` sets how many, 1 to 50, default 10). `warning` is `warn` from 90% of the quota and `full` at 100%. `overage` is set while the environment uses more disk than it has.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "files.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilesUsage"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/files": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "getFiles",
        "summary": "List a folder or read a text file",
        "description": "With `path` set to a folder (default `/`, the site folder) it returns `kind: directory` and the entries. With a text file it returns `kind: file` and the content, and a file that is too large or not text is refused. Opening wp-config.php needs a signed-in person who may reveal credentials and a recent sign-in: an API key gets 403.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "default": "/"
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "files.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Directory or file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilesGetResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "Files"
        ],
        "operationId": "updateFiles",
        "summary": "Edit a text file or rename a path",
        "description": "Code folders are read-only on live in Git mode. Uploads stay writable.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "files.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchFilesRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Files"
        ],
        "operationId": "deleteFiles",
        "summary": "Delete a file or folder",
        "description": "Deletes the file or folder at `path` and returns 202 with the Job. Set `recursive=true` for a folder and everything in it. The site folder itself answers 422. Code on a read-only release answers 409: there only the uploads and cache folders accept changes.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "required": true
          },
          {
            "name": "recursive",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "default": "false"
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "files.write",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/files/download": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "downloadFile",
        "summary": "Download a file",
        "description": "Returns one file. A file of up to 1 MB comes back inline as `content_base64`, and a larger one comes back as a short lived `url` with `expires_at`. The site folder itself answers 422. Downloading wp-config.php needs a signed-in person who may reveal credentials and a recent sign-in: an API key gets 403.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "files.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Inline content or a short lived URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDownload"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database": {
      "get": {
        "tags": [
          "Database"
        ],
        "operationId": "getDatabase",
        "summary": "Database details",
        "description": "Name, size, and largest tables. The password is masked.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Database",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseInfo"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/phpmyadmin-session": {
      "post": {
        "tags": [
          "Database"
        ],
        "operationId": "createPhpMyAdminSession",
        "summary": "Open phpMyAdmin",
        "description": "Returns the Job object plus a session. Open the URL after the job succeeds. The link signs in to this site's database only, works once, and expires after 60 seconds.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhpMyAdminSessionRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhpMyAdminSessionResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/tables": {
      "get": {
        "tags": [
          "Database"
        ],
        "operationId": "listDatabaseTables",
        "summary": "List tables",
        "description": "Tables and views with estimated rows, size, and engine.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Tables",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseTableList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/tables/{table}": {
      "get": {
        "tags": [
          "Database"
        ],
        "operationId": "getDatabaseTable",
        "summary": "Table structure",
        "description": "Columns with types, indexes, foreign keys, and the key columns that pick out one row.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "table",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The name of the database table."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Table structure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseTableSchema"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/tables/{table}/rows/query": {
      "post": {
        "tags": [
          "Database"
        ],
        "operationId": "queryDatabaseRows",
        "summary": "Read rows",
        "description": "One page of rows with sorting and column filters, built and quoted on the server. Long cells come back cut to 1,000 characters. Changes nothing.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "table",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The name of the database table."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseRowsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rows",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseRowsPage"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/tables/{table}/rows/cell": {
      "post": {
        "tags": [
          "Database"
        ],
        "operationId": "getDatabaseCell",
        "summary": "Read one full cell",
        "description": "The full value of one cell, up to 1 MB, picked by the row's key columns.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "table",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The name of the database table."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseCellRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cell",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseCell"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/tables/{table}/rows/export": {
      "post": {
        "tags": [
          "Database"
        ],
        "operationId": "exportDatabaseRows",
        "summary": "Export rows as CSV",
        "description": "The filtered and sorted rows of one table as CSV, up to 10,000 rows.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "table",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The name of the database table."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseExportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CSV file",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/tables/{table}/rows": {
      "post": {
        "tags": [
          "Database"
        ],
        "operationId": "changeDatabaseRows",
        "summary": "Insert, edit, or delete rows",
        "description": "Up to 100 changes in one job. Edits and deletes pick rows by their key columns. On live, send confirm=true. Returns the job.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "table",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The name of the database table."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseRowsChangeRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/query": {
      "post": {
        "tags": [
          "Database"
        ],
        "operationId": "queryDatabase",
        "summary": "Run a read-only SQL statement",
        "description": "One SELECT, SHOW, DESCRIBE, EXPLAIN, or WITH statement, run in a read-only transaction with an 8 second limit and at most 1,000 rows. A statement that changes data answers 422. Use the execute endpoint for those.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseQueryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseQueryResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/execute": {
      "post": {
        "tags": [
          "Database"
        ],
        "operationId": "executeDatabaseStatement",
        "summary": "Run a SQL statement that changes data",
        "description": "One statement, as the site's database user, with a time limit. On live, send confirm=true. Returns the job; its result holds the affected rows.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseExecuteRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/check": {
      "post": {
        "tags": [
          "Database"
        ],
        "operationId": "checkDatabase",
        "summary": "Check or repair the database",
        "description": "Checks the database tables, or repairs them with `mode: repair` (the default is `check`), and returns 202 with the Job. Send `tables` (up to 500 names) to limit the run to those tables.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseCheckRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/database/import": {
      "post": {
        "tags": [
          "Database"
        ],
        "operationId": "importDatabase",
        "summary": "Import SQL",
        "description": "Up to 1 GB. The file travels in the `file` part of the form.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DatabaseImportRequest"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "type": "string",
                        "format": "binary"
                      }
                    },
                    "required": [
                      "file"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/logs/{file}": {
      "get": {
        "tags": [
          "Logs"
        ],
        "operationId": "getLog",
        "summary": "Last lines of a log",
        "description": "error, access, cache, php-fpm, slow, or cron (the server cron log: one summary line per run and the output tail). Capped at 1000 lines.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "error",
                "access",
                "cache",
                "php-fpm",
                "slow",
                "cron"
              ]
            },
            "description": "Which log to read."
          },
          {
            "name": "lines",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 200
            }
          },
          {
            "name": "grep",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "debug",
                "info",
                "notice",
                "warning",
                "error",
                "critical"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "files.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Log lines",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogsResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/logs/{file}/stream": {
      "get": {
        "tags": [
          "Logs"
        ],
        "operationId": "streamLog",
        "summary": "Live tail of a log",
        "description": "Server-sent events. Each data field is a LogStreamEvent.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "error",
                "access",
                "cache",
                "php-fpm",
                "slow",
                "cron"
              ]
            },
            "description": "Which log to read."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "files.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/LogStreamEvent"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/logs/{file}/download": {
      "get": {
        "tags": [
          "Logs"
        ],
        "operationId": "downloadLog",
        "summary": "Download a log",
        "description": "Returns the end of one log as a plain text attachment. `file` is `error`, `access`, `cache`, `php-fpm`, `slow`, or `cron`. It sends the last 1,000 lines unless `lines` asks for fewer, and `grep` and `severity` filter the lines.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "error",
                "access",
                "cache",
                "php-fpm",
                "slow",
                "cron"
              ]
            },
            "description": "Which log to read."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "files.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Log file",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/network": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "getEnvironmentNetwork",
        "summary": "Read the WordPress Multisite network",
        "description": "Whether the environment is a network, its mode and host, and its subsites with a link to each (read only, from wp site list). A network counts as one site against the plan. A single site answers enabled false. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The network",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvironmentNetwork"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cron": {
      "get": {
        "tags": [
          "Cron"
        ],
        "operationId": "listCronJobs",
        "summary": "List cron jobs",
        "description": "Includes the last run result. Output stays for 7 days.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Cron jobs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronJobList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Cron"
        ],
        "operationId": "createCronJob",
        "summary": "Add a cron job",
        "description": "Schedules more often than every 5 minutes return 422 with an explanation. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "cron.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCronJobRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cron/{cron_id}": {
      "patch": {
        "tags": [
          "Cron"
        ],
        "operationId": "updateCronJob",
        "summary": "Edit or pause a cron job",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "cron_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the cron job."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "cron.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchCronJobRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "description": "Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed."
      },
      "delete": {
        "tags": [
          "Cron"
        ],
        "operationId": "deleteCronJob",
        "summary": "Delete a cron job",
        "description": "Deletes the cron job and returns 202 with the Job that writes the environment's crontab again.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "cron_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the cron job."
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "cron.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/wp-admin-login": {
      "post": {
        "tags": [
          "Cron"
        ],
        "operationId": "createWpAdminLogin",
        "summary": "One-click wp-admin",
        "description": "Returns the Job object plus a login link. The link works once and expires after 60 seconds. Open it after the job succeeds. While one click login is off for the environment, answers 409 with the code auto_login_disabled and makes no job and no link. When no WordPress user has the email of a member who signs in as themself and may manage WordPress users, the job creates an administrator marked as made by WP Waterfall before it signs in (user_created is true in the job result). Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WpAdminLoginRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WpAdminLoginResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/auto-login": {
      "put": {
        "tags": [
          "Cron"
        ],
        "operationId": "setAutoLoginEnabled",
        "summary": "Turn one click login on or off",
        "description": "Switches the Log in to WP Admin button of the environment on or off. Off, the API makes no login links, and the apply_nginx_settings job tells the site to refuse its one click login address and deletes any login tickets not yet used. The WordPress login page works either way. On also queues a wp_login_user_ensure job that creates an administrator for the caller when no WordPress user has their email (only for a caller who may manage WordPress users; an existing user is never changed). Off also queues a wp_login_users_remove job that deletes only the users WP Waterfall created this way (wp-users shows created_by_platform), moves their content to another administrator, and keeps one that is the only administrator. Both run as their own jobs. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutAutoLoginEnabledRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/block-xmlrpc": {
      "put": {
        "tags": [
          "Cron"
        ],
        "operationId": "setBlockXmlrpc",
        "summary": "Block or allow XML-RPC",
        "description": "Live environments only; staging and preview environments always block it and answer 409. On (the default for every site), the site's web server answers 403 at /xmlrpc.php. Off lets it through for Jetpack, the WordPress mobile apps, or another client that needs it; the node still rate limits it. Saved as tool_settings.block_xmlrpc and applied by the apply_nginx_settings job. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutBlockXmlrpcRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/speed": {
      "put": {
        "tags": [
          "Tools"
        ],
        "operationId": "setSpeedOptimizations",
        "summary": "Change speed optimizations",
        "description": "Turns the speed optimizations of the environment on or off, each on its own: remove_jquery_migrate (the front end loads jQuery without jQuery Migrate; wp-admin, the login page, the Customizer, and a script that asks for jquery-migrate by name keep it), preload (front end pages send Link rel=preload headers for the same site stylesheets and scripts in the head, at most 6, which Cloudflare answers as 103 Early Hints; signed in people get none), and defer (front end scripts, jQuery included, load with defer, except scripts that have inline code or that inline code depends on). A part left out keeps its value; send at least one. A site created after this feature shipped starts with remove_jquery_migrate and preload on; older sites and the new site of a migration start with all off. Saved as tool_settings.speed. The apply_edge_settings job tells the site's web server and clears the site's caches. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSpeedOptimizationsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/server-cron": {
      "put": {
        "tags": [
          "Cron"
        ],
        "operationId": "setServerCronEnabled",
        "summary": "Turn Server cron on or off",
        "description": "On, adds one cron job that runs WordPress's due events (wp cron event run --due-now) every 15 minutes, and a cron_sync job writes the container crontab. The interval is 15 minutes unless support set another one for this environment; a customer cannot choose it. A job of yours that already runs wp cron event run counts, and no second one is added. Off, removes the job the tool made and keeps any you changed. Off is the default: WP Waterfall's standard schedule applies (every 15 minutes on live; staging and previews run none until you add a job). GET /environments/{id}/cron says which cron runs in wp_cron.method and how often in wp_cron.interval_minutes. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "cron.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutServerCronEnabledRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/jobs": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "listJobs",
        "summary": "List jobs",
        "description": "Lists the company's jobs in pages of up to 200 (default 50). Filter with `status`, `open=true` (not finished yet), `type`, `environment_id`, `site_id`, and `group_id`. Quiet jobs, such as a cron sync, are left out unless you send `include_quiet=true` or name a `type` or a `group_id`. A member limited to some sites sees the jobs of those sites only.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "dispatched",
                "running",
                "succeeded",
                "failed",
                "cancelled"
              ]
            }
          },
          {
            "name": "open",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "description": "`true` lists only jobs that have not finished (queued, dispatched, or running). A screen asks for it with `environment_id` to show which tools are busy, also after a page reload."
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "provision_environment",
                "delete_environment",
                "set_php_version",
                "set_php_performance",
                "set_php_settings",
                "restart_php",
                "clear_server_cache",
                "search_replace",
                "run_wp_cli",
                "rotate_credentials",
                "apply_nginx_settings",
                "db_import",
                "cron_sync",
                "build_release",
                "activate_release",
                "create_repository",
                "create_node",
                "drain_node",
                "delete_node",
                "purchase_cud",
                "files_write",
                "files_delete",
                "files_rename",
                "phpmyadmin_session",
                "db_check",
                "db_rows_write",
                "db_sql_execute",
                "ssh_update",
                "sftp_account_change",
                "tool_setting",
                "wp_user_create",
                "set_code_mode",
                "env_var_set",
                "env_var_delete",
                "reset_site",
                "set_webroot",
                "set_wp_secrets_key",
                "wp_admin_login_token",
                "wp_login_user_ensure",
                "wp_login_users_remove",
                "repo_commit_read",
                "create_preview_environment",
                "clone_content",
                "merge_branch",
                "create_snapshot",
                "restore_snapshot",
                "set_apm",
                "push_content",
                "commit_branch",
                "sync_working_tree",
                "issue_certificate",
                "register_hostname",
                "unregister_hostname",
                "object_cache_set",
                "patchstack_credentials_write",
                "patchstack_credentials_remove",
                "patchstack_kill_switch",
                "set_disk_quota",
                "prepare_standby",
                "start_replication",
                "verify_replica",
                "fence_site",
                "resync_replica",
                "set_site_suspension",
                "clear_log",
                "promote_environment",
                "copy_into_live",
                "auto_update_run",
                "delete_snapshot",
                "prune_snapshots",
                "backup_download",
                "configure_git_remote",
                "import_git_push",
                "pull_external_git",
                "offsite_backup_test",
                "offsite_backup_run",
                "offsite_backup_list",
                "offsite_backup_restore",
                "restart_service",
                "container_exec",
                "set_network_domain",
                "map_subsite_domain",
                "reap_orphan_containers",
                "migrate_container",
                "migrate_control",
                "migrate_export",
                "migrate_import",
                "migrate_precopy",
                "migrate_delta",
                "migrate_freeze",
                "migrate_thaw",
                "update_mu_plugin",
                "import_site_files",
                "wake_environment",
                "set_sleep_policy",
                "integrity_check",
                "malware_scan",
                "malware_restore",
                "container_images",
                "rebuild_container",
                "update_runtime_image",
                "node_reboot_status",
                "schedule_node_reboot",
                "reboot_node",
                "core_update_commit",
                "core_update_advance",
                "core_update_run",
                "takedown_environment",
                "release_takedown",
                "set_egress",
                "set_standby_hold",
                "copy_evidence",
                "drop_evidence",
                "transfer_site",
                "relabel_environment",
                "record_site_facts",
                "attach_domain",
                "remove_domain",
                "set_primary_domain",
                "apply_redirects",
                "apply_ip_rules",
                "apply_bot_protection",
                "purge_cache",
                "apply_edge_settings",
                "provision_dns_zone",
                "refresh_ssl",
                "set_edge_certificate",
                "remove_edge_certificate",
                "rename_site",
                "rename_temp_hostname",
                "network_sync",
                "migration_fetch",
                "migration_inspect",
                "migration_triage",
                "migration_import",
                "migration_move",
                "export_company_data",
                "export_user_data",
                "export_audit_log",
                "purge_company",
                "reseal_secrets",
                "run_pagespeed",
                "patchstack_provision",
                "patchstack_deprovision",
                "patchstack_reconcile",
                "wp_login_member_users_remove",
                "provision_standby",
                "failover_site",
                "failback_site",
                "accessibility_scan"
              ]
            }
          },
          {
            "name": "environment_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            }
          },
          {
            "name": "site_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            }
          },
          {
            "name": "group_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            }
          },
          {
            "name": "include_quiet",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "description": "`true` also lists quiet jobs: background work and reads such as a cron sync or a login link lookup. Without it the list shows only the jobs a customer cares about. A `type` or `group_id` filter names what it wants, so it always lists those jobs."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "jobs.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Jobs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobList"
                },
                "example": {
                  "data": [
                    {
                      "id": "01934f2b-0d5e-7f61-9a72-8b9c0d1e2f3a",
                      "type": "clear_server_cache",
                      "status": "succeeded",
                      "environment_id": "01934f2a-7c1f-7a10-8b21-3c4d5e6f7a8b",
                      "site_id": "01934f2a-7c1e-7d3b-9a52-6e8f1b2c3d4e",
                      "node_id": "01934e10-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                      "group_id": null,
                      "progress": 100,
                      "attempts": 1,
                      "error": null,
                      "result": null,
                      "requested_by": {
                        "type": "api_key",
                        "id": "01934d00-1111-7222-8333-444455556666",
                        "label": "CI deploys"
                      },
                      "idempotency_key": "5f1c2a9e-8b7d-4e3f-9a61-2c4d8e0b7f13",
                      "created_at": "2026-11-10T09:15:00.000Z",
                      "started_at": "2026-11-10T09:15:01.000Z",
                      "finished_at": "2026-11-10T09:15:04.000Z",
                      "updated_at": "2026-11-10T09:15:04.000Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/jobs/{id}": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "getJob",
        "summary": "Get a job",
        "description": "Returns one job: its `type`, `status`, `progress`, `error`, `result`, and times. Read it after a call that answered 202 to see how the work went, or follow GET /jobs/{id}/events.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the job."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "jobs.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "example": {
                  "id": "01934f2b-0d5e-7f61-9a72-8b9c0d1e2f3a",
                  "type": "clear_server_cache",
                  "status": "succeeded",
                  "environment_id": "01934f2a-7c1f-7a10-8b21-3c4d5e6f7a8b",
                  "site_id": "01934f2a-7c1e-7d3b-9a52-6e8f1b2c3d4e",
                  "node_id": "01934e10-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                  "group_id": null,
                  "progress": 100,
                  "attempts": 1,
                  "error": null,
                  "result": null,
                  "requested_by": {
                    "type": "api_key",
                    "id": "01934d00-1111-7222-8333-444455556666",
                    "label": "CI deploys"
                  },
                  "idempotency_key": "5f1c2a9e-8b7d-4e3f-9a61-2c4d8e0b7f13",
                  "created_at": "2026-11-10T09:15:00.000Z",
                  "started_at": "2026-11-10T09:15:01.000Z",
                  "finished_at": "2026-11-10T09:15:04.000Z",
                  "updated_at": "2026-11-10T09:15:04.000Z"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/jobs/{id}/events": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "streamJobEvents",
        "summary": "Stream job events",
        "description": "Server-sent events. Each data field is a JobEvent. The stream replays past events, then follows new ones until the job ends.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the job."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "jobs.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/JobEvent"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/job-groups/{id}": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "getJobGroup",
        "summary": "Get a job group",
        "description": "One parent, one child per environment, with per-site results.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the job group."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "jobs.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Job group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobGroup"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/bulk": {
      "post": {
        "tags": [
          "Bulk actions"
        ],
        "operationId": "bulkAction",
        "summary": "Run a bulk action",
        "description": "Clears caches, changes PHP settings, or applies labels across environments.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobGroup"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/labels": {
      "get": {
        "tags": [
          "Labels"
        ],
        "operationId": "listLabels",
        "summary": "List labels",
        "description": "Lists the company's labels with `site_count`, the number of sites that carry each, in pages of up to 200 (default 50). A member limited to some sites sees only the labels on their own sites, counted over those sites.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Labels",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Labels"
        ],
        "operationId": "createLabel",
        "summary": "Create a label",
        "description": "Creates a label with a `name` of up to 40 characters and a `color` written as `#RRGGBB` (default `#6b7280`). Owners and Admins may call it. Answers 201 with the label.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "labels.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabelRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Label",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Label"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/labels/{id}": {
      "patch": {
        "tags": [
          "Labels"
        ],
        "operationId": "updateLabel",
        "summary": "Edit a label",
        "description": "Changes the label's `name`, its `color`, or both. The change shows on every site that carries the label. Owners and Admins may call it.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the label."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "labels.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchLabelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Label",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Label"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Labels"
        ],
        "operationId": "deleteLabel",
        "summary": "Delete a label",
        "description": "Deletes the label. It disappears from every site that carries it, and the sites stay. Owners and Admins may call it. Answers 204, or 404 when the label was not found.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the label."
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "labels.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/notifications": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "operationId": "listNotifications",
        "summary": "List notifications",
        "description": "Newest first. An important notice (`important: true`) is one the person must act on, such as setting a password. `requires_action` stays true until the person does the action, and `resolved_at` is set when they do. It keeps counting as unread until then.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "unread",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "site_health",
                "deployments",
                "backups",
                "domains",
                "security",
                "billing",
                "usage",
                "team",
                "support",
                "product_news"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "notifications.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Notifications",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/notifications/{id}": {
      "patch": {
        "tags": [
          "Notifications"
        ],
        "operationId": "updateNotification",
        "summary": "Mark a notification read",
        "description": "The body is `{\"read\": true}`. Read state moves one way: a notification cannot be marked unread again, and any other body answers 422. Marking an important notification read while `requires_action` is true answers 409 (notification_requires_action). The person has to do the action first, and WP Waterfall then marks it done and read.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the notification."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "notifications.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchNotificationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Notification",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/users/me/notification-preferences": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "operationId": "getNotificationPreferences",
        "summary": "Notification preferences",
        "description": "Returns the person's own setting for every notification category: whether it sends an email (`email`) and a bell notice (`in_app`). Needs a dashboard session. A plain API key cannot call it, but the connection of an AI assistant may read the settings of the person who approved it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "notifications.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationPreferences"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Notifications"
        ],
        "operationId": "setNotificationPreferences",
        "summary": "Update notification preferences",
        "description": "Changes `email`, `in_app`, or both for the categories you list, each at most once. Categories you leave out keep their values. Turning off a channel that a category requires answers 422 with the reason. Needs a dashboard session: a plain API key cannot call it, but the connection of an AI assistant may change the settings of the person who approved it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "notifications.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutNotificationPreferencesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationPreferences"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/saved-views": {
      "get": {
        "tags": [
          "Saved views"
        ],
        "operationId": "listSavedViews",
        "summary": "List saved Sites list views",
        "description": "Lists the views of the Sites list that the signed-in person saved: each has a name, filters, columns, and a sort. A saved view belongs to one person, so colleagues do not see it. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Saved views",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedViewList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Saved views"
        ],
        "operationId": "createSavedView",
        "summary": "Save a Sites list view",
        "description": "Saves a set of Sites list filters, columns, and a sort under a `name` of up to 60 characters. `columns` defaults to every column and `sort` to null. Answers 201 with the view. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSavedViewRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Saved view",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedView"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/saved-views/{id}": {
      "patch": {
        "tags": [
          "Saved views"
        ],
        "operationId": "updateSavedView",
        "summary": "Edit a saved view",
        "description": "Changes the `name`, `filters`, `columns`, or `sort` of one of the person's own saved views. Fields left out keep their value. Answers 404 when the view is not theirs. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the saved view."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSavedViewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved view",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedView"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Saved views"
        ],
        "operationId": "deleteSavedView",
        "summary": "Delete a saved view",
        "description": "Deletes one of the person's own saved views. Answers 204, or 404 when the view is not theirs. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the saved view."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/repository": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "getRepository",
        "summary": "Repository and clone commands",
        "description": "Returns the site's Git repository: the `remote`, the `default_branch`, ready to copy `clone_commands` that hold no secret, and `git_ssh`, the SSH access for pushes. Pushes go to staging, never to live.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Repository",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Repository"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/commits": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "listCommits",
        "summary": "List commits",
        "description": "Lists the commits on `ref`, which defaults to the site's default branch. A page holds at most 100 commits (default 50). A site with no environment returns an empty list.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "ref",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
            },
            "description": "Defaults to the site's default branch."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Commits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommitList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/commits/{sha}": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "getCommit",
        "summary": "Read a commit with its diff",
        "description": "Reads from the repository through a job. The job result is a CommitDiff.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "sha",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{40}$"
            },
            "description": "The full commit hash: 40 hex characters."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/releases": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "listReleases",
        "summary": "List releases",
        "description": "Ten releases stay per environment.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "environment_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Releases",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/deploy": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "deploy",
        "summary": "Deploy a commit to staging or a preview",
        "description": "Builds the ref and activates it on the environment. Returns the build job. Live is immutable and answers 409 (live_is_immutable): promote staging with POST /sites/{id}/promote instead.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeployRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/releases/{id}/activate": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "activateRelease",
        "summary": "Activate a release",
        "description": "Use it to roll back to an earlier release.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the release."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.rollback",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivateReleaseRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/builds": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "listBuilds",
        "summary": "List builds",
        "description": "Newest first.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Builds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuildList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/builds/{id}/log": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "getBuildLog",
        "summary": "Build log",
        "description": "Add follow=true to stream new lines as server-sent events while the build runs.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the build."
          },
          {
            "name": "follow",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Build log",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuildLog"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/env-vars": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "listEnvVars",
        "summary": "List environment variables",
        "description": "Secret values are masked.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Variables",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvVarList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Code"
        ],
        "operationId": "setEnvVar",
        "summary": "Set an environment variable",
        "description": "Sets one environment variable and returns 202 with the Job. `key` is UPPER_SNAKE_CASE and cannot start with `WPWATERFALL_`, and `value` holds up to 65,536 characters. With `secret: true` the value is encrypted at rest and never shown again.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutEnvVarRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Code"
        ],
        "operationId": "deleteEnvVar",
        "summary": "Delete an environment variable",
        "description": "Deletes the variable named in the `key` query parameter and returns 202 with the Job. Answers 404 when the environment has no variable with that name.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "key",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/code-mode": {
      "put": {
        "tags": [
          "Code"
        ],
        "operationId": "setCodeMode",
        "summary": "Switch between Git and classic mode",
        "description": "Switches the environment's code between `git`, a read-only release of its branch, and `classic`, a writable working tree. Live is always `git` (409 `live_is_immutable`). A switch to `git` answers 409 `working_tree_dirty` while the working tree has uncommitted changes, and a switch to `classic` answers 409 while an outside repository is connected. Needs `confirm: true` and returns 202 with the Job.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutCodeModeRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/ssh": {
      "get": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "getSsh",
        "summary": "SSH settings",
        "description": "Returns the SSH state of the environment: whether it is on, the `host`, `port`, and `username`, password sign-in and its expiry in days, the allowed IP addresses, and the public keys that can sign in. It holds no password.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "SSH settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SshSettings"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "updateSsh",
        "summary": "Change SSH settings",
        "description": "Changes `enabled`, `password_auth`, or `password_expires_days` (1 to 365, or null) and returns 202 with the Job. Send at least one of them (422 otherwise). Turning SSH on, or password sign-in on, asks a signed-in person for a recent sign-in. Needs `confirm: true`.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "ssh.manage",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSshSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/ssh/allowed-ips": {
      "get": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "getSshAllowedIps",
        "summary": "Allowed IP addresses",
        "description": "Returns `allowed_ips`, the addresses and ranges that may connect over SSH and SFTP. An empty list means any address may connect.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Allowed IPs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SshAllowedIps"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "setSshAllowedIps",
        "summary": "Set allowed IP addresses",
        "description": "Replaces the list with up to 100 IP addresses or CIDR ranges and returns 202 with the Job. An empty list lets any address connect. A change that lets more addresses in asks a signed-in person for a recent sign-in. Needs `confirm: true`.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "ssh.manage",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSshAllowedIpsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/ssh/config": {
      "get": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "getSshConfig",
        "summary": "Connection commands",
        "description": "Returns the host, port, and username with ready to copy `ssh_command`, `sftp_command`, and `database_tunnel_command`, and the server's `host_key_fingerprint` (null until the server reports it). None of them holds a secret. Send `Accept: text/plain` to get an SSH config file to download instead.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "SSH, SFTP, and tunnel commands",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SshConfig"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/sftp-accounts": {
      "get": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "listSftpAccounts",
        "summary": "List extra SFTP accounts",
        "description": "Every environment lists its extra SFTP users, live included. Each has a folder below the web root and an access: read_write, read_only, or read_upload. read_upload reads every file and uploads to wp-content/uploads and nowhere else. Where the environment's code is read only (live always, and staging or a preview in Git mode) a user is read_only or read_upload. In SFTP mode a user is read_write or read_only, and a read_upload user reads only.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "SFTP accounts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SftpAccountList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "createSftpAccount",
        "summary": "Add an SFTP account",
        "description": "The body is the Job object plus the new account. Send password (16 to 32 characters) to choose it: it is sealed at once and the answer does not repeat it. Leave it out and the server makes one, shown once in this response when the job ends within a few seconds. Later it comes from the SFTP credentials reveal, which needs a recent sign-in. directory is a folder below the web root. The server makes it when it is missing and refuses one that links out of the site. access is read_write where code is writable (SFTP mode) and read_only where it is read only (live, Git mode) when you leave it out. read_upload reads every file and uploads, changes, and removes files in wp-content/uploads, and can change nothing else; it needs read only code, and a directory of / or /wp-content so the folder holds the uploads folder (422 upload_folder_invalid otherwise, 422 access_not_available in SFTP mode). read_write where code is read only is stored as read_only. Answers 409 agent_too_old while the server needs an update first, and for read_upload until the server runs the upload update.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "ssh.manage",
        "x-wpwaterfall-confirm": false,
        "x-wpwaterfall-step-up": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSftpAccountRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SftpAccountCreated"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/sftp-accounts/status": {
      "put": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "setSftpStatus",
        "summary": "Switch SFTP on or off",
        "description": "Switches every extra SFTP account of the environment on or off.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "ssh.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSftpStatusRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sftp-accounts/{id}": {
      "delete": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "deleteSftpAccount",
        "summary": "Remove an SFTP account",
        "description": "Works on every environment, live included.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the SFTP account."
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "ssh.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/wp-users": {
      "get": {
        "tags": [
          "WordPress users"
        ],
        "operationId": "listWpUsers",
        "summary": "List WordPress users",
        "description": "Filter by email. Reads through the WP-CLI runner. The API waits up to 10 seconds and returns 200 with the users, or 202 with the Job when it takes longer. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "email",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "email",
              "maxLength": 254
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "wp_users.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "WordPress users",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WpUserList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "WordPress users"
        ],
        "operationId": "createWpUser",
        "summary": "Create a WordPress user",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "wp_users.manage",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWpUserRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "description": "Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed."
      }
    },
    "/environments/{id}/wp-users/{user_id}": {
      "patch": {
        "tags": [
          "WordPress users"
        ],
        "operationId": "updateWpUser",
        "summary": "Change the role of a WordPress user",
        "description": "Runs `wp user set-role` through the WP-CLI runner. Answers 202 with the Job. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The WordPress user id: a whole number."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "wp_users.manage",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchWpUserRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "WordPress users"
        ],
        "operationId": "deleteWpUser",
        "summary": "Delete a WordPress user",
        "description": "Gives the user's posts and pages to `reassign`, another WordPress user, then deletes the user. Needs `confirm=true`. Answers 202 with the Job. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "danger:destroy"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The WordPress user id: a whole number."
          },
          {
            "name": "reassign",
            "in": "query",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "danger:destroy",
        "x-wpwaterfall-permission": "wp_users.manage",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/super-admins": {
      "get": {
        "tags": [
          "WordPress users"
        ],
        "operationId": "listSuperAdmins",
        "summary": "List the super administrators of a WordPress network",
        "description": "Reads `wp super-admin list` through the WP-CLI runner. A single site answers 409. The API waits up to 10 seconds and returns 200, or 202 with the Job when it takes longer. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "wp_users.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Super administrators",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAdminList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/wp-users/{user_id}/super-admin": {
      "put": {
        "tags": [
          "WordPress users"
        ],
        "operationId": "setSuperAdmin",
        "summary": "Grant or remove super administrator rights",
        "description": "Runs `wp super-admin add` or `remove` through the WP-CLI runner. A super administrator manages the whole network, so send confirm: true. Answers 202 with the Job. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The WordPress user id: a whole number."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "wp_users.manage",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSuperAdminRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/wp-users/{user_id}/password-reset": {
      "post": {
        "tags": [
          "WordPress users"
        ],
        "operationId": "resetWpUserPassword",
        "summary": "Email a password reset link to a WordPress user",
        "description": "Runs `wp wpwaterfall password-reset`, which calls the WordPress lost password function. WordPress emails the user its standard link to choose a new password, and the current password keeps working until the person uses the link. WP Waterfall never sees or sets a password and never changes the email address. A staging or preview site sends no mail. Answers 202 with the Job. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The WordPress user id: a whole number."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "wp_users.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WpUserPasswordResetRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/wp-login-events": {
      "get": {
        "tags": [
          "WordPress users"
        ],
        "operationId": "listWpLoginEvents",
        "summary": "List WordPress sign-ins",
        "description": "The last 200 sign-in attempts on WordPress, newest first, as the WP Waterfall MU plugin records them. Reads through the WP-CLI runner. The API waits up to 10 seconds and returns 200 with the list, or 202 with the Job when it takes longer. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "wp_users.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "WordPress sign-ins",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WpLoginEventList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/wp-login-url": {
      "get": {
        "tags": [
          "WordPress users"
        ],
        "operationId": "getWpLoginUrl",
        "summary": "Get the WordPress login address",
        "description": "The login and admin addresses WordPress reports, which follow plugins that hide the login page at a secret address, such as Solid Security or WPS Hide Login. The host is always the site's primary domain, or the temporary domain. Answers from the stored value and reads the site again through the WP-CLI runner when the value is older than an hour. Always answers 200: `source` is `default` with `/wp-login.php` when the site has not reported. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The login address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WpLoginUrl"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/plugins": {
      "get": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "listPlugins",
        "summary": "List the plugins on the site",
        "description": "Answers the list from the last list job on the site, kept by WP Waterfall, with refreshed_at. When there is none, or a change made through WP Waterfall finished after it, the list runs again through the WP-CLI runner: the API waits up to 10 seconds and returns 200, or 202 with the Job when it takes longer. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The plugins",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtensionList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/plugins/{slug}": {
      "get": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "getPlugin",
        "summary": "One plugin",
        "description": "Reads through the WP-CLI runner. The API waits up to 10 seconds and returns 200 with the result, or 202 with the Job when it takes longer. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The plugin's slug: the name WP-CLI lists it under."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginDetail"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "deletePlugin",
        "summary": "Delete a plugin",
        "description": "Runs a WP-CLI command as a job on the node. Poll the job or follow its events. Live sites in Git mode refuse changes to code. Send confirm=true and confirm_name with the plugin name as query parameters. Deleting a plugin that is still active fails. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The plugin's slug: the name WP-CLI lists it under."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          },
          {
            "name": "confirm_name",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/plugins/{slug}/activate": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "activatePlugin",
        "summary": "Activate a plugin",
        "description": "Runs a WP-CLI command as a job on the node. Poll the job or follow its events. Live sites in Git mode refuse changes to code. On a WordPress Multisite network, send network: true to activate it for every site. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The plugin's slug: the name WP-CLI lists it under."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtensionActivateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/plugins/{slug}/deactivate": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "deactivatePlugin",
        "summary": "Deactivate a plugin",
        "description": "Runs a WP-CLI command as a job on the node. Poll the job or follow its events. Live sites in Git mode refuse changes to code. Send network: true to deactivate a network activated plugin. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The plugin's slug: the name WP-CLI lists it under."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtensionActivateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/plugins/{slug}/update": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "updatePlugin",
        "summary": "Update a plugin",
        "description": "Runs a WP-CLI command as a job on the node. Poll the job or follow its events. Live sites in Git mode refuse changes to code. Send confirm: true and confirm_name with the plugin name. A pre-update restore point is taken first. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The plugin's slug: the name WP-CLI lists it under."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtensionConfirmRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/plugins/{slug}/auto-update": {
      "put": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "setPluginAutoUpdate",
        "summary": "Turn automatic updates on or off for a plugin",
        "description": "Staging and previews only, in SFTP mode and Git mode. Saves the switch in WP Waterfall's own record and answers 200 with the switches, because the run itself is a separate job (see POST /environments/{id}/auto-updates/run). Live code is a read-only release, so live has no automatic updates: on live this answers 409 with the code live_is_immutable. While an external repository is connected, turning a switch on answers 409 with the code external_repository_connected. Update on staging, then promote staging to live. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The plugin's slug: the name WP-CLI lists it under."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The automatic update switches after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdateState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/plugins/refresh": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "refreshPlugins",
        "summary": "Read the plugins from the site again",
        "description": "Runs the list again on the node as a job, for example after a push or a change made in WordPress. Read the list again when the job succeeds. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/plugins/auto-update": {
      "put": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "setPluginsAutoUpdate",
        "summary": "Turn automatic updates on or off for every plugin",
        "description": "Staging and previews only, in SFTP mode and Git mode. Saves the switch in WP Waterfall's own record and answers 200 with the switches, because the run itself is a separate job (see POST /environments/{id}/auto-updates/run). Live code is a read-only release, so live has no automatic updates: on live this answers 409 with the code live_is_immutable. While an external repository is connected, turning a switch on answers 409 with the code external_repository_connected. Update on staging, then promote staging to live. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoUpdateAllRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The automatic update switches after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdateState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/plugins/bulk": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "bulkPlugins",
        "summary": "Change several plugins at once",
        "description": "Runs one WP-CLI command for every name given, as one job. Update and delete need confirm: true. Live sites in Git mode refuse changes to code. enable_auto_update and disable_auto_update save the switches and answer 200 with them, and live answers 409 live_is_immutable to them. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkExtensionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "For enable_auto_update and disable_auto_update only: the switches after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdateState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/themes": {
      "get": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "listThemes",
        "summary": "List the themes on the site",
        "description": "Answers the list from the last list job on the site, kept by WP Waterfall, with refreshed_at. When there is none, or a change made through WP Waterfall finished after it, the list runs again through the WP-CLI runner: the API waits up to 10 seconds and returns 200, or 202 with the Job when it takes longer. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The themes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtensionList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/themes/{slug}": {
      "get": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "getTheme",
        "summary": "One theme",
        "description": "Reads through the WP-CLI runner. The API waits up to 10 seconds and returns 200 with the result, or 202 with the Job when it takes longer. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The theme's slug: the name WP-CLI lists it under."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The theme",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Extension"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "deleteTheme",
        "summary": "Delete a theme",
        "description": "Runs a WP-CLI command as a job on the node. Poll the job or follow its events. Live sites in Git mode refuse changes to code. Send confirm=true and confirm_name with the theme name as query parameters. The active theme cannot be deleted. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The theme's slug: the name WP-CLI lists it under."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          },
          {
            "name": "confirm_name",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/themes/{slug}/activate": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "activateTheme",
        "summary": "Activate a theme",
        "description": "Runs a WP-CLI command as a job on the node. Poll the job or follow its events. Live sites in Git mode refuse changes to code. On a WordPress Multisite network, send network: true to enable the theme for the network (wp theme enable --network) instead of activating it on the main site. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The theme's slug: the name WP-CLI lists it under."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtensionActivateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/themes/{slug}/deactivate": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "deactivateTheme",
        "summary": "Disable a theme for the network",
        "description": "Runs a WP-CLI command as a job on the node. Poll the job or follow its events. Live sites in Git mode refuse changes to code. A site always has one active theme, so this only works on a WordPress Multisite network: send network: true to disable the theme for the network (wp theme disable --network). Without it the answer is 422. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The theme's slug: the name WP-CLI lists it under."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtensionActivateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/themes/{slug}/update": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "updateTheme",
        "summary": "Update a theme",
        "description": "Runs a WP-CLI command as a job on the node. Poll the job or follow its events. Live sites in Git mode refuse changes to code. Send confirm: true and confirm_name with the theme name. A pre-update restore point is taken first. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The theme's slug: the name WP-CLI lists it under."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtensionConfirmRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/themes/refresh": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "refreshThemes",
        "summary": "Read the themes from the site again",
        "description": "Runs the list again on the node as a job, for example after a push or a change made in WordPress. Read the list again when the job succeeds. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/themes/auto-update": {
      "put": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "setThemesAutoUpdate",
        "summary": "Turn automatic updates on or off for every theme",
        "description": "Staging and previews only, in SFTP mode and Git mode. Saves the switch in WP Waterfall's own record and answers 200 with the switches, because the run itself is a separate job (see POST /environments/{id}/auto-updates/run). Live code is a read-only release, so live has no automatic updates: on live this answers 409 with the code live_is_immutable. While an external repository is connected, turning a switch on answers 409 with the code external_repository_connected. Update on staging, then promote staging to live. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoUpdateAllRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The automatic update switches after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdateState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/themes/bulk": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "bulkThemes",
        "summary": "Change several themes at once",
        "description": "Runs one WP-CLI command for every name given, as one job. Update and delete need confirm: true. Live sites in Git mode refuse changes to code. enable_auto_update and disable_auto_update save the switches and answer 200 with them, and live answers 409 live_is_immutable to them. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkExtensionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "For enable_auto_update and disable_auto_update only: the switches after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdateState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/themes/{slug}/auto-update": {
      "put": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "setThemeAutoUpdate",
        "summary": "Turn automatic updates on or off for a theme",
        "description": "Staging and previews only, in SFTP mode and Git mode. Saves the switch in WP Waterfall's own record and answers 200 with the switches, because the run itself is a separate job (see POST /environments/{id}/auto-updates/run). Live code is a read-only release, so live has no automatic updates: on live this answers 409 with the code live_is_immutable. While an external repository is connected, turning a switch on answers 409 with the code external_repository_connected. Update on staging, then promote staging to live. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The theme's slug: the name WP-CLI lists it under."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The automatic update switches after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdateState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/domains": {
      "get": {
        "tags": [
          "Domains"
        ],
        "operationId": "listDomains",
        "summary": "List the domains of an environment",
        "description": "Lists the domains attached to one environment with their status, their SSL status, and which one is the primary, in pages of up to 200 (default 50).",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Domains",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Domains"
        ],
        "operationId": "addDomain",
        "summary": "Add a domain",
        "description": "Creates the domain rows and starts the attach job. On a Cloudflare DNS zone the job writes every record itself. Elsewhere, read the records to set from GET /domains/{id}/verification-records. On staging or a preview the hostname must sit under a custom domain connected to the same site's live environment (`staging.example.com`), or be its wildcard (`*.example.com`), which the node serves without a Cloudflare custom hostname. Refusals: 409 `live_not_launched`, `live_domain_required`, `hostname_taken`, `staging_domain_limit` (10 per site), `primary_live_only`; 422 `not_under_live_domain`, `www_live_only`.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "domains.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDomainRequest"
              },
              "example": {
                "hostname": "blog.example.com",
                "include_www": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "example": {
                  "id": "01934f2b-0d5e-7f61-9a72-8b9c0d1e2f3a",
                  "type": "attach_domain",
                  "status": "queued",
                  "environment_id": "01934f2a-7c1f-7a10-8b21-3c4d5e6f7a8b",
                  "site_id": "01934f2a-7c1e-7d3b-9a52-6e8f1b2c3d4e",
                  "node_id": "01934e10-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                  "group_id": null,
                  "progress": 0,
                  "attempts": 0,
                  "error": null,
                  "result": null,
                  "requested_by": {
                    "type": "api_key",
                    "id": "01934d00-1111-7222-8333-444455556666",
                    "label": "CI deploys"
                  },
                  "idempotency_key": "5f1c2a9e-8b7d-4e3f-9a61-2c4d8e0b7f13",
                  "created_at": "2026-11-10T09:15:00.000Z",
                  "started_at": null,
                  "finished_at": null,
                  "updated_at": "2026-11-10T09:15:00.000Z"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Domains"
        ],
        "operationId": "removeDomains",
        "summary": "Remove several domains",
        "description": "One removal job per domain in one group. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "domain_ids",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "domains.manage",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobGroup"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/ssl/refresh": {
      "post": {
        "tags": [
          "Domains"
        ],
        "operationId": "refreshSsl",
        "summary": "Refresh SSL for a domain or the temporary domain",
        "description": "WP Waterfall already runs this repair by itself every 10 minutes for any domain whose SSL is not healthy, so calling it is never required. It only starts that same repair now. It never removes or replaces a DNS record that WP Waterfall did not write. Checks the certificate of one name again. For a custom domain (send its `domain_id`) the job reads the custom hostname from Cloudflare, writes any validation records a Cloudflare DNS zone is missing, and orders the server certificate again when it is missing or near its end. For the temporary domain (send `domain_id` null) the job installs its certificate on the server again. Needs the same permission as editing domains. A second request while a refresh of the same name is still running answers with that job and queues nothing. Refusals: 404 for a domain of another environment, 409 `domain_not_active` for a domain that is not connected yet, 409 `no_temp_hostname` or `environment_not_live` for the temporary domain.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "domains.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshSslRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/custom-certificates": {
      "get": {
        "tags": [
          "Domains"
        ],
        "operationId": "listCustomCertificates",
        "summary": "List the custom SSL certificates of an environment",
        "description": "Metadata only (subject, issuer, names, dates, fingerprint, status, and the layer that carries each certificate). The private key is never returned. `edge_layer_available` says whether the platform can also put a certificate on Cloudflare's edge.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Certificates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomCertificateList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/domains/{id}/custom-certificate": {
      "get": {
        "tags": [
          "Domains"
        ],
        "operationId": "getCustomCertificate",
        "summary": "Get the custom SSL certificate of a domain",
        "description": "Metadata only: subject, issuer, names, not_before, not_after, fingerprint, installed_at, and the layer that carries the certificate. The private key is never returned. 404 when the domain has none.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the domain."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Certificate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomCertificate"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Domains"
        ],
        "operationId": "installCustomCertificate",
        "summary": "Install your own SSL certificate on a domain",
        "description": "Needs the Custom SSL add-on on the site (402 `custom_ssl_required` without it). Send the certificate with its intermediates and the unencrypted private key, both PEM. The API checks that the certificate parses, covers the hostname, is not expired, has more than 7 days left, chains to a publicly trusted root, and that the key matches and is not encrypted (422 with a code such as `certificate_key_mismatch`, `certificate_expired`, `certificate_name_mismatch`, `certificate_not_trusted`, `key_encrypted`). The key is sealed, never returned, and never stored in a job, event, or audit entry. The install is a job. Automatic renewal stops for the name, so renew before `not_after`: WP Waterfall warns 30, 14, and 7 days before. The domain must be active. Visitors see Cloudflare's own certificate on the Free plan: read `layer` and `visitors_see` on the answer.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the domain."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "domains.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallCustomCertificateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Domains"
        ],
        "operationId": "removeCustomCertificate",
        "summary": "Remove the custom SSL certificate",
        "description": "Deletes the stored certificate and key and returns the domain to the automatic certificate: the job orders the server certificate again. Needs confirm=true. Answers 204 with no job when the domain is not connected, because there is no server certificate to replace yet.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the domain."
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "domains.manage",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "204": {
            "description": "Removed. The domain is not connected, so no job was needed.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/domains/{id}": {
      "get": {
        "tags": [
          "Domains"
        ],
        "operationId": "getDomain",
        "summary": "Get a domain",
        "description": "Returns one domain: its hostname, `status`, `ssl_status`, `setup_mode`, `force_https_mode`, whether it is the primary, and its last job with the `failure_reason` when that job failed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the domain."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Domain",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Domain"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "Domains"
        ],
        "operationId": "updateDomain",
        "summary": "Change Force HTTPS or the setup mode",
        "description": "Send `force_https_mode` (`off`, `all_hostnames`, or `primary_only`), `setup_mode` (`standard` or `prepare_first`), or both: a body with neither answers 422. A new Force HTTPS mode is saved for the whole environment. Returns 202 with the Job that applies the settings at the edge.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the domain."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "domains.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchDomainRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Domains"
        ],
        "operationId": "removeDomain",
        "summary": "Remove a domain",
        "description": "Reverses every attach step and deletes the custom hostname. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the domain."
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "domains.manage",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/domains/{id}/verification-records": {
      "get": {
        "tags": [
          "Domains"
        ],
        "operationId": "getDomainVerificationRecords",
        "summary": "The records to set for a domain",
        "description": "The A and AAAA records that connect the domain (one row for each address in dns_addresses, the same set for every domain), plus the ownership TXT, the certificate records, and the last check. A domain that still has an older CNAME that reaches WP Waterfall keeps working, and notes says to replace it with the A and AAAA records.",
        "security": [
          {
            "bearerAuth": [
              "domains:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the domain."
          }
        ],
        "x-wpwaterfall-scope": "domains:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Records",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationRecords"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/domains/{id}/verify": {
      "post": {
        "tags": [
          "Domains"
        ],
        "operationId": "verifyDomain",
        "summary": "Check DNS now",
        "description": "Queries the resolver and names the exact wrong record. Changes nothing.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the domain."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "domains.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomainCheckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Check result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationRecords"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/domains/{id}/primary": {
      "post": {
        "tags": [
          "Domains"
        ],
        "operationId": "makeDomainPrimary",
        "summary": "Make a domain primary",
        "description": "Rewrites home and siteurl, adds a 301 from the old primary, and purges both caches.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the domain."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "domains.manage",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MakePrimaryRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones": {
      "get": {
        "tags": [
          "DNS"
        ],
        "operationId": "listDnsZones",
        "summary": "List Cloudflare DNS zones",
        "description": "Lists the company's DNS zones in pages of up to 200 (default 50). `limit` in the answer holds `used` and `allowed`, the zones the company has and may have. Zones belong to the company, so a member limited to some sites gets 403.",
        "security": [
          {
            "bearerAuth": [
              "domains:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "domains:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Zones",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsZoneList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "createDnsZone",
        "summary": "Create a Cloudflare DNS zone",
        "description": "Creates the zone on the Cloudflare DNS account and scans the current records.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDnsZoneRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}": {
      "get": {
        "tags": [
          "DNS"
        ],
        "operationId": "getDnsZone",
        "summary": "Get a zone",
        "description": "Returns one zone: its name, `status`, `nameservers`, DNSSEC state, record count and record limit, and its last setup job. A member limited to some sites gets 403.",
        "security": [
          {
            "bearerAuth": [
              "domains:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          }
        ],
        "x-wpwaterfall-scope": "domains:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Zone",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsZone"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "DNS"
        ],
        "operationId": "deleteDnsZone",
        "summary": "Delete a zone",
        "description": "Refused while a domain still attaches through it. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/retry": {
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "retryDnsZone",
        "summary": "Set up a zone again after it failed",
        "description": "Queues the zone setup job again for a zone whose setup failed. The job reads the Cloudflare zone the earlier run created, skips records Cloudflare already holds, and reads the zone's records into the WP Waterfall list. Answers 409 for a zone that did not fail. Creating the zone again with the same name does the same.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/activation-check": {
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "checkDnsZoneActivation",
        "summary": "Check the nameservers",
        "description": "Queries the zone's nameservers and activates the zone when they match. A zone waiting for adoption is adopted first once its ownership TXT record resolves, and an active zone refreshes its records from Cloudflare. `quiet: true` skips the in-app notice when the zone goes live, for a client that polls.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivationCheckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Check result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivationCheckResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/adopt": {
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "adoptDnsZone",
        "summary": "Adopt a zone that already exists in WP Waterfall's Cloudflare account",
        "description": "Links the zone to the existing Cloudflare zone and reads its records, once the domain is registered with this company or the ownership TXT record resolves. Cloudflare is never written.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Adoption result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsZoneAdoptResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/records": {
      "get": {
        "tags": [
          "DNS"
        ],
        "operationId": "listDnsRecords",
        "summary": "List records",
        "description": "Pages by name, type, and id. `limit` is 1 to 1000 (default 1000, the most a Cloudflare Free zone holds), so a call with no query returns every record. Send `next_cursor` back as `cursor` for the next page. `warnings` covers the records on the page.",
        "security": [
          {
            "bearerAuth": [
              "domains:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 1000
            },
            "description": "How many rows to return in one page: at most 1000, and 1000 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 512
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "domains:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Records with live warnings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsRecordList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "createDnsRecord",
        "summary": "Add a record",
        "description": "Validates the record (no CNAME at the apex, no conflicts, TTL bounds, SPF lookups), writes it to Cloudflare, and snapshots the zone.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DnsRecordRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsRecord"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/records/{record_id}": {
      "patch": {
        "tags": [
          "DNS"
        ],
        "operationId": "updateDnsRecord",
        "summary": "Change a record",
        "description": "Changes the fields you send (`type`, `name`, `content`, `ttl`, `priority`, or `comment`), checks the result against the rest of the zone, and writes it to Cloudflare. A record that WP Waterfall manages for an attached domain or for signed mail is locked and answers 409. The answer is the record with any `warnings`.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS record."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchDnsRecordRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsRecord"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "DNS"
        ],
        "operationId": "deleteDnsRecord",
        "summary": "Delete a record",
        "description": "Managed records are locked. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS record."
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/records/refresh": {
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "refreshDnsRecords",
        "summary": "Refresh records from Cloudflare",
        "description": "Reads the zone's records from Cloudflare and updates the mirror: new records are imported, changed ones updated, and records gone from Cloudflare removed from the mirror. Cloudflare itself is never written.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Refresh result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsRefreshResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/snapshots": {
      "get": {
        "tags": [
          "DNS"
        ],
        "operationId": "listDnsSnapshots",
        "summary": "List zone snapshots",
        "description": "Lists the saved versions of the zone's records: each has a `version`, a `record_count`, who made it, the `reason`, and the time. Restore one with POST /dns/zones/{id}/snapshots/{version}/restore.",
        "security": [
          {
            "bearerAuth": [
              "domains:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "domains:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Snapshots",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsSnapshotList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "createDnsSnapshot",
        "summary": "Save a snapshot of the zone now",
        "description": "Saves the current records as a new version, with the reason given.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDnsSnapshotRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsSnapshot"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/snapshots/{version}/restore": {
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "restoreDnsSnapshot",
        "summary": "Roll the zone back to a snapshot",
        "description": "Replaces every unmanaged record with the snapshot's set. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The version number of the snapshot: a whole number from 1."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestoreSnapshotRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Records after the rollback",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsRecordList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/snapshots/{version}": {
      "delete": {
        "tags": [
          "DNS"
        ],
        "operationId": "deleteDnsSnapshot",
        "summary": "Delete a snapshot",
        "description": "Removes one saved version. The records themselves do not change. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The version number of the snapshot: a whole number from 1."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/dns/zones/{id}/nameserver-request": {
      "get": {
        "tags": [
          "DNS"
        ],
        "operationId": "getNameserverRequest",
        "summary": "The custom nameserver request for a zone",
        "description": "Returns the zone's request for custom nameservers: the 2 to 4 `hostnames` asked for, its `status`, and a `note`. Answers 404 when the zone has no request.",
        "security": [
          {
            "bearerAuth": [
              "domains:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          }
        ],
        "x-wpwaterfall-scope": "domains:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NameserverRequest"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "createNameserverRequest",
        "summary": "Request custom nameservers",
        "description": "Stored for the support team. Cloudflare account custom nameservers take approval.",
        "security": [
          {
            "bearerAuth": [
              "dns:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the DNS zone."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "dns:write",
        "x-wpwaterfall-permission": "dns.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateNameserverRequestRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NameserverRequest"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cache": {
      "get": {
        "tags": [
          "Caching"
        ],
        "operationId": "getCacheSettings",
        "summary": "Cache settings",
        "description": "Returns the saved cache settings: the server and edge page cache switches with their lifetimes in seconds, the static file lifetime, the stale-while-revalidate and stale-if-error times, the excluded paths, the ignored query parameters, and the image optimization mode.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CacheSettings"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Caching"
        ],
        "operationId": "setCacheSettings",
        "summary": "Change cache settings",
        "description": "Saves the settings and applies them at the edge through a job.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutCacheSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cache/purge": {
      "post": {
        "tags": [
          "Caching"
        ],
        "operationId": "purgeCache",
        "summary": "Purge the edge and server caches",
        "description": "Clears the edge and server caches and returns 202 with the Job. `scope` is `all` (the default), `urls` (up to 1,000 URLs, each on one of the environment's own hostnames, or 422), `tags` (up to 100), or `cdn`. With `urls`, `include_subdirectories: true` also clears every page under each URL and takes at most 100 URLs.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurgeCacheRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cdn": {
      "get": {
        "tags": [
          "Caching"
        ],
        "operationId": "getCdnSettings",
        "summary": "CDN settings",
        "description": "Image optimization and the files excluded from the CDN, with what the last apply job did at the server.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CdnSettings"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Caching"
        ],
        "operationId": "setCdnSettings",
        "summary": "Change image optimization and the files excluded from the CDN",
        "description": "Send image_optimization, exclusions, or both. Each exclusion list that is present replaces the saved list. The change is saved, applied through a job, and followed by a clear of the site's files at the CDN.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutCdnSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cdn/purge": {
      "post": {
        "tags": [
          "Caching"
        ],
        "operationId": "purgeCdn",
        "summary": "Purge static assets at the edge",
        "description": "Clears the site's static files at the edge and returns 202 with the Job. It takes no body, and it does the same as a cache purge with `scope: cdn`.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/edge/settings": {
      "get": {
        "tags": [
          "Caching"
        ],
        "operationId": "getEdgeSettings",
        "summary": "Force HTTPS and geolocation",
        "description": "Returns `force_https_mode` (`off`, `all_hostnames`, or `primary_only`) and `geolocation`, with `enforcement`: whether the last job that applied them finished, and its notes.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EdgeSettings"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Caching"
        ],
        "operationId": "setEdgeSettings",
        "summary": "Change Force HTTPS or geolocation",
        "description": "Geolocation passes the visitor's country to PHP on every page, and cached pages vary by country. City, region, postal code, coordinates, and time zone reach only pages that are never cached, such as the cart, checkout, and pages for signed in visitors.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutEdgeSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/mobile-cache": {
      "put": {
        "tags": [
          "Caching"
        ],
        "operationId": "setMobileCache",
        "summary": "Turn mobile cache on or off",
        "description": "Keeps separate page caches for mobile and desktop visitors on the server and at the edge, using the same device test as wp_is_mobile(). The job clears the site's caches.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutMobileCacheRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/redirects": {
      "get": {
        "tags": [
          "Redirects"
        ],
        "operationId": "listRedirects",
        "summary": "List redirect rules in order",
        "description": "Lists the redirect rules in pages of up to 200. `redirects_enabled` says whether the rules are switched on, and `enforcement` says what the last job that applied them did.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Rules",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedirectList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Redirects"
        ],
        "operationId": "createRedirect",
        "summary": "Add a redirect rule",
        "description": "Refuses a rule that creates a loop. Applies the rules through a job.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRedirectRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/redirects/{rule_id}": {
      "put": {
        "tags": [
          "Redirects"
        ],
        "operationId": "replaceRedirect",
        "summary": "Replace a redirect rule",
        "description": "Replaces one rule with the body you send (`source`, `destination`, `status_code`, `is_regex`, `domain_scope`, `enabled`, and an optional `position`) and returns 202 with the Job that writes the rules to the web server. A change that would make the rules loop answers 422. Answers 404 when the rule was not found.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the redirect rule."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutRedirectRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Redirects"
        ],
        "operationId": "deleteRedirect",
        "summary": "Delete a redirect rule",
        "description": "Deletes one rule and returns 202 with the Job that writes the remaining rules to the web server. Answers 404 when the rule was not found.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the redirect rule."
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/redirects/import": {
      "post": {
        "tags": [
          "Redirects"
        ],
        "operationId": "importRedirects",
        "summary": "Import rules from CSV",
        "description": "dry_run defaults to true and returns the parsed rules with problems.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RedirectImportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Parsed rules",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedirectImportResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/redirects/test": {
      "post": {
        "tags": [
          "Redirects"
        ],
        "operationId": "testRedirect",
        "summary": "Test a URL against the rules",
        "description": "Runs a path or a full URL (up to 512 characters) through the saved rules and changes nothing. The answer lists each hop with the rule that matched, the `final_url`, and `loop`, which is true when the rules go in a circle or past 10 hops. A caller may run 10 tests a minute and gets 429 after that.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RedirectTestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Hops and the final URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedirectTestResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/redirects": {
      "put": {
        "tags": [
          "Redirects"
        ],
        "operationId": "setRedirectsEnabled",
        "summary": "Turn redirects on or off",
        "description": "Switches every redirect rule of the environment on or off without deleting any. The apply_redirects job writes the rules, or none, into the web server.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutRedirectsEnabledRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/ip-rules": {
      "get": {
        "tags": [
          "IP deny"
        ],
        "operationId": "listIpRules",
        "summary": "List IP allow and deny rules",
        "description": "Lists the allow and deny rules in pages of up to 200. `your_ip` is the address the call came from, `ip_deny_enabled` says whether the rules are switched on, and `enforcement` says what the last job that applied them did.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Rules and your current IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IpRuleList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "IP deny"
        ],
        "operationId": "createIpRule",
        "summary": "Add an IP rule",
        "description": "Refuses to block the IP you are calling from unless allow_self_lockout is true.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIpRuleRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "IP deny"
        ],
        "operationId": "replaceIpRules",
        "summary": "Replace the IP rule list",
        "description": "Replaces the whole list with up to 1,000 rules, each with a `cidr` (an address or a range), an `action` (`deny` by default, or `allow`), and a `note`. A list that would block the address you call from answers 422 unless `allow_self_lockout` is true. Returns 202 with the Job that applies the list.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutIpRulesRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/ip-rules/{rule_id}": {
      "delete": {
        "tags": [
          "IP deny"
        ],
        "operationId": "deleteIpRule",
        "summary": "Delete an IP rule",
        "description": "Deletes one rule and returns 202 with the Job that applies the remaining list. Answers 404 when the rule was not found.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the IP rule."
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/ip-deny": {
      "put": {
        "tags": [
          "IP deny"
        ],
        "operationId": "setIpDenyEnabled",
        "summary": "Turn IP deny on or off",
        "description": "Switches every IP rule of the environment on or off without deleting any. While off, neither Cloudflare nor the web server blocks anyone from the list. The apply_ip_rules job writes the rules, or none.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutIpDenyEnabledRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/bot-protection": {
      "get": {
        "tags": [
          "Bot protection"
        ],
        "operationId": "getBotProtection",
        "summary": "Bot protection settings",
        "description": "The switch, the level (one of BOT_LEVELS, versioned by matrix_key), verified bots, exceptions, where the rule runs, and the request counts for the last 24 hours.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotProtection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Bot protection"
        ],
        "operationId": "setBotProtection",
        "summary": "Change the bot protection level",
        "description": "Sets the level (block_malicious, block_automations, challenge_bots, challenge_non_browsers, or challenge_everyone), turns protection on or off, or changes verified bots, exceptions (paths, addresses, and user agent fragments), and Block AI crawlers. Block AI crawlers is a flag the edge cache Worker reads, so it costs no Cloudflare rule; search engines are not blocked. Fields left out keep their value. The legacy mode field still works. The apply_bot_protection job adds the site's hostnames to the level's shared Cloudflare rule. Staging, preview, and preview environments always refuse crawlers and bots and answer 409: their protection is fixed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutBotProtectionRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/bot-protection/stats": {
      "get": {
        "tags": [
          "Bot protection"
        ],
        "operationId": "getBotStats",
        "summary": "Bot traffic in the last 24 hours",
        "description": "Returns counts for the environment's hostnames over the last 24 hours: `requests`, `challenged`, `blocked`, and `verified_allowed`, which is null when the zone has no Cloudflare Bot Management. `available` is false when Cloudflare does not report these events for the hostnames: the counts are zero then, and `note` says why.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Stats",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotStats"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/bot-protection/breakdown": {
      "get": {
        "tags": [
          "Bot protection"
        ],
        "operationId": "getBotBreakdown",
        "summary": "Request breakdown for the last 24 hours",
        "description": "Requests by Cloudflare's user agent name (browsers, named bots and tools, unclassified) and by answer (allowed, challenged, blocked). Only what Cloudflare Free can count is returned: challenged is null when the zone's plan does not report security events, and blocked counts 403 and 429 answers. There is no bot score, so people and bots that look like browsers share one class.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Breakdown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotBreakdown"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/analytics/usage": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "operationId": "getEnvironmentPlanUsage",
        "summary": "Plan usage for one environment: visits, bandwidth, and disk against the plan",
        "description": "Read from the hourly rollups of the node's access logs. The default window is the current billing period; period=previous reads the whole period before it. Bots are left out of visits and bandwidth. Each day carries the server bytes and, when Cloudflare has answered, the CDN bytes. CDN bandwidth reads Cloudflare for the environment's domains; when Cloudflare cannot answer, the meter says why.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Defaults to the start of the current billing period."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "current",
                "previous"
              ]
            },
            "description": "`previous` is the billing period before the current one (a month earlier, whole). It ignores `from` and `to`. The answer carries the dates it used."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Plan usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsUsage"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/analytics/usage": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "operationId": "getCompanyPlanUsage",
        "summary": "Plan usage across the company, with a row per site",
        "description": "Returns usage across the company's sites for one window, with a row per site. The window is the current billing period by default, the period before it with `period=previous`, or the `from` and `to` you send. A member limited to some sites gets the usage of those sites with no plan or billed figures.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Defaults to the start of the current billing period."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "current",
                "previous"
              ]
            },
            "description": "`previous` is the billing period before the current one (a month earlier, whole). It ignores `from` and `to`. The answer carries the dates it used."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Plan usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsUsage"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/analytics/{view}": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "operationId": "getEnvironmentAnalytics",
        "summary": "An analytics view for one environment",
        "description": "Views: visits, visits-dispersion, bandwidth, cdn-bandwidth, disk-space, response-codes, top-countries, top-asns, top-hosts, top-referrers, top-browsers, page-views, requests, top-requests, top-paths-bytes, cache-status, response-time, bot-traffic, status-codes, top-404, top-cached-paths, top-bypassed-paths, php-throughput, php-share, cache-series, response-series. cache-series and response-series answer one row per bucket and key (Hit, Miss, Bypass, or the status classes 2, 3, 4, 5), for stacked charts. top-paths-bytes ranks the busiest paths by bytes sent (unit bytes), among the 50 most requested paths of each day. status-codes ranks the exact HTTP status codes (301, 404, 500), top-404 ranks the paths that answered 404 for visitors that are not bots, and top-cached-paths and top-bypassed-paths rank the pages served from the page cache and the pages that ran PHP with no cached copy. php-throughput answers PHP requests per minute for each bucket, and php-share answers the share of requests that ran PHP against those served static or from the page cache. A server whose agent does not send these counts yet answers available false with a note. Most views read the hourly rollups of the node's access logs. cdn-bandwidth, visits-dispersion, top-browsers, and top-asns read Cloudflare for this environment's domains only. Visits follow the versioned counting rules in query_version. A view with nothing to show yet answers available false with a note. Retention is 13 months.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "view",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "time_span",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ],
              "default": "day"
            }
          },
          {
            "name": "traffic_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "visitors",
                "named_bots",
                "ai_crawlers",
                "automation_tools"
              ],
              "default": "all"
            },
            "description": "Only the `top-traffic-*` views read it."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The view",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/analytics/{view}": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "operationId": "getCompanyAnalytics",
        "summary": "An analytics view rolled up across the company's environments",
        "description": "Returns one view, such as `visits`, `bandwidth`, `response-codes`, or `top-countries`, added up over the environments of the sites the caller can see. The window runs from `from` to `to` (the last 7 days by default, and no further back than 396 days) in buckets of `time_span` (default `day`). `available` is false with a plain `note` when the source of a view has sent nothing yet.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "view",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "time_span",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ],
              "default": "day"
            }
          },
          {
            "name": "traffic_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "visitors",
                "named_bots",
                "ai_crawlers",
                "automation_tools"
              ],
              "default": "all"
            },
            "description": "Only the `top-traffic-*` views read it."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The view",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/monitor/status": {
      "get": {
        "tags": [
          "Monitor"
        ],
        "operationId": "getApmStatus",
        "summary": "Whether performance data is being collected, whether Monitor's performance part is on, and the mode",
        "description": "Returns `enabled` (data is being collected now), `tool_enabled` (Monitor's performance part is switched on), the `mode` (a window of 2, 4, 12, or 24 hours, or always on), `until` (when a window ends), and `last_data_at`. The data is kept for 7 days (`retention_days`).",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Performance data status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApmStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/monitor": {
      "put": {
        "tags": [
          "Monitor"
        ],
        "operationId": "setApm",
        "summary": "Start or stop collecting performance data",
        "description": "Queues set_apm (ADR 025). Start with enabled true and a mode: the node turns on a per request log for PHP requests (Nginx and the PHP prepend probe), checks the Nginx config with nginx -t, and reloads PHP-FPM. Modes: a 2, 4, 12, or 24 hour window, after which the node turns collecting off on its own, or always on. Every request is recorded while it is collecting. Stop with enabled false. Starting while Monitor's performance part is off turns it on first. The performance part itself, which only shows the Performance section of the Monitor tab, is PUT /environments/{id}/tools/monitor.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutApmRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/monitor": {
      "put": {
        "tags": [
          "Monitor"
        ],
        "operationId": "setApmTool",
        "summary": "Turn Monitor's performance part on or off",
        "description": "On shows the Performance section of the Monitor tab and lets a person start collecting. It holds no duration and does no node work. Off hides the section's reports, and stops a running collection first with a set_apm job (its id is stopped_collection_job_id). Reversible, so no confirm. Collecting is started and stopped with PUT /environments/{id}/monitor.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutApmToolRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApmToolResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/monitor/overview": {
      "get": {
        "tags": [
          "Monitor"
        ],
        "operationId": "getApmOverview",
        "summary": "Performance summary: throughput, average and p95 response time, error rate, and the time chart",
        "description": "Read from the minute summaries the node keeps (ADR 025). The API pulls the newest finished minutes from the node first. Times are milliseconds; the breakdown splits each request into PHP, MySQL, outside calls, and the rest. p95 is read from a histogram, so it is the upper edge of a bucket. Retention is 7 days.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The overview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApmOverview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/monitor/urls": {
      "get": {
        "tags": [
          "Monitor"
        ],
        "operationId": "listApmUrls",
        "summary": "The transactions table: one row per URL group",
        "description": "URL groups replace number, UUID, and long hex path segments with placeholders and drop the query string. Sort by impact (share of all time), average, max, count, or errors. Filter to errors, slow (average over 1 second), or uncached rows, and search with q.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Case-insensitive text the URL group must contain."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "impact",
                "avg",
                "max",
                "count",
                "errors"
              ],
              "default": "impact"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "errors",
                "slow",
                "uncached"
              ],
              "default": "all"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            },
            "description": "How many rows to return in one page: at most 500, and 100 when left out."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Transactions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApmUrlList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/monitor/url": {
      "get": {
        "tags": [
          "Monitor"
        ],
        "operationId": "getApmUrl",
        "summary": "One URL group: its breakdown, chart, histogram, and slowest requests",
        "description": "Slow samples hold the path without the query string.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The URL group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApmUrlDetail"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/monitor/spans": {
      "get": {
        "tags": [
          "Monitor"
        ],
        "operationId": "listApmSpans",
        "summary": "The WordPress, Database, and External tables: slowest plugins, hooks, queries, outside calls, and Redis calls",
        "description": "The time every PHP request spent in each plugin or theme, hook, database table and verb (for example wp_posts SELECT), outside host and method (for example api.sendgrid.com POST), or Redis command (by), summed from the totals the node keeps each minute (source totals). A node that sends no totals falls back to the spans of the slow requests it kept (source slow_requests, with considered saying how many requests were read); source none means nothing was collected. No SQL text, path, or query string is ever stored. Rows carry total, max, and average duration, share of the table, and calls a minute. Retention is 7 days. When by is plugin or hook, this needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "by",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "plugin",
                "hook",
                "query",
                "external",
                "redis"
              ]
            },
            "required": true
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "total",
                "max",
                "avg",
                "calls"
              ],
              "default": "total"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many rows to return in one page: at most 100, and 25 when left out."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Span table",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApmSpans"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/php/engine": {
      "get": {
        "tags": [
          "Monitor"
        ],
        "operationId": "getPhpEngine",
        "summary": "What PHP-FPM really runs with, read back from the node",
        "description": "The PHP version, the worker pool from the plan tier (process manager, workers, idle timeout, request limits), the effective ini values (memory_limit, max_execution_time, and more), OPcache, the live pool status, and the watchdog's recent restarts. Read from the files in the container, never from what the control plane asked for. Change them with PUT /environments/{id}/tools/php-settings and PUT /environments/{id}/php-performance.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The PHP engine",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhpEngine"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cache/stats": {
      "get": {
        "tags": [
          "Caching"
        ],
        "operationId": "getCacheStats",
        "summary": "Cache hits, misses, and hit ratio",
        "description": "Counts the requests in a window: `edge_hits`, `server_hits`, `misses`, and `bypass`, with `hit_ratio`, the hits divided by the hits plus the misses (null when there is nothing to count). The window runs from `from` to `to`, the last day by default and no further back than 396 days.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "time_span",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ],
              "default": "day"
            }
          },
          {
            "name": "traffic_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "visitors",
                "named_bots",
                "ai_crawlers",
                "automation_tools"
              ],
              "default": "all"
            },
            "description": "Only the `top-traffic-*` views read it."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Cache statistics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CacheStats"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cache/purges": {
      "get": {
        "tags": [
          "Caching"
        ],
        "operationId": "listCachePurges",
        "summary": "Purge history for an environment",
        "description": "Lists the cache purges asked for on the environment, one row for each purge job: its `status`, its `scope`, the URLs or tags, who asked, and when it finished. A page holds up to 200 rows (default 50).",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Purges",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurgeHistory"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cache/autoload": {
      "get": {
        "tags": [
          "Caching"
        ],
        "operationId": "getAutoloadSize",
        "summary": "Size of the options WordPress loads on every request",
        "description": "Measures the autoloaded rows of the options table of the environment's main site with a read-only database query on the node: how many options load on every request, their total size, and the five largest by name and size (never the values). over is true when the total passes 800 KB, the line most WordPress tools warn at. A large set slows every page that the cache does not serve. Changes nothing. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The autoload size",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoloadSize"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/cache/schedule": {
      "get": {
        "tags": [
          "Caching"
        ],
        "operationId": "getCachePurgeSchedule",
        "summary": "The scheduled cache purge of an environment",
        "description": "frequency is off, daily, or weekly. A purge runs at hour_utc (0 to 23, UTC), and on weekday for a weekly schedule (0 is Sunday). next_run_at is null while the schedule is off. An environment with no schedule answers off.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CachePurgeSchedule"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Caching"
        ],
        "operationId": "setCachePurgeSchedule",
        "summary": "Set the scheduled cache purge of an environment",
        "description": "Clears the edge and server caches every day or every week at the hour you choose, in UTC. The scheduler queues the same purge_cache job as Clear all caches, so every run has events and an activity entry. Saving the schedule is audited. A new schedule waits for its next slot and does not purge at once.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "edge.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutCachePurgeScheduleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CachePurgeSchedule"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/push": {
      "post": {
        "tags": [
          "Push"
        ],
        "operationId": "pushEnvironment",
        "summary": "Push tables and uploads to another environment",
        "description": "Takes a restore point of the target first, then copies the chosen tables and uploads folders, and runs a search and replace to the target's primary hostname. Code never moves by push. Undo works for 48 hours. Live is never the target: that answers 409 (use_copy_into_live) and points at POST /environments/{id}/copy-into-live.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/pushes": {
      "get": {
        "tags": [
          "Push"
        ],
        "operationId": "listPushes",
        "summary": "Pushes into an environment",
        "description": "Lists the jobs that pushed content into this environment, each as a Job, in pages of up to 200 (default 50).",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Pushes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/pushes/{id}/undo": {
      "post": {
        "tags": [
          "Push"
        ],
        "operationId": "undoPush",
        "summary": "Undo a push",
        "description": "Restores the target's restore point from before the push. Works for 48 hours and only once.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the push."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UndoPushRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/logs/{file}/clear": {
      "post": {
        "tags": [
          "Logs"
        ],
        "operationId": "clearLog",
        "summary": "Empty a log file",
        "description": "The node empties the file in place, on live and on staging, and the job writes an audit entry. Needs the files.write permission.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "error",
                "access",
                "cache",
                "php-fpm",
                "slow",
                "cron"
              ]
            },
            "description": "Which log to read."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "files.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClearLogRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/commit": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "commitEnvironment",
        "summary": "Commit the working tree changes of staging or a preview to its branch",
        "description": "Stages and commits the changes made over SFTP, SSH, wp-admin, WP-CLI, or plugin and theme updates, as the person who asks. Uploads, caches, wp-config.php, the wpwaterfall.yml ignore list, and files that look like secrets are never committed. If the branch moved on (a push or a merge), the commit is merged with it; a conflict changes nothing. Live answers 409: it has no working tree. Read GET /environments/{id}/working-tree first to see what the commit takes.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommitRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/working-tree": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "getWorkingTree",
        "summary": "Uncommitted changes of a staging or preview working tree",
        "description": "Files added, changed, and deleted since the commit the working tree runs, and changed files a commit leaves out because they look like secrets. `behind` is true when the branch has commits the working tree has not pulled yet. Live answers 409: its code is a read-only release.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Working tree status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkingTreeStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/working-tree/diff": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "getWorkingTreeDiff",
        "summary": "The line by line diff of a working tree, before a commit",
        "description": "For each changed file, a unified diff against the commit the working tree runs. Limits: 50 files, and 20,000 bytes of patch for each file (truncated is true when a patch was cut; omitted_files counts the files past the limit). A binary file is listed with no patch and no line counts. Files that look like secrets, such as .env and private keys, are named in blocked and their content is never read. wp-config.php, uploads, and caches are not part of a working tree commit at all. Read this before POST /environments/{id}/commit. Live answers 409: it has no working tree. A node agent too old to answer says so with 502.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The diff",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkingTreeDiff"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/working-tree/sync": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "syncWorkingTree",
        "summary": "Pull the branch head into a staging or preview working tree",
        "description": "After a push from a Git client or a merge, brings the working tree up to the head of its branch, changing only the files that differ. Uncommitted changes answer 409 working_tree_dirty, unless commit_message is sent: then the changes are committed first and merged with the new commits.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncWorkingTreeRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/git": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "getEnvironmentGit",
        "summary": "How code reaches an environment: its connection mode, the WP Waterfall remote, and a connected repository",
        "description": "One read for the Connection mode, WP Waterfall Git, and Connect a repository cards. connection_mode is sftp (a writable working tree) or git (code changes only by Git). Live is always git and cannot switch, so the dashboard shows these cards on staging and previews only; live's releases and rollback are under Deploys. wpwaterfall_remote.ssh has the clone address once Git over SSH is on. wpwaterfall_remote.https has the HTTPS address for Git access tokens on staging and previews; it needs Git over SSH on.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Git and connection details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvironmentGit"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/connection-mode": {
      "put": {
        "tags": [
          "Code"
        ],
        "operationId": "setConnectionMode",
        "summary": "Switch a staging or preview environment between SFTP mode and Git mode",
        "description": "SFTP mode makes the code writable (SFTP, SSH, WP admin, plugin installs). Git mode makes it read-only: it changes only by a push, a merge, or a pull from a connected repository. Switching to Git mode with uncommitted changes answers 409 working_tree_dirty unless commit_message is sent (commit first) or discard is true with confirm. Live answers 409 live_is_immutable. SFTP mode answers 409 external_repository_connected while a repository is connected.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutConnectionModeRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/git/ssh": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "enableGitOverSsh",
        "summary": "Turn on Git over SSH for a staging or preview environment",
        "description": "Serves the site repository to the environment's SSH user at /srv/git/site.git, using the SSH keys of the environment. Pushes to the environment's branch apply themselves. Needs SSH on. Safe to call again. Live answers 409 live_is_immutable.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "ssh.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyGitRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/git/import": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "importGitPush",
        "summary": "Check for pushes to the WP Waterfall remote and apply them",
        "description": "A push tells WP Waterfall by itself. This runs the same import by hand, for example when the push notice could not reach WP Waterfall. Live answers 409 live_is_immutable.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyGitRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/git/deploy-key": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "createDeployKey",
        "summary": "Make or show the site's deploy key for a connected repository",
        "description": "Returns the public key to add as a read-only deploy key on GitHub, GitLab, or Bitbucket. The private key never leaves WP Waterfall. 201 when a key was made, 200 when it existed. rotate with confirm makes a new pair.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeployKeyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The deploy key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployKey"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/git/connection": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "getSiteGit",
        "summary": "The external repository of a site, its environments, and the unlinked remote branches",
        "description": "Returns the connection (remote, staging branch, webhook, auto create switch), the site's deploy key, one row for staging and each preview environment (the remote branch it follows, its last pull, its status), and the remote branches that were pushed but have no environment. connection is null when no repository is connected. A preview environment with status waiting follows a remote branch that is not pushed yet.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The site's external repository",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteGit"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Code"
        ],
        "operationId": "connectGitRepository",
        "summary": "Connect an external Git repository to a site",
        "description": "One repository serves staging and every preview environment. Staging follows staging_branch. A preview environment follows the remote branch with its own name, or the one set with PUT /environments/{id}/git/remote-branch. Live is never connected. While connected, every staging and preview environment takes code only from the repository: Git and SFTP through WP Waterfall are off for them, and pushes to the WP Waterfall remote are refused. Every staging and preview environment must be in Git mode (409 switch_to_git_mode). Answers 201 with the webhook URL and secret (shown once) and one pull job per environment. Connecting again replaces the remote and keeps the webhook URL. Needs confirm.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSiteGitConnectionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Connected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutSiteGitConnectionResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "Code"
        ],
        "operationId": "updateGitConnection",
        "summary": "Turn automatic branch creation on or off",
        "description": "With auto_create_branches on, a push of a new remote branch creates a preview environment with that name when the name is valid and an included preview slot is free. It never creates an additional preview environment and never goes past the included allowance. Otherwise the branch is listed as unlinked.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSiteGitConnectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The site's external repository",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteGit"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Code"
        ],
        "operationId": "disconnectGitRepository",
        "summary": "Disconnect the external repository from a site",
        "description": "Removes the connection, the webhook secret, and every environment link. Git and SFTP through WP Waterfall work again on every staging and preview environment. The code stays as it is. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteGitConnectionResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/git/webhook-secret": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "rotateGitWebhookSecret",
        "summary": "Make a new webhook secret for the connected repository",
        "description": "The old secret stops working at once. The new one is shown once. Answers 404 not_connected when no repository is connected. Needs confirm.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmOnlyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook URL and new secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitWebhookInfo"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/git/unlinked-branches/create": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "createBranchFromRemote",
        "summary": "Create a preview environment for an unlinked remote branch",
        "description": "Makes a preview environment named like the remote branch, then pulls the branch into it. Uses an included preview slot only: answers 409 when none is free, and never makes an additional preview environment. The name must be a valid environment name.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnlinkedBranchRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/git/unlinked-branches/ignore": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "ignoreUnlinkedBranch",
        "summary": "Stop listing an unlinked remote branch",
        "description": "Removes the branch from the unlinked list. It appears again only if the branch is pushed again.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnlinkedBranchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ignored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnlinkedBranchIgnored"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/git/remote-branch": {
      "put": {
        "tags": [
          "Code"
        ],
        "operationId": "setRemoteBranch",
        "summary": "Choose the remote branch a preview environment follows",
        "description": "By default a preview environment follows the remote branch with its own name. This sets another one, or null to go back to the name. The environment is then updated from that branch, replacing its code (the old head is kept). Staging follows the connection's staging_branch and cannot be changed here, and live is never connected. A remote branch that another environment follows answers 409. Needs confirm.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutRemoteBranchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The environment's link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoteBranchChanged"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/git/pull": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "pullGitRepository",
        "summary": "Pull now from the connected repository",
        "description": "Fetches the remote branch this environment follows with the deploy key and updates the environment, fast forward only. A branch whose remote branch does not exist yet finishes as waiting and nothing changes. When the branch does not contain the environment's commit, the job fails with not_fast_forward; replace with confirm makes the environment's branch the remote's and keeps the old head. Live answers 409 live_is_immutable.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GitPullRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/git/tokens": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "listGitTokens",
        "summary": "List the HTTPS Git access tokens of an environment",
        "description": "Name, scope (read or write), the first characters, expiry, last use, and who made each token. Revoked tokens are left out. The tokens themselves are never shown again.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The environment's Git tokens",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitTokenList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "createGitToken",
        "summary": "Make an HTTPS Git access token for a staging or preview environment",
        "description": "The token is the password for git clone, fetch, and (with scope write) push over HTTPS at wpwaterfall_remote.https.url. It is shown once; WP Waterfall stores only its SHA-256 hash. It works for this environment only and expires after expires_in_days (default 90). Pushes to the environment's branch apply themselves, like a push over SSH. Live answers 409 live_is_immutable. Needs confirm. The job refreshes HTTPS Git on the node; it is null while Git over SSH is off.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGitTokenRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The token, shown once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitTokenCreated"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/git/tokens/{token_id}": {
      "delete": {
        "tags": [
          "Code"
        ],
        "operationId": "revokeGitToken",
        "summary": "Revoke an HTTPS Git access token",
        "description": "The token stops working at once (a node may accept it for up to a minute from its cache). Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "token_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the Git access token."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitTokenRevoked"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/add-ons": {
      "get": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "listSiteAddons",
        "summary": "Site add-ons, their prices, and whether each is on",
        "description": "Every add-on in the order the Add-ons tab shows them, with its price from the billing catalog, how it is taken (toggle, request, connect, add_to_plan, or enable), whether it is on, the purchase of a self-serve add-on, and the latest request for a contact us add-on. Hourly backups answer for the environment in environment_id, the live environment by default.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "environment_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Per environment add-ons answer for this environment. The live environment by default."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Add-ons",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteAddonList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/object-cache": {
      "get": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "getSiteObjectCache",
        "summary": "The live state of the Redis object cache",
        "description": "Reads the object cache of one environment from its node: whether Redis runs, the memory used and its cap, the number of keys, hits, misses, and the hit rate (from Redis INFO), and the last state recorded when the add-on was switched on. With verify=true the node also runs the check again, which sets and deletes one short lived key through WordPress, and reports verified with the round trip time and the drop-in in use, or the reason it failed. Answers for the live environment unless environment_id names another one. Answers 409 when the environment is not running.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "environment_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The environment to read. The live environment by default."
          },
          {
            "name": "verify",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "description": "Run the check again on the node."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The object cache state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectCacheStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/add-ons/{addon_id}/enable": {
      "post": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "enableSiteAddon",
        "summary": "Turn on an add-on for a site",
        "description": "Queues a job that switches the add-on on in the site's live container. The add-on is on once the job succeeds. For the object cache, the node checks that WordPress sets and reads a key in Redis before the job succeeds; when it can not, the job fails with the reason, the cache is off again, and the add-on is not billed. Only add-ons with the toggle action.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "addon_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The add-on key, such as additional_disk."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The node is switching the add-on on. The body is the Job object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/add-ons/{addon_id}/disable": {
      "post": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "disableSiteAddon",
        "summary": "Turn off an add-on for a site",
        "description": "Queues a job that switches the add-on off in the site's live container. The add-on is off once the job succeeds. Only add-ons with the toggle action.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "addon_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The add-on key, such as additional_disk."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The node is switching the add-on off. The body is the Job object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/add-ons/{addon_id}/purchase": {
      "post": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "purchaseSiteAddon",
        "summary": "Buy or change a self-serve add-on",
        "description": "Self-serve add-ons only: additional_disk (quantity: the 20 GB blocks the account holds in total, 1 to 10, shared by every site), hourly_backups (for one environment, $20 a month, starting at every 6 hours; change to every hour with PUT /environments/{id}/backup-schedule/hourly at the same price, each backup kept 24 hours), external_backups (billed while a bucket is connected; connect one first), custom_ssl (per site, $200 a year: the whole year is charged to the saved card now on its own yearly Stripe subscription and renews every year; 402 `card_declined` when the card does not pay, and nothing starts), and disaster_recovery (per site on a shared node, from $300 a month: $300 for a site up to 50 GB plus $100 for each further 50 GB, where the size is the disk the plan lets one site use, so the price is $300 for 20 GB or 50 GB, $400 for 65 GB or 100 GB, and $600 for 125 GB or 150 GB; a standby copy of the live environment at another provider with automatic failover and failback, with no uptime guarantee or service credits; the standby is ready once GET /environments/{id}/disaster-recovery shows the state active, and a failover can lose a few minutes of writes. The purchase sets the state to setting_up and queues a provision_standby job, whose id is in job_ids. A site on a dedicated server answers 409: it asks with a request instead, at the same price. Answers 503 with the message Standby Failover is not open yet. while the sale is closed). The others bill at once: the rest of this period prorated on the next invoice, then monthly from the next period. Needs a saved payment method (402 otherwise). A change replaces the purchase and credits its unused days. Additional disk space queues one set_disk_quota job per running environment. Sending the same purchase again changes nothing. Answers 409 when removing blocks would leave less disk than the account uses, and 429 after 20 purchases from one company in an hour.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "addon_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The add-on key, such as additional_disk."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseSiteAddon"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The add-on is on; node jobs, if any, are in job_ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteAddonChange"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/add-ons/{addon_id}/cancel": {
      "post": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "cancelSiteAddon",
        "summary": "Turn off a self-serve add-on",
        "description": "Ends the add-on now. The unused days of this period are credited to the account and the charge stops; for custom_ssl the credit is the unused days of its own year, to the account balance and not the card, and its own subscription ends. Additional disk space sets every quota back (409 when the account uses more disk than the plan alone has). Hourly backups go back to the daily schedule; backups already taken stay until they expire. Standby Failover turns the state off and frees the standby slot; it answers 409 while the site runs on its standby (fail back first). External backups end when the bucket is removed on the Backups tab, so this answers 409 for them.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "addon_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The add-on key, such as additional_disk."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSiteAddon"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The add-on is off; node jobs, if any, are in job_ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteAddonChange"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/add-ons/{addon_id}/retry": {
      "post": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "retrySiteAddon",
        "summary": "Retry the node work of a self-serve add-on",
        "description": "Queues the node work of the add-on again, for environments that do not have it yet, such as a set_disk_quota job that failed. Charges nothing and is safe to send more than once.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "addon_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The add-on key, such as additional_disk."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetrySiteAddon"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. New node jobs, if any, are in job_ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteAddonChange"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/add-on-requests": {
      "post": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "requestSiteAddon",
        "summary": "Ask WP Waterfall to add a contact us add-on to a site",
        "description": "Records a request that WP Waterfall staff apply by hand, such as a dedicated server, Standby Failover for a dedicated server (from $300 a month, by site size), or a reverse proxy. Nothing is charged until staff apply the add-on. Answers 409 while an open request for the same add-on exists, and 429 after 10 requests from one company in 24 hours.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAddOnRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddOnRequest"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/offsite-backup": {
      "get": {
        "tags": [
          "Backups"
        ],
        "operationId": "getOffsiteBackup",
        "summary": "Read the site's off-site backup connection, runs, and snapshots",
        "description": "The bucket connection (never its credentials), the newest runs, and the snapshot list from the latest list job. `available` is false while off-site backups are turned off on this WP Waterfall install.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Off-site backups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OffsiteBackupStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Backups"
        ],
        "operationId": "setOffsiteBackup",
        "summary": "Connect the site's own bucket for off-site backups",
        "description": "Takes an S3-compatible endpoint and keys, or a Google Cloud Storage service account key, once. WP Waterfall seals them, makes a restic repository password unless you send one to reuse an existing repository, and queues a test that creates the repository. The answer holds the generated password this one time: save it, because with it and your bucket you can restore without WP Waterfall. The endpoint must be https and public. Connecting sends the whole database off the platform, so it needs the database permission.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutOffsiteBackupRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The connection, the one-time repository password, and the test job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OffsiteBackupConnected"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "Backups"
        ],
        "operationId": "updateOffsiteBackup",
        "summary": "Pause the daily off-site backup or change its retention",
        "description": "Send `enabled: false` to pause the daily off-site backup, or change how many snapshots stay: `keep_last` (0 to 100), `keep_daily` (0 to 365), and `keep_weekly` (0 to 104). At least one snapshot must stay (422 otherwise). The site must have a bucket connected.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchOffsiteBackupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OffsiteConnection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Backups"
        ],
        "operationId": "deleteOffsiteBackup",
        "summary": "Remove the site's off-site backup connection",
        "description": "WP Waterfall forgets the credentials and the repository password and stops the daily run. Snapshots already in your bucket stay there.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OffsiteBackupRemoved"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/offsite-backup/test": {
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "testOffsiteBackup",
        "summary": "Test the off-site backup connection",
        "description": "Starts a job that tests the saved bucket connection from the site's live environment, and returns 202 with the Job. The body is an empty object. The site must have a bucket connected.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OffsiteBackupEmptyRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The node is checking the bucket and the repository. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/offsite-backup/snapshots/refresh": {
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "refreshOffsiteSnapshots",
        "summary": "Read the snapshot list from the bucket again",
        "description": "When the job ends, GET /sites/{id}/offsite-backup shows the new list.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OffsiteBackupEmptyRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The node is listing the snapshots in the bucket. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/offsite-backup/restore": {
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "restoreOffsiteBackup",
        "summary": "Restore an off-site snapshot into staging or a preview",
        "description": "Restores the database, the uploads, or the code of one snapshot into a staging or preview environment of the same site. Live is never a target. Code comes back only into an environment in SFTP mode, never over a Git mode release, and wp-config.php is never replaced. WP Waterfall takes a restore point of the target first.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OffsiteRestoreRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The node is restoring the snapshot. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/offsite-backup/run": {
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "runOffsiteBackup",
        "summary": "Back up an environment to the site's bucket now",
        "description": "Uploads an encrypted restic snapshot of the environment's code, uploads, and a fresh database dump, then applies the retention. Each succeeded run is billed as one off-site backup plus the GB it uploaded.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OffsiteBackupEmptyRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The node is backing up to your bucket. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/auto-updates": {
      "get": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "getAutoUpdates",
        "summary": "Read the automatic updates and Safe Updates state of an environment",
        "description": "The switches for plugins and themes (all, or single names; the names in disabled are the ones your settings exclude), the Safe Updates add-on (entitled), whether Safe Updates is on here, its schedule (the days of the week and the two hour window, in the chosen time zone), the pages it tests (up to 10, the home page first), the CSS selectors it leaves out, the required match, how a page is prepared before its picture, the deploy to live choice, the updates held back because they broke a check (skipped), the last run (its date, result, what changed, the pictures, the review, the deploy, and the commit in Git mode), and when the next run starts. mode says how an update reaches the environment: git saves it as a Git commit and runs it as a new release, sftp changes the working copy. tier is plain for the free daily run and safe for the weekly Safe Updates run. supported is false on live and while an external repository is connected, with a plain reason. Always answers 200. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The automatic update state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdateState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "setAutoUpdates",
        "summary": "Change the Safe Updates and deploy settings of an environment",
        "description": "Send only the fields to change. safe_enabled turns Safe Updates on (it needs the add-on, 402 safe_updates_required without it) and, when every switch is off, turns on the switch for every plugin and theme. deploy_to_live ships staging's new code to live after a run passes every check (staging only; code only, never the database or uploads; off by default). timezone, safe_days (the days of the week, 0 is Sunday), and safe_hour set the window, which lasts two hours. pages lists 1 to 10 paths, any of them (the home page too), each with its own required_match (50 to 100, 95 by default: the share of that page that must match its picture from before the update) and CSS selectors of elements to take out of that page. A page below its own required_match makes the run wait for your confirmation. exclude_selectors (up to 20) takes elements out of the pictures of every page. capture sets how a page is prepared before its picture: wait seconds (0 to 15), enable_animations, and flatten_sticky. Every page is scrolled before its picture. Live answers 409 live_is_immutable, and an environment with a connected external repository answers 409 external_repository_connected. Turning a setting off is always allowed. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutAutoUpdateSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdateState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/auto-updates/run": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "runAutoUpdates",
        "summary": "Run automatic updates on an environment now",
        "description": "Queues an auto_update_run job for the plugins and themes whose switch is on. It takes a restore point, updates one at a time with a site check after each, and on a failed check restores the restore point and leaves the update out. With Safe Updates on it also compares pictures of the pages and asks a model to review the differences. In Git mode it saves the updates as one commit by WP Waterfall Automatic Updates and the normal build and swap run it. Live answers 409 live_is_immutable, and an environment with a connected external repository answers 409 external_repository_connected. With every switch off it answers 409 auto_updates_off. Another change running on the environment answers 409 job_already_running. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoUpdateRunNowRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/auto-updates/apply": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "applyAutoUpdateAnyway",
        "summary": "Apply one held back update anyway",
        "description": "Queues an auto_update_run job for one plugin or theme that a check held back. The health check still runs, and a site that breaks is restored, but the pictures and the review no longer hold the update back. Live answers 409 live_is_immutable, and an environment with a connected external repository answers 409 external_repository_connected. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoUpdateApplyRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/auto-updates/recommended-pages": {
      "get": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "getAutoUpdateRecommendedPages",
        "summary": "The pages Safe Updates recommends testing",
        "description": "The home page first, then the most visited pages of the site over the last 30 days from its analytics, then, when those are fewer than 10, pages found on the site itself (the screenshot service opens the home page and reads its links, header and footer menus first, leaving out login, admin, feed, and file links), 10 in all, each with a source (home, analytics, or discovered) and its visits when known. Finding pages shares the limit of 20 an hour for each company with previews; over it the answer still comes, with the pages already known and a plain note. This changes nothing: pressing Use recommended pages in the dashboard reads this and saves the list with PUT. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The recommended pages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdateRecommendedPages"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/auto-updates/preview": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "previewAutoUpdateTest",
        "summary": "Preview the visual regression test of one page",
        "description": "Takes two pictures of one page of this staging or preview environment a few seconds apart, with the exclusions, the required match, and the capture settings in the body (or the saved ones), and says whether dynamic content was found, how much of the page matches, and a key for the difference picture (read it with the picture route). It changes nothing on the site. A company may run 20 previews an hour (429 after that). Live answers 409 live_is_immutable, and an environment with a connected external repository answers 409 external_repository_connected. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoUpdatePreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result of the preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdatePreview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/auto-updates/runs/{run_id}/approve": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "approveAutoUpdateRun",
        "summary": "Approve a run that waits for your confirmation",
        "description": "A run whose pages matched less than the required match stops with the outcome needs_confirmation, with the updates on staging and the restore point kept. Approve saves the updates and, when the run was set up to deploy to live, ships them to live (code only). It runs as one quiet job. Send confirm: true. A run that is not waiting answers 409 not_waiting_for_confirmation. A repeated approve returns the same job. Needs the permission to deploy code.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the run."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoUpdateResolveRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/auto-updates/runs/{run_id}/reject": {
      "post": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "rejectAutoUpdateRun",
        "summary": "Turn down a run that waits for your confirmation",
        "description": "Puts the restore point back on staging and marks the run rejected. The previous baseline pictures stay. Send confirm: true. A run that is not waiting answers 409 not_waiting_for_confirmation. A repeated reject returns the same job. Needs the permission to deploy code.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the run."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoUpdateResolveRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/auto-updates/picture": {
      "get": {
        "tags": [
          "Plugins and themes"
        ],
        "operationId": "getAutoUpdatePicture",
        "summary": "A short-lived link to a picture from the last Safe Updates run",
        "description": "Send a key from the last run (before_key, after_key, or diff_key). The key must belong to this environment. The link works for five minutes. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "key",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 400,
              "description": "A picture key from the last run, such as visual.diff_key."
            },
            "description": "A picture key from the last run, such as visual.diff_key.",
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoUpdatePictureLink"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility": {
      "get": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "getAccessibility",
        "summary": "Read the Accessibility add-on of a site",
        "description": "Whether the add-on is on for the site, whether the site can be scanned (it needs a live environment), the pages per scan setting, the weekly scheduled scan, the page scans left this month (7,500 a month for each site, counted per calendar month in UTC), the price (volume priced for the whole company: $10 a month for each of the first 2 sites with it on, $5 a month for each site after that), the page list state, the running scan if there is one, the latest scan with its score, and the score formula in plain words. Reads the database only.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The add-on state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "setAccessibilitySettings",
        "summary": "Change the pages per scan and the weekly scan of a site",
        "description": "pages_per_scan sets how many pages a scan takes when the request names no number (1 to 2,500, default 25). scheduled_weekly turns on a scan every week (off by default); each scheduled scan uses pages of the same monthly allowance. The add-on must be on (409 accessibility_not_enabled). It does no node work and costs nothing, so there is no confirm.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutAccessibilitySettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/enable": {
      "post": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "enableAccessibility",
        "summary": "Turn the Accessibility add-on on for a site",
        "description": "Turns the add-on on and adds one site to the company's monthly charge: $10 a month for each of the first 2 sites, $5 a month for each site after that, charged to the saved card with the unused days of the month prorated. Send confirm: true. Any account type may buy it. It needs a card on file (402) and a live environment (409 accessibility_live_only). The scan works on the live site only (409 accessibility_live_only for a site with no live environment, a sandbox, or a test site).",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnableAccessibilityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The state with the add-on on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/disable": {
      "post": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "disableAccessibility",
        "summary": "Turn the Accessibility add-on off for a site",
        "description": "Turns the add-on off. The monthly charge drops by one site and the unused days are credited. The reports already made stay readable until they are removed by the retention rules (the last 10 scans of the site, pictures 90 days). A scan that is running finishes.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The state with the add-on off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/pages": {
      "get": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "listAccessibilityPages",
        "summary": "List the pages a scan will take",
        "description": "The page list of the site: the home page first, then the pages found in the sitemap and in the links of the home page (only the site's own live hostnames), and the addresses you added. A page you removed is not listed. The list is found by the scanner machine, not by the control plane: it is refreshed by a scan when it is older than 24 hours, or by POST /sites/{id}/accessibility/pages/refresh.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The pages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityPageList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "addAccessibilityPages",
        "summary": "Add pages to the page list",
        "description": "Adds up to 100 addresses to the page list. Each must be https and on one of the site's own live hostnames (422 accessibility_not_same_site for any other host). Addresses are normalized (no fragment, no tracking parameters) and a repeat is ignored. Costs nothing until a scan takes them.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddAccessibilityPagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The page list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityPageList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/pages/{page_id}": {
      "delete": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "removeAccessibilityPage",
        "summary": "Remove a page from the page list",
        "description": "A page you added is deleted. A page the scanner found is marked removed, so the next discovery does not bring it back. The home page cannot be removed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "page_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the page in the accessibility page list."
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The page list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityPageList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/pages/refresh": {
      "post": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "refreshAccessibilityPages",
        "summary": "Find the pages of the live site again",
        "description": "Queues a scanner run that reads the sitemap and the links of the home page and updates the page list. It scans no page and uses no page of the allowance. It runs as a job (accessibility_scan, kind discover). The scan works on the live site only (409 accessibility_live_only for a site with no live environment, a sandbox, or a test site).",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the scan record of the discovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityScan"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/scans": {
      "post": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "createAccessibilityScan",
        "summary": "Scan the live site for accessibility issues",
        "description": "Starts a scan of the live site. It takes max_pages pages (default: the pages per scan setting, 25 unless changed; at most 2,500) from the page list, the home page first, or exactly the urls you send. Each page is opened in a browser on a scanner machine, shot after its animations and fonts settle, and checked with axe-core. A big scan runs in batches of about 25 pages and takes hours for 2,500 pages: poll GET /sites/{id}/accessibility/scans/{scan_id} for progress. It uses pages of the site's allowance of 7,500 a month: a scan that asks for more than remain runs the remaining pages, and with none left it is refused with 409 accessibility_monthly_cap_reached. One scan runs at a time for a site (409 accessibility_scan_running). The add-on must be on (409 accessibility_not_enabled). The scan works on the live site only (409 accessibility_live_only for a site with no live environment, a sandbox, or a test site). There is no cancel.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccessibilityScanRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the scan record. Poll it until its status is done, partial, or failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityScan"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "get": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "listAccessibilityScans",
        "summary": "List the accessibility scans of a site",
        "description": "The last 10 scans of the site, newest first, each with its status, progress, score and label, the issue counts by impact, and the page counts. Discovery runs are not listed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The scans",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityScanList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/scans/{scan_id}": {
      "get": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "getAccessibilityScan",
        "summary": "Read one accessibility scan",
        "description": "The status and progress of the scan, its score out of 100 and the label (Excellent, Good, Needs work, or Poor), the issue counts by impact, and the page counts. The score formula is on GET /sites/{id}/accessibility.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "scan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the accessibility scan."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The scan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityScan"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/scans/{scan_id}/pages": {
      "get": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "listAccessibilityScanPages",
        "summary": "List the pages of a scan with their scores",
        "description": "One row for each page of the scan: its address, status, score out of 100, label, issue counts by impact, whether its picture is still kept, and the reason a failed page failed.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "scan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the accessibility scan."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The pages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityScanPageList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/scans/{scan_id}/rules": {
      "get": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "listAccessibilityRules",
        "summary": "List the failing rules of a scan",
        "description": "The issues grouped by axe rule: the rule id, its impact, what it checks, the WCAG criteria, a one sentence fix, and how many elements on how many pages fail it. Most serious first.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "scan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the accessibility scan."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The rules",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityRuleList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/scans/{scan_id}/issues": {
      "get": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "listAccessibilityIssues",
        "summary": "List the issues of a scan with their selectors",
        "description": "One row for each failing element: the page address, the rule id, the impact, the CSS selector of the element, its HTML (cut to 500 characters; page content, show it as plain text only), what failed, how to fix it, the WCAG criteria, the help link, and the box of the element in the page picture. Filter by impact, page_id, or rule_id. Most serious first.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "scan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the accessibility scan."
          },
          {
            "name": "impact",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "critical",
                "serious",
                "moderate",
                "minor"
              ]
            }
          },
          {
            "name": "page_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "rule_id",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: at most 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The issues",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityIssueList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/scans/{scan_id}/pages/{page_id}/screenshot": {
      "get": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "getAccessibilityScreenshot",
        "summary": "Get a short lived link to the picture of a scanned page",
        "description": "A link to the full page picture, valid for 5 minutes, with its size. The issue boxes are in pixels of this picture. Pictures are kept 90 days (404 after). The link is signed and works for this one picture.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "scan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the accessibility scan."
          },
          {
            "name": "page_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the page in the accessibility page list."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The picture link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityScreenshotLink"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/accessibility/scans/{scan_id}/export": {
      "get": {
        "tags": [
          "Accessibility"
        ],
        "operationId": "exportAccessibilityScan",
        "summary": "Export the report or the issue list",
        "description": "format json, csv, or pdf; scope report (the whole report: score, pages, rules, issues) or issues (the issue list only, json or csv). The csv of the report is the page table. A spreadsheet cell that starts with =, +, -, or @ gets a leading apostrophe so it cannot run as a formula. The json report is the AccessibilityReport object. An export holds at most 20,000 issues.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "scan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the accessibility scan."
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "pdf"
              ],
              "default": "json"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "report",
                "issues"
              ],
              "default": "report",
              "description": "report is the whole report. issues is the issue list only (json or csv)."
            },
            "description": "report is the whole report. issues is the issue list only (json or csv)."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The file. json is the AccessibilityReport; csv is text/csv; pdf is application/pdf.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessibilityReport"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/audit/export": {
      "get": {
        "tags": [
          "Audit log"
        ],
        "operationId": "exportAuditLog",
        "summary": "Export the company audit log",
        "description": "Streams the audit log of the active company for a date range as CSV (the default) or NDJSON (format=ndjson, one JSON object per line). Needs the activity.read permission, so a member limited to some sites cannot call it. The range starts at from and ends at to (default now), at most 92 days long: a longer span answers 422, and you read it in several requests. Rows come oldest first. Each row has the person or key, the action, the target, the address and browser, the stored details with secrets already removed, and its chain position and hashes (see the audit log help article for what the chain shows). The response is read from the database in steps, so a large log never sits in memory. At most 2 exports for one company run at once (429 past that). Every export writes an audit entry (audit.export) that names the range and format.",
        "security": [
          {
            "bearerAuth": [
              "activity:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Start of the range, inclusive (RFC 3339).",
            "required": true
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "End of the range, inclusive. Defaults to now. At most 92 days after `from`."
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "ndjson"
              ],
              "default": "csv"
            }
          },
          {
            "name": "actor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Keep only what one person or API key did (the id on the activity list)."
          },
          {
            "name": "action",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Keep only one action name, such as `POST /v1/sites`."
          }
        ],
        "x-wpwaterfall-scope": "activity:read",
        "x-wpwaterfall-permission": "activity.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The rows as CSV, or as NDJSON when format is ndjson",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/audit/exports": {
      "post": {
        "tags": [
          "Audit log"
        ],
        "operationId": "startAuditExport",
        "summary": "Ask for a long export of the company audit log",
        "description": "Builds the audit log of the active company for a range of up to 396 days (13 months, as long as the log is kept) into a CSV or NDJSON file in the background, for ranges longer than the 92 days GET /audit/export streams. Needs the activity.read permission, so a member limited to some sites cannot call it. Answers 202 with the request. When the file is ready the person who asked gets a notice (and an email, per their notification settings), and POST /audit/exports/{id}/download-link gives a short-lived link. The file stays 48 hours. A start before the retention window answers 422. Limits follow the size of the company: a row limit per file (the file says when it stopped there) and a number of long exports per 24 hours; one export is built at a time (429 past either limit). The export writes an audit.export entry and the job writes its own entries.",
        "security": [
          {
            "bearerAuth": [
              "activity:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "activity:read",
        "x-wpwaterfall-permission": "activity.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartAuditExportRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The request that was queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditExportRequest"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "get": {
        "tags": [
          "Audit log"
        ],
        "operationId": "listAuditExports",
        "summary": "List long audit log exports",
        "description": "The long exports the company asked for, newest first, with their state: queued, building, ready, failed, or expired.",
        "security": [
          {
            "bearerAuth": [
              "activity:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "activity:read",
        "x-wpwaterfall-permission": "activity.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Export requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditExportRequestList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/audit/exports/limits": {
      "get": {
        "tags": [
          "Audit log"
        ],
        "operationId": "getAuditExportLimits",
        "summary": "Read the limits for long audit log exports",
        "description": "The tier of the company (from the number of sites), the row limit of one file, the long exports allowed in 24 hours and used so far, the retention in days, and how long a finished file stays.",
        "security": [
          {
            "bearerAuth": [
              "activity:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "activity:read",
        "x-wpwaterfall-permission": "activity.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The limits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditExportLimits"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/audit/exports/{id}": {
      "get": {
        "tags": [
          "Audit log"
        ],
        "operationId": "getAuditExport",
        "summary": "Read one long audit log export",
        "description": "Returns one long export of the audit log: its `status` (`queued`, `building`, `ready`, `failed`, or `expired`), the range and filters, the row count and size, `truncated` when the file stopped at the row limit, and `expires_at`, when the file leaves storage. Get the file with POST /audit/exports/{id}/download-link. A Site Admin or Site Developer gets 403.",
        "security": [
          {
            "bearerAuth": [
              "activity:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the audit log export."
          }
        ],
        "x-wpwaterfall-scope": "activity:read",
        "x-wpwaterfall-permission": "activity.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The export request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditExportRequest"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/audit/exports/{id}/download-link": {
      "post": {
        "tags": [
          "Audit log"
        ],
        "operationId": "createAuditExportDownloadLink",
        "summary": "Get a download link for a finished audit log export",
        "description": "A signed link that works for 15 minutes and downloads the file. Answers 409 until the export is ready, 410 once it expired, and 503 where the server has no download storage. Each call is written to the audit log.",
        "security": [
          {
            "bearerAuth": [
              "activity:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the audit log export."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "activity:read",
        "x-wpwaterfall-permission": "activity.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditExportDownloadLink"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/integrity-check": {
      "post": {
        "tags": [
          "Tools"
        ],
        "operationId": "runIntegrityCheck",
        "summary": "Check the files of an environment against the official copies",
        "description": "Queues an integrity check (a job). It compares WordPress core and the plugins from wordpress.org with their official checksums, looks for PHP files in the uploads folder and for well known web shell names, and, where the code is a read-only Git mode release, lists any file that differs from the release as it was built. It is an integrity check, not a malware scanner: it fixes nothing and finds nothing that still matches an official copy. It changes nothing on the site. The result is stored: read it with GET /environments/{id}/integrity when the job succeeds. A site whose server has not been updated for the check answers 409 with the code node_update_needed. WP Waterfall also runs the check once a week on every running environment. Needs WordPress on the environment: without it the answer is 409 with the code wordpress_not_installed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/integrity": {
      "get": {
        "tags": [
          "Tools"
        ],
        "operationId": "getIntegrity",
        "summary": "Read the latest integrity check of an environment",
        "description": "The newest stored result: the status (clean, suspicious, or incomplete), when it ran and who started it, what was compared, and up to 200 findings with a path inside the site and a short sentence each. latest is null until a check has run.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The latest result, or null",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrityLatest"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/malware": {
      "get": {
        "tags": [
          "Tools"
        ],
        "operationId": "listMalwareFindings",
        "summary": "List what the malware scanner found in an environment",
        "description": "Newest first, up to `limit` (default 100, at most 200). WP Waterfall scans everything that enters a site: migrations, uploads through WP Waterfall, deploys of code, plugin and theme installs, and, every few hours and after an SFTP session, the new and changed files of the uploads folder (and of the code in SFTP mode). A file that looks like malware is moved to quarantine on the server (status `quarantined`), never deleted; a refused deploy, upload, or install is `blocked`; a weaker hint is `reported` and stays where it is. `last_scan` is the newest node scan of this environment. Once a day, and with every scan you start, the scan also reads the rows of the WordPress tables, read only: a row that looks wrong is a finding with `source: database_scan`, the path `database/<table>/<name>`, and `database` (the table, the row, and a short excerpt). A row is never moved, changed, or deleted. `last_database_scan` says when the database was last scanned and whether all of it was read: `partial` means a table was too big to read in one scan, and is never the same as clean.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            },
            "description": "How many rows to return in one page: at most 200, and 100 when left out."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The findings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MalwareFindingList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/malware/scan": {
      "post": {
        "tags": [
          "Tools"
        ],
        "operationId": "scanForMalware",
        "summary": "Scan the new and changed files and the database of an environment for malware now",
        "description": "Queues a node scan (a job) of the files that are new or changed since the last scan, in the uploads folder and, in SFTP mode, in the code. A file that looks like malware is moved to quarantine and listed by GET /environments/{id}/malware. The same job reads the rows of the WordPress tables, read only, and lists a row that looks wrong in the same list. A site whose server has not been updated for the scanner answers 409 with the code node_update_needed.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/malware-findings/{id}/dispute": {
      "post": {
        "tags": [
          "Tools"
        ],
        "operationId": "disputeMalwareFinding",
        "summary": "Say a malware finding is wrong",
        "description": "Emails the staff the file, the reason, and your note in your name, and marks the finding `disputed`. Nothing is charged. Support either puts the file back (it was a false alarm) or confirms the finding. Sending it again answers 200 with the same finding. Answers 409 `malware_finding_decided` when support already decided.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the malware finding."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisputeMalwareFindingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The finding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MalwareFinding"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/disaster-recovery": {
      "get": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "getDisasterRecovery",
        "summary": "Read the Standby Failover state of a site",
        "description": "The state of the site's standby copy: off, setting_up, active, failing_over, degraded, resyncing, or failing_back, the setup step while it sets up, the standby provider and location, the replication lag, where the site runs now (primary or standby), the fencing epoch, and when an automatic failback is due. sla_applies is true only in the state active, when the standby copy is ready to take over. It is not an uptime guarantee: WP Waterfall makes none. monthly_cents is what the site pays a month, or the price for its size before it buys: $300 up to 50 GB and $100 more for each further 50 GB, on a shared node and on a dedicated server. The state is off until the add-on is bought. Answers 404 for an environment of another company.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The Standby Failover state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisasterRecovery"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/disaster-recovery/failback": {
      "post": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "failbackDisasterRecovery",
        "summary": "Fail back to the home server, or swap the roles",
        "description": "Owners and admins only. Queues a failback_site job while the site runs on its standby. The failback is never blind: it waits until the old primary is resynced and healthy, freezes writes for a few seconds for the last delta, then moves traffic back. With role_swap true the standby stays the primary and the old primary becomes the standby. Answers 409 when the site does not run on its standby.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.delete",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HaFailbackRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The failback_site job is queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/disaster-recovery/uptime": {
      "get": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "getUptimeReport",
        "summary": "Read the measured uptime of a site",
        "description": "What the outside probes measured this month while the standby copy was active, in UTC: uptime_percent, the downtime that counts, and each incident. It is information only: WP Waterfall makes no uptime guarantee and gives no credits for downtime. Time in the daily 2 am to 5 am window of the site's region and time measuring was paused are left out. uptime_percent is null until the probes have measured the month. Answers 404 for an environment of another company.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The measured month",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UptimeReport"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/enterprise-support": {
      "get": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "getEnterpriseSupport",
        "summary": "Read the Enterprise Support of the company",
        "description": "Where the company's Enterprise Support stands, with no site needed. mode is included for an Enterprise account (every level includes it, so nothing is charged and enabled is true) and add_on for any other company, which can buy it for $500 a month. monthly_cents is that price, or null when the support is included. purchase is the add-on that is on now, with the day it renews, and support holds the dedicated Slack channel and the named support contact once they exist (status setting_up until WP Waterfall creates the channel, then ready). Owners, Admins, and Billing users.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The Enterprise Support",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnterpriseSupportStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "enableEnterpriseSupport",
        "summary": "Turn on Enterprise Support",
        "description": "For a company that buys it, charges $500 for the month to the saved card now on its own monthly subscription and renews on the same day each month (402 when there is no saved card or the card does not pay, and 429 after 20 purchases from one company in an hour). It then asks WP Waterfall for the dedicated Slack channel. For an Enterprise account the support is included: this charges nothing, needs no card, and only asks for the channel, once. Sending it again changes nothing. Owners, Admins, and Billing users only. With an API key it needs confirm: true and the billing:write scope.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnableEnterpriseSupportRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The support is on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnterpriseSupportChange"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Add-ons"
        ],
        "operationId": "disableEnterpriseSupport",
        "summary": "Turn off the Enterprise Support add-on",
        "description": "Ends the add-on now. The unused days of the month are credited to the account balance and not the card, its own subscription ends, and the open set-up task for the Slack channel closes. The channel and the contact stay saved for a return. 409 when the support is not on, and 409 for an Enterprise account, whose support is included. Owners, Admins, and Billing users only. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The add-on is off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnterpriseSupportChange"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/uptime": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "getEnvironmentUptime",
        "summary": "Read the uptime of the data center an environment runs in",
        "description": "The row of the data center this environment runs in, as status.wpwaterfall.com shows it, from the same numbers: its status, the uptime percent of the measured minutes in the last 90 days, how many days were measured, and one entry for each of the 90 days. data_center is null when the status page lists none for this environment. It is the uptime of the data center, not of the site: WP Waterfall does not put a number on a site's own uptime. Reads the database only.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The uptime",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvironmentUptime"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/tools/uptime": {
      "put": {
        "tags": [
          "Tools"
        ],
        "operationId": "setUptimeTool",
        "summary": "Turn the Monitor's uptime checks on or off",
        "description": "On (the default) lets WP Waterfall ask the live site's main address once a minute and tell the owners when it stops answering, with the site.down and site.up webhook events. Off stops every ask for the environment, empties the Uptime section of the Monitor tab, and ends an open outage without a notice. It does no node work and is reversible, so no confirm. Live environments only: other environments answer 409.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutUptimeToolRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UptimeToolResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/company/incident": {
      "get": {
        "tags": [
          "Platform"
        ],
        "operationId": "getCompanyIncident",
        "summary": "Read the incident that affects the company's sites now",
        "description": "The newest public incident on the status page that affects a site of the company: an incident in a part of the control plane affects every company with a site, and an incident in a data center or on a server affects the companies with a site there. `incident` is null when none does. A held incident, a false alarm, and a hidden or resolved incident are never shown. The dashboard shows it as one line with a link to the status page. Reads the database only.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The incident, or null",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentIncident"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/pagespeed": {
      "get": {
        "tags": [
          "Monitor"
        ],
        "operationId": "getSitePagespeed",
        "summary": "Read the Lighthouse results of a site's live address",
        "description": "The newest finished Lighthouse test of the live site for mobile and for desktop, from Google PageSpeed Insights: the scores for performance, accessibility, best practices, and SEO from 0 to 100, the lab metrics (First Contentful Paint, Largest Contentful Paint, Total Blocking Time, Cumulative Layout Shift, Speed Index, and Time to Interactive) with Lighthouse's rating, the largest opportunities and diagnostics, and the Chrome UX Report field data when Google has it, for the page or for the whole origin. It also lists the runs that are queued or running, the newest failure of each device, the earliest time a manual test may start again, and a history of finished runs for the chart (days, up to 90). It tests only the live environment's own address. When the Uptime part of Monitor is off, nothing runs and the lists are empty. available is false when this deployment has no Google key, and reason says why. Reads the database only.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 30
            },
            "description": "How many days of history to return."
          },
          {
            "name": "strategy",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "mobile",
                "desktop"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The Lighthouse results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagespeedOverview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/pagespeed/runs": {
      "post": {
        "tags": [
          "Monitor"
        ],
        "operationId": "startSitePagespeedRuns",
        "summary": "Start a Lighthouse test of the live site",
        "description": "Starts a Lighthouse test of the live site's public address through Google PageSpeed Insights, for mobile, desktop, or both (the default). Each test is a run_pagespeed job that takes 10 to 40 seconds, and it ends as done or failed with a plain reason. It cannot be cancelled. Read the result with GET /sites/{id}/pagespeed or GET /sites/{id}/pagespeed/runs/{run_id}. A device tested less than 10 minutes ago is left out and listed in skipped; when every device is left out, the call answers 429 with Retry-After. The call answers 409 when the site has no live address or Monitor's Uptime part is off, 429 when the company or the platform has reached its limit, and 503 when this deployment has no Google key. Answers 202.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "tools.run",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartPagespeedRunRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The runs are queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagespeedRunsStarted"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/pagespeed/runs/{run_id}": {
      "get": {
        "tags": [
          "Monitor"
        ],
        "operationId": "getSitePagespeedRun",
        "summary": "Read one Lighthouse test",
        "description": "One run: its status (queued, running, done, or failed), the address tested, the times, the plain reason when it failed, and the stored result when it is done.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the run."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagespeedRun"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/vulnerability-protection": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "getEnvironmentVulnerabilityProtection",
        "summary": "Read where vulnerability protection stands on an environment",
        "description": "Every live WordPress site on its own domain is protected by Patchstack with nothing to install or switch on. It is registered under that domain, and a live site with no custom domain reads off until one connects. status is active (the firewall runs and Patchstack has heard from it), pending (being set up), yielded (the site runs its own Patchstack plugin, so ours stands aside), unsupported (a WordPress network, or a site with no address), off (no custom domain yet, or turned off by support), failed (the last setup did not finish; a check retries it), or needs_entitlement (the firewall is connected, but Patchstack has not enabled protection for this site yet; a check every 6 hours asks again). reason is one plain sentence when the status is not active. version is the Patchstack plugin version once the node reported it. Staging and previews are not protected and read off. Reads the database only. It never returns a key.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Where protection stands",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VulnerabilityProtection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/vulnerabilities": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "listEnvironmentVulnerabilities",
        "summary": "List the known vulnerabilities of an environment",
        "description": "The known vulnerabilities in the WordPress, plugins, and themes an environment runs, worst first. detail is false when the only source is the vulnerability protection plugin on the live site: it reports which plugins are vulnerable and how many vulnerabilities in all, so each row is one vulnerable component, counts.total is the plugin's count, the tiers of counts are 0, and title, cvss, severity, and cve are empty. fixed_in is then the update the plugin list offers, when there is one, and update_available says whether one is waiting. detail is true when the platform also matched the environment against Patchstack's vulnerability database: each row is one vulnerability with its title, CVE ids, CVSS score, severity tier (critical from 9.0, high from 7.0, medium from 4.0, low below that, unknown without a score), whether attacks are confirmed (is_exploited), and a link. source is plugin or patchstack, and null with an empty list while nothing has reported yet, which is not an error. The rows are paged with limit (up to 200) and cursor; counts always covers every row. Reads the database only. It never asks a node and changes nothing on the site.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The known vulnerabilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VulnerabilityList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/integrations/google": {
      "get": {
        "tags": [
          "Google"
        ],
        "operationId": "getGoogleIntegrations",
        "summary": "List the company's connected Google accounts",
        "description": "One connection at most for each tool (Search Console and Google Analytics). Each shows the Google account that connected, the scopes granted, and whether it works or needs the person to connect again. A token is never in the answer. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The connections",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleIntegrations"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/integrations/google/connect": {
      "post": {
        "tags": [
          "Google"
        ],
        "operationId": "connectGoogle",
        "summary": "Start connecting a Google account for a tool",
        "description": "Returns the Google address to send the browser to. Google asks the person to allow read only access, then sends them back to WP Waterfall, which keeps the grant and returns them to the site's Tools tab. The link works once, for 10 minutes, and only in the browser session that asked for it, so this route needs a signed-in session and refuses API keys. Connecting again replaces the account of that tool for the whole company. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "sites.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectGoogleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Google address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleAuthorization"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/integrations/google/{id}": {
      "delete": {
        "tags": [
          "Google"
        ],
        "operationId": "disconnectGoogle",
        "summary": "Disconnect a Google account",
        "description": "Tells Google to end the grant, deletes the stored tokens, and clears the property every site had chosen from this account. The tool stays on for those sites and asks for a new connection. Needs a role that manages every site in the company. Audited.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the Google connection."
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.update",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleDisconnected"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/search-console": {
      "get": {
        "tags": [
          "Google"
        ],
        "operationId": "getSearchConsoleTool",
        "summary": "Read a site's Google Search Console tool",
        "description": "Whether the tool is on, the company's connection, and the property this site reads. With list_properties=true it also lists the properties the connected account can read. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "list_properties",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The tool settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleToolSettings"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Google"
        ],
        "operationId": "setSearchConsoleTool",
        "summary": "Turn Google Search Console on for a site and choose its property",
        "description": "enabled true turns the tool on, and property_id picks the property to read (a URL prefix such as https://example.com/ or a domain property such as sc-domain:example.com). The property must be one the connected account can read. enabled false turns the tool off and forgets the property. A change is audited and starts no job. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutGoogleToolRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleToolSettings"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/search-console/report": {
      "get": {
        "tags": [
          "Google"
        ],
        "operationId": "getSearchConsoleReport",
        "summary": "Read how a site does in Google search",
        "description": "kind overview gives clicks, impressions, click through rate, and average position for the range, with one entry for each day. queries, pages, countries, and devices give the top 25 rows by clicks. The range is the last 28 days unless from and to are given, and it is at most 400 days. Search Console reports a few days late, so the newest days can be empty. Answers are kept 15 minutes. Answers 409 with code google_reconnect_needed when the Google access ended, and 503 with code google_unavailable when Google is busy. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "First day, inclusive. Default: 28 days before `to`."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Last day, inclusive. Default: today."
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "overview",
                "queries",
                "pages",
                "countries",
                "devices"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchConsoleReport"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/google-analytics": {
      "get": {
        "tags": [
          "Google"
        ],
        "operationId": "getGoogleAnalyticsTool",
        "summary": "Read a site's Google Analytics tool",
        "description": "Whether the tool is on, the company's connection, and the Google Analytics 4 property this site reads. With list_properties=true it also lists the properties the connected account can read. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "list_properties",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The tool settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleToolSettings"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Google"
        ],
        "operationId": "setGoogleAnalyticsTool",
        "summary": "Turn Google Analytics on for a site and choose its property",
        "description": "enabled true turns the tool on, and property_id picks the Google Analytics 4 property to read, such as properties/123456789. The property must be one the connected account can read. enabled false turns the tool off and forgets the property. A change is audited and starts no job. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutGoogleToolRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleToolSettings"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/google-analytics/report": {
      "get": {
        "tags": [
          "Google"
        ],
        "operationId": "getGoogleAnalyticsReport",
        "summary": "Read a site's Google Analytics traffic",
        "description": "kind overview gives users, sessions, page views, and engagement rate for the range, with one entry for each day. pages gives the top 25 pages by views, and sources the top 25 sources by sessions. The range is the last 28 days unless from and to are given, and it is at most 400 days. Answers are kept 15 minutes. Answers 409 with code google_reconnect_needed when the Google access ended, and 503 with code google_unavailable when Google is busy. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "First day, inclusive. Default: 28 days before `to`."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Last day, inclusive. Default: today."
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "overview",
                "pages",
                "sources"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleAnalyticsReport"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/local-dev": {
      "get": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "getLocalDevConfig",
        "summary": "Settings for running the environment on a developer's computer",
        "description": "Read only, and it holds no password, no private key, and no API key. It names the PHP version, the database engine, version, and table prefix, the multisite mode, the site addresses, the SSH host, port, user, and host key fingerprint (null until the node reports it), the Git remote address, the branch, and the release commit, the paths, the sizes of the database and the uploads, the exclude list a pull must use, and which of code, database, and uploads each operation allows. Code always travels by Git. Live is read only: pull from live uses a backup download for the database and uploads and never SSH, its code is the release commit on the repository, and push is allowed on staging and previews only. `ssh` is null when SSH is off or an external repository is connected.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Local development settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocalDevConfig"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/local-dev/pull-session": {
      "post": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "startLocalDevPull",
        "summary": "Record a pull to a developer's computer and plan it",
        "description": "Writes the `local_dev.pull` activity entry (who, which key, which environment, which parts) and returns the plan. It moves no data and returns no secret. `parts` picks code, database, and uploads in any combination. Code comes from the Git remote. Method `ssh` moves database and uploads on staging and previews and answers 409 live_is_immutable on live. Method `backup` works on every environment: the answer names the newest ready backup and the existing calls that download it (`POST /environments/{id}/backups` when a fresh one is wanted, then `POST /backups/{id}/download` and `POST /backups/{id}/download-link`, which keep their own scope, `backups:write`, and the database permission). Limited to 20 sessions per hour for each person or key and environment.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocalDevPullSessionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The pull plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocalDevPullSession"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/local-dev/push-session": {
      "post": {
        "tags": [
          "SSH and SFTP"
        ],
        "operationId": "startLocalDevPush",
        "summary": "Record a push from a developer's computer and plan it",
        "description": "Writes the `local_dev.push` activity entry and returns the plan. It moves no data. Push is for staging and previews only: live answers 409 live_is_immutable, and an environment with SSH off or an external repository answers 409 push_not_allowed. A `code` part needs the deploy permission and means a `git push` of the environment's branch to the WP Waterfall remote, which builds a new release. A `database` or `uploads` part replaces data on the environment, so the plan has a required backup step first (`POST /environments/{id}/backups`). Limited to 20 sessions per hour for each person or key and environment.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocalDevPushSessionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The push plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocalDevPushSession"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/options": {
      "get": {
        "tags": [
          "Migrations"
        ],
        "operationId": "getMigrationOptions",
        "summary": "What a migration costs and allows",
        "description": "The one-time priority fee in cents, the largest archive, the kinds of link WP Waterfall reads, and how many unfinished migrations the company has against its limit.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationOptions"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations": {
      "post": {
        "tags": [
          "Migrations"
        ],
        "operationId": "createMigration",
        "summary": "Migrate an existing site to a new WP Waterfall site",
        "description": "Creates the new site (it uses a site license the way POST /sites does, or runs free on the demo node when test is true) and a migration request for it. Migrations are free and wait in one queue. Send a link to a backup (a Google Drive share link set to Anyone with the link, or a direct https link to a .zip, .tar.gz, or .tgz archive), or send source type manual and a person at WP Waterfall moves the site. Never send a password in a link or a note: support asks for access in Nami chat. With priority true the saved card is charged the one-time fee first (402 `payment_required` or `card_declined`, and nothing is created). While Expedited Migration is off (`expedited` false in GET /migrations/options), priority true answers 409 `expedited_migration_off` and nothing is created. The request is checked in the background: poll GET /migrations/{id}. Refusals: 402 for plan problems (the same codes as POST /sites), 409 `too_many_migrations` at the company limit, 422 for a link WP Waterfall cannot use. `php_version` may be `8.1` or `8.2` here and nowhere else, for a site that runs that version on its old host: both are closed to every other new site. A version past its removal day answers 422 `php_version_removed`, and `8.2` answers 422 when no server in the region has it.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.create",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMigrationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationCreated"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "get": {
        "tags": [
          "Migrations"
        ],
        "operationId": "listMigrations",
        "summary": "List the company's migrations",
        "description": "Newest first. Filter by status, by open (unfinished) requests, or by site.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "requested",
                "checking",
                "queued",
                "in_progress",
                "ready_for_review",
                "declined",
                "complete",
                "needs_input",
                "malware_found",
                "cancelled",
                "failed"
              ]
            }
          },
          {
            "name": "open",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "description": "`true` returns unfinished requests only."
          },
          {
            "name": "site_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Migrations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/{id}": {
      "get": {
        "tags": [
          "Migrations"
        ],
        "operationId": "getMigration",
        "summary": "Read one migration",
        "description": "The status, the place in the queue, what the checks found, any message from WP Waterfall support, and the notes. The link you gave is never returned, only its host.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "Migrations"
        ],
        "operationId": "updateMigration",
        "summary": "Change whether the import starts by itself",
        "description": "Only before the import starts. With auto_import false a person at WP Waterfall approves the import.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.create",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchMigrationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/{id}/source": {
      "put": {
        "tags": [
          "Migrations"
        ],
        "operationId": "setMigrationSource",
        "summary": "Replace the backup link",
        "description": "Use it when WP Waterfall could not download the file (status needs_input), or you made a new backup. The checks run again from the start. Only before the import starts.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.create",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutMigrationSourceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/{id}/notes": {
      "post": {
        "tags": [
          "Migrations"
        ],
        "operationId": "addMigrationNote",
        "summary": "Send a note to WP Waterfall support",
        "description": "Answers a question from support or adds a detail. A request that needed your input goes back to the queue. Never put a password in a note.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.create",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MigrationNoteRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/{id}/priority": {
      "post": {
        "tags": [
          "Migrations"
        ],
        "operationId": "buyMigrationPriority",
        "summary": "Jump the queue",
        "description": "Closed for customers. The queue is jumped when the migration is requested (POST /migrations with priority true). A migration always creates its site at that moment, so this route answers 409 `migration_site_created` with a plain sentence and charges nothing. While Expedited Migration is off it answers 409 `expedited_migration_off` first. Migrations run in the order they arrive.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuyMigrationPriorityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/{id}/clean": {
      "post": {
        "tags": [
          "Migrations"
        ],
        "operationId": "cleanMigration",
        "summary": "Pay WP Waterfall to clean a backup with malware",
        "description": "For a migration in the status `malware_found`. Needs confirm true, because it charges the saved card the one-time clean fee (`malware.clean.fee_cents` on the migration). WP Waterfall then leaves out every flagged plugin, theme, and file, builds WordPress core fresh from wordpress.org (the import never copies core), and continues the import. The other two choices are PUT /migrations/{id}/source with a new backup link, which runs the check again, and POST /migrations/{id}/decline. Answers 409 `migration_not_flagged` in any other status, and 402 when the payment fails (nothing is charged).",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CleanMigrationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/{id}/dispute": {
      "post": {
        "tags": [
          "Migrations"
        ],
        "operationId": "disputeMigrationMalware",
        "summary": "Say the malware check is wrong",
        "description": "For a migration in the status `malware_found`. The check is rule based and can be wrong, for example for a PHP file a plugin keeps in uploads. Emails the staff the migration id and the flagged paths (the optional note is added), and records the dispute on the migration (`malware.dispute`). Nothing is charged and nothing is copied. The migration waits for support, who either mark the files safe (the check runs again and the import goes on) or confirm the finding (the clean and decline choices come back). Sending it again answers 200 with the same dispute and sends no second email. Answers 409 `migration_not_flagged` in any other status.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.create",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisputeMigrationMalwareRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/{id}/accept": {
      "post": {
        "tags": [
          "Migrations"
        ],
        "operationId": "acceptMigration",
        "summary": "Accept the migrated site",
        "description": "Marks a migration that is ready for review as complete. The site stays on staging until you launch live.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.create",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/{id}/decline": {
      "post": {
        "tags": [
          "Migrations"
        ],
        "operationId": "declineMigration",
        "summary": "Say the migrated site is not right",
        "description": "For a migration in the status `malware_found`, declining the clean ends the migration (it becomes `cancelled`), removes the stored backup, refunds a paid priority fee, and deletes the site that was set up for it (the same delete job, audit event, and slot release as DELETE /sites/{id}). The note is optional and is kept in the thread when sent. Answers 409 `migration_site_in_use` when the site already holds a launched site, and changes nothing. For a migration that is ready for review it moves the migration to declined instead: send a note, 1 to 2000 characters, that says what is not right (422 without one). That costs nothing and needs no new upload. WP Waterfall support is told with your note, fixes the site, and tells you when it is ready to look at again. The site stays locked meanwhile. Sending it again for a declined migration changes nothing and answers 200. Answers 409 `migration_not_ready` in any other status.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.create",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclineMigrationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/migrations/{id}/cancel": {
      "post": {
        "tags": [
          "Migrations"
        ],
        "operationId": "cancelMigration",
        "summary": "Cancel a migration",
        "description": "Needs confirm=true. Possible until the work starts. A priority fee is refunded to the card. Cancelling also deletes the site that was set up for the migration (the same delete job, audit event, and slot release as DELETE /sites/{id}), unless the site is live or a completed migration filled it. Answers 409 `job_already_running` while a job runs on the site, and changes nothing.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the migration."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "sites.create",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "200": {
            "description": "The migration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Migration"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/licenses": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "listLicenses",
        "summary": "The plans and site tiers on sale",
        "description": "Every plan the account may buy (a number of site licenses, 1 to 20 on sale) and every site tier, with their prices by lookup key on each term (ADR 216). Any self-serve account buys any size. A plan costs the same in every data center, and each site picks its data center when it is created (ADR 215). A tier's price is what it adds for one site. Enterprise gets contact_sales instead. The amounts match the public pricing page.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Plans and tiers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicenseCatalog"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/summary": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "getBillingSummary",
        "summary": "The company's main plan, entitlements, add-ons, and usage",
        "description": "Returns the company's plan and its state, the add-ons, the usage, the renewal date, and the estimate of the next invoice in cents. Owners, Admins, and Billing users may read it.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Billing summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSummary"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/subscriptions/{id}/license": {
      "put": {
        "tags": [
          "Billing"
        ],
        "operationId": "changeLicense",
        "summary": "Add or remove site licenses, or change the term, on one subscription",
        "description": "Moves the subscription to another plan size (credits, the number of site licenses) or term. More site licenses prorate for the rest of the period and are charged now (ADR 315): a declined card answers 402 card_declined and changes nothing, and a company that is past due answers 409 until the open invoice is paid. Fewer site licenses on a monthly term credit the unused time on the next invoice. A new term starts now. Fewer site licenses than the subscription's real sites answers 409 with a PlanChangeBlocked body listing what to remove first. A prepaid plan moves up mid-term but moves down only when it renews: 409 with the code change_at_renewal. An annual or three year term needs acknowledge_non_refundable: true. Without a billing name and address on file it answers 409 billing_details_required. Site tiers stay as they are. Needs confirm: true. An Enterprise company has unlimited sites and buys one Single tier for each site, so it may buy only the 1 site license: any other size is refused with 422.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the subscription."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeLicenseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The subscription after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/cancel": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "cancelSubscription",
        "summary": "Cancel the plan",
        "description": "Ends at period end by default. Within 30 days of the first payment a monthly plan's charges are refunded in full, each part to where it came from: the card part to the card, and the part that account credit paid to the company's account credit (refund_to_card_cents and refund_to_credit_cents). An annual or three year plan always runs to the end of its paid term: renewal stops and no refund or credit is given.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancellation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cancellation"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/invoices": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "listInvoices",
        "summary": "List invoices",
        "description": "Lists the company's invoices in pages of up to 100 (default 20). Owners, Admins, and Billing users may read it.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Invoices",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/invoices/{id}": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "getInvoice",
        "summary": "One invoice, as the invoice page shows it",
        "description": "The invoice is named by our invoice id or by its number, such as 2VRBR54J-0002 (the address in an email reads get.wpwaterfall.com/<number>); both are looked up inside the caller's company only. The answer is the amount, the due date, the lines, who it is for, and the state (open, paid, or void). While the invoice is open and the caller is a member who can pay, it also carries the client secret the Stripe Payment Element pays it with. Staff acting as the customer read the invoice and get no client secret. Needs the billing permission. The invoice must belong to the caller's company: another company's invoice is a 404. Never cached.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the invoice."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The invoice",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoicePage"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/invoices/{id}/pdf": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "getInvoicePdf",
        "summary": "Open an invoice PDF",
        "description": "The invoice's PDF, sent inline so a browser tab shows it. 404 for a draft or an invoice Stripe has no PDF for yet.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the invoice."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/pricing-breakdown": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "getPricingBreakdown",
        "summary": "The recurring charges, line by line",
        "description": "One line for each plan, site tier, add-on, and dedicated server the company pays for, with its quantity, term (monthly, annual, triennial, or hourly), price, and renewal date, and the total of each term. A line on a subscription comes from the lines of Stripe's upcoming invoice, so it is what Stripe charges; an add-on or server on its own subscription is priced from what it was bought at. Overage is not here: GET /billing/usage has it.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Recurring charges",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingBreakdown"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/usage": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "getBillingUsage",
        "summary": "Usage this period against the plan",
        "description": "The same numbers Analytics and the invoice show, from the same records.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingUsage"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/details": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "getBillingDetails",
        "summary": "Billing name, email, address, and tax id",
        "description": "The name, the optional company name, the email invoices go to, the address, and the optional tax id. A purchase needs the name, the email, and an address with line1, city, state, postal_code, and country. The email is null only for a company that has not saved one yet.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Billing details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingDetails"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Billing"
        ],
        "operationId": "setBillingDetails",
        "summary": "Update billing name, email, address, and tax id",
        "description": "Saves the details on the company and on its Stripe customer, where the email is the address Stripe sends invoices to. company_name is printed on invoices with the name. Send only what changes. The email is required: when it is sent it must be a valid address, and null or an empty string answers 422 `Enter an email address for invoices.` with a field error on `email`. Checkout saves these before the card is charged.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutBillingDetailsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Billing details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingDetails"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/subscriptions": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "listSubscriptions",
        "summary": "List the subscriptions on the company with their site licenses",
        "description": "Each subscription gives site licenses, and each real site uses one. accepts_sites is true when a subscription has a free site license and a status that takes new sites. tiers counts the sites above the included tier. An Enterprise subscription staff applied before ADR 273 has no site limit (credits is null).",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Subscriptions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "createSubscription",
        "summary": "Buy a plan with a saved card",
        "description": "Buys a plan, a new subscription with a number of site licenses (lookup_key such as license_5_monthly), charged to the default card, or to payment_method_id. A plan has one price in every data center, and it never goes up while it is active. Each site picks its data center when it is created (ADR 215); a site whose live environment runs in a data center Google prices above us-east4 adds its regional surcharge as its own line on this subscription (ADR 312, GET /regions shows site_surcharge_cents) and starts at the included tier; PUT /sites/{id}/tier upgrades one site. The subscription appears in GET /billing/subscriptions when Stripe's webhook arrives. When the bank asks for 3D Secure, requires_action is true and the browser confirms the payment with client_secret. An annual or three year plan (lookup keys ending _annual or _3y) is billed once and is not refundable, so it needs acknowledge_non_refundable: true; without it the answer is 400 with the code acknowledge_non_refundable. A first plan that would get the free first month can answer 409 with the code free_month_verification_required and a verification_url: open it, finish the check, then send the same request again. A buyer the check cannot confirm gets the plan billed from the first day instead. Without a billing name and address on file it answers 409 with the code billing_details_required: save them with PUT /billing/details, then send the same request again. Needs confirm: true. An Enterprise company has unlimited sites and buys one Single tier for each site, so it may buy only the 1 site license: any other size is refused with 422.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Subscription started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionStart"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/subscriptions/{id}/cancel": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "cancelSubscriptionById",
        "summary": "Cancel one subscription",
        "description": "Refused with 409 while sites use the plan: move or delete them first. Ends at period end by default. Within 30 days of the first payment a monthly plan's charges are refunded in full, and each part goes back where it came from: refund_to_card_cents to the card through Stripe, and refund_to_credit_cents to the company's account credit when account credit paid that part. Outside the window nothing is refunded. An annual or three year plan always runs to the end of its paid term: renewal stops and no refund or credit is given (non_refundable is true and message says the end date). message is one plain sentence about what was refunded and where. Payments are final: when the cancel ends the company's last plan, only unused account credit that came from month to month payments goes back to the card (credit_to_card_cents), and other account credit is never paid out (credit_kept_cents). Run GET /billing/subscriptions/{id}/cancel-preview first to read it before you confirm. Needs confirm: true.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the subscription."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancellation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cancellation"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/subscriptions/{id}/cancel-preview": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "previewCancelSubscription",
        "summary": "What cancelling one plan would refund, before it happens",
        "description": "Answers the same 404 and 409 as the cancel, then says whether the plan would end now, how much would be refunded, how much of that goes to the card (refund_to_card_cents) and how much to the company's account credit (refund_to_credit_cents), and the one plain sentence to show. Outside the 30 day money back window the answer says that nothing is refunded. When the cancel would end the company's last plan and it holds account credit, credit_to_card_cents is the unused credit from month to month payments that goes back to the card, credit_kept_cents is the credit that is never paid out, and the message says both. Pass immediately=true to ask about ending a plan now. Changes nothing.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the subscription."
          },
          {
            "name": "immediately",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "default": "false"
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Cancel preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelPreview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/license-preview": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "previewLicense",
        "summary": "Price, tax, and total for a plan before it starts",
        "description": "The Summary step of checkout. The tax line is what Stripe Tax returns, or 0 while STRIPE_AUTOMATIC_TAX is off. billing_details_complete says whether the name, the email for invoices, and the address the purchase needs are on file. An Enterprise company has unlimited sites and buys one Single tier for each site, so it may buy only the 1 site license: any other size is refused with 422.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "lookup_key",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 80,
              "pattern": "^[a-z0-9_]+$"
            },
            "required": true
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "description": "The data center the first site will run in, from `GET /regions`. The answer then names that region's regional surcharge for each site, if it has one."
          },
          {
            "name": "promo_code",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Shows the order with this promo code applied. An invalid code is left out of the answer."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Plan preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicensePreview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/subscriptions/{id}/license-preview": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "previewLicenseChange",
        "summary": "What adding or removing site licenses, or changing the term, would do",
        "description": "For one subscription and the site licenses and term you name: whether the change is allowed, the plain reasons when it is not (more real sites than site licenses, environments or disk over the smaller pool, a prepaid term that moves at renewal, a size that is not sold), the new plan price, and an estimate of the prorated amount for the rest of the period, with billed: now for a larger plan or a new term and next_invoice for a smaller monthly plan. A larger plan is refused while a payment is past due. Changes nothing. An Enterprise company has unlimited sites and buys one Single tier for each site, so it may buy only the 1 site license: any other size is refused with 422.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the subscription."
          },
          {
            "name": "credits",
            "in": "query",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "required": true
          },
          {
            "name": "interval",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "monthly",
                "annual",
                "triennial"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Plan change preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicenseChangePreview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/tier-preview": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "previewSiteTier",
        "summary": "What moving one site to another tier would do",
        "description": "The site's tier now and the one you name, whether the move is allowed and why not, the price change on its subscription, and an estimate of what is charged now (an upgrade) or credited on the next invoice (a downgrade on a monthly plan). A downgrade of a prepaid plan waits for the renewal: change_at_renewal. The tier is the site's and applies to live only: staging and preview environments always run the included profile. Changes nothing.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "tier",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "base",
                "tier_40",
                "tier_65",
                "tier_125",
                "tier_250"
              ]
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Site tier preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteTierPreview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/tier": {
      "put": {
        "tags": [
          "Billing"
        ],
        "operationId": "setSiteTier",
        "summary": "Move one site to another tier",
        "description": "Changes one site's tier (ADR 216). An upgrade is charged now for the rest of the period on the site's subscription; a declined card answers 402 card_declined and changes nothing. A downgrade on a monthly plan credits the unused time on the next invoice; on a prepaid plan it answers 409 change_at_renewal. When the site has a live environment, a set_php_performance job applies the new PHP threads, pinned vCPUs, and memory limits, and job_id names it. The tier applies to live only: staging and preview environments always run the included profile, with no extra charge. Without a billing name and address on file it answers 409 billing_details_required. Needs confirm: true.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetSiteTierRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The site's new tier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteTierChange"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/payment-methods": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "listPaymentMethods",
        "summary": "List saved cards",
        "description": "Brand, last four digits, expiry, and which card is the default. Stripe keeps the card.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Cards",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethodList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "addPaymentMethod",
        "summary": "Register a confirmed card",
        "description": "Saves the card on the company's Stripe customer. The first card becomes the default; set_default makes any card the default. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPaymentMethodRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Card saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethod"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/setup-intents": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "createSetupIntent",
        "summary": "Start adding a card",
        "description": "Returns a Stripe setup intent. The browser confirms it with Stripe Elements, then registers the card with POST /billing/payment-methods. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSetupIntentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Setup intent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupIntent"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/payment-methods/{id}/default": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "setDefaultPaymentMethod",
        "summary": "Make a card the default",
        "description": "Every plan and invoice is charged to the default card.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the payment method, as Stripe names it."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The new default card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethod"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/payment-methods/{id}": {
      "delete": {
        "tags": [
          "Billing"
        ],
        "operationId": "removePaymentMethod",
        "summary": "Remove a card",
        "description": "Refused with 409 for the only card while a plan is active: add another card first. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the payment method, as Stripe names it."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "204": {
            "description": "Removed",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/add-on-catalog": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "listAddonCatalog",
        "summary": "The add-on catalog",
        "description": "Every add-on WP Waterfall sells with its monthly price per unit, the most units a company can hold, and what it adds. Items with route addon are bought through POST /companies/me/add-ons.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Add-ons",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonCatalogList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/add-ons": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "listCompanyAddons",
        "summary": "The company's add-ons",
        "description": "Every add-on on the company, removed ones included, and what the active ones add to the company's limits. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Add-ons",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyAddonList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "addCompanyAddon",
        "summary": "Buy an add-on",
        "description": "Adds an add-on such as additional_disk or redis_512mb. The unused days of the period are added to your next invoice, and the monthly price applies from the next period. Owners, Admins, and Billing users only. Session only. When the add-on needs node work the answer points at the job.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddCompanyAddonRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Add-on added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyAddonAdded"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/add-ons/summary": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "getCompanyAddonSummary",
        "summary": "The add-ons the company holds, grouped, with where each is used",
        "description": "One row for each kind of add-on the company holds (Additional Disk Space, Redis, Safe Updates, and the rest), for each site tier in use, and for the additional preview slots, with the units held, the term, the price, and the sites and environments that use it (at most 100 per row, uses_total says how many there are). A removed add-on is not listed. Owners, Admins, and Billing users.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Add-on summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyAddonSummary"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/add-ons/{id}": {
      "delete": {
        "tags": [
          "Billing"
        ],
        "operationId": "removeCompanyAddon",
        "summary": "Remove an add-on",
        "description": "Switches the add-on off and credits the unused part of the period. Only Additional Disk Space, Redis, and hourly backups are removed here; any other add-on answers 422 and is turned off with POST /sites/{id}/add-ons/{key}/cancel, which also undoes it on the server. Owners, Admins, and Billing users only. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the add-on on the company."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Add-on removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyAddonRemoved"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/dedicated-server": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "getDedicatedServer",
        "summary": "The company's dedicated server",
        "description": "The server the company pays for, for the Billing page: name, location, size, the monthly equivalent and the one charge of the term, the end of the paid term (the next invoice date), the newest invoice with its status in plain words (draft, open, paid, past_due, void) and its hosted invoice link, the sites on it, the change in progress, and what the caller may do now. server is null when the company has none. open_request is a request staff have not answered yet.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The server and any open request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DedicatedServerResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/dedicated-server/quote": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "quoteDedicatedServer",
        "summary": "The price of each dedicated server size in a region",
        "description": "The four sizes with their annual and three year prices in one location. The price follows Google's price for the location: the base price holds where Google's price is the base, and another location can cost more or less. A location that takes no servers, or whose price has not been read, answers 409 with region_not_open or region_price_unavailable. Without region, the server's location, else the default.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "description": "A region code such as `us-east4`. Defaults to the server's region, else the default region."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Sizes and prices",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DedicatedServerQuote"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/dedicated-server/resize-request": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "requestDedicatedServerSize",
        "summary": "Ask staff for a different dedicated server size",
        "description": "Staff decide the size (ADR 131), so this opens a request with the size in its note and emails the staff. Nothing changes and nothing is charged until staff run the change and, for a larger size, you pay the price difference for the rest of the term. One open request at a time (409). Owners, Admins, and Billing users.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DedicatedResizeRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The request is open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DedicatedServerResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/dedicated-server/request": {
      "delete": {
        "tags": [
          "Billing"
        ],
        "operationId": "cancelDedicatedServerRequest",
        "summary": "Cancel the open dedicated server request",
        "description": "Withdraws the request for a dedicated server or a size change that staff have not answered. The request closes, and nothing is charged or changed. 409 when no request is open. Owners, Admins, and Billing users.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The request is cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DedicatedServerResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/dedicated-server/move-back": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "moveDedicatedServerSitesBack",
        "summary": "Move sites from the dedicated server back to shared hosting",
        "description": "Moves one site (site_id), or every site, to a shared server in the same location. Each site is a job (a restore point, a copy, a switch, a check) that you follow in the job drawer; sites move one at a time. The server and its price stay. Refused with a plain reason, and nothing started, when a site cannot move or no shared server has room. Needs confirm: true. Owners, Admins, and Billing users.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DedicatedMoveBackRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The move started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DedicatedServerResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/dedicated-server/cancel": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "cancelDedicatedServer",
        "summary": "Cancel the dedicated server",
        "description": "An unpaid invoice is voided. A paid server first moves every site to shared hosting (send move_sites_to_shared: true; without it a server with sites on it answers 409 with a plain reason), then the renewal ends at the end of the paid term, a restore point is taken on each site's new home, and the server is drained and deleted. The paid term is not refunded. Needs confirm: true. Safe to repeat. Owners, Admins, and Billing users.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DedicatedCancelRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The cancel started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DedicatedServerResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhooks",
        "summary": "List webhook endpoints",
        "description": "The signed-in person's own endpoints, whatever workspace is selected.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "webhooks:read",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "createWebhook",
        "summary": "Create a webhook endpoint",
        "description": "Registers a receiver URL with an event filter for the signed-in person, whatever workspace is selected. company_ids names the companies it reaches (left out: every company the person belongs to). The endpoint receives a company's events only while the person is a member with a role that holds webhooks.manage there. The answer carries the signing secret once. Private, loopback, and link-local targets are refused.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "webhooks:write",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Endpoint with its secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedWebhookEndpoint"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/webhooks/events": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhookEvents",
        "summary": "The event catalog",
        "description": "Every event type WP Waterfall can send, with its group, description, and payload version.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "webhooks:read",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Event catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventCatalog"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/webhooks/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "getWebhook",
        "summary": "Get a webhook endpoint",
        "description": "Returns one webhook endpoint: its URL, format, events, status, the times of its last delivery and last success, and `company_ids`, the companies it reaches (null for every company the person belongs to). An endpoint belongs to a person, and an API key acts as the person who made it. Another person's endpoint answers 404.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the webhook endpoint."
          }
        ],
        "x-wpwaterfall-scope": "webhooks:read",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "updateWebhook",
        "summary": "Change a webhook endpoint",
        "description": "Change the URL, the companies it reaches, the description, or the event filter, or enable and disable it.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the webhook endpoint."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "webhooks:write",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchWebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "deleteWebhook",
        "summary": "Delete a webhook endpoint",
        "description": "Removes the endpoint and its delivery log. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the webhook endpoint."
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "webhooks:write",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "rotateWebhookSecret",
        "summary": "Rotate the signing secret",
        "description": "Issues a new secret, shown once. Deliveries carry signatures for both secrets for 24 hours. Needs confirm=true.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the webhook endpoint."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "webhooks:write",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "200": {
            "description": "Endpoint with the new secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedWebhookEndpoint"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "sendTestWebhook",
        "summary": "Send a test event",
        "description": "Queues one delivery of a sample event to this endpoint only.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the webhook endpoint."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "webhooks:write",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendTestWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The queued delivery",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhookDeliveries",
        "summary": "The delivery log of an endpoint",
        "description": "Newest first, with the status, attempt count, and last response code. Kept 30 days.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the webhook endpoint."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivering",
                "succeeded",
                "failed",
                "dead"
              ]
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "job.succeeded",
                "job.failed",
                "job.cancelled",
                "site.created",
                "site.updated",
                "site.deleted",
                "site.status_changed",
                "environment.created",
                "environment.provisioned",
                "environment.deleted",
                "environment.cloned",
                "environment.pushed",
                "environment.promoted",
                "git.push_received",
                "build.succeeded",
                "build.failed",
                "deployment.succeeded",
                "deployment.failed",
                "backup.completed",
                "backup.failed",
                "backup.restored",
                "domain.added",
                "domain.attached",
                "domain.error",
                "domain.removed",
                "domain.primary_changed",
                "ssl.issued",
                "ssl.failed",
                "ssl.expiring",
                "dns.zone.created",
                "dns.zone.active",
                "dns.zone.deleted",
                "dns.records.changed",
                "php.version_changed",
                "plugin.updated",
                "theme.updated",
                "security.bot_protection_changed",
                "security.ip_rules_changed",
                "security.sftp_user_changed",
                "security.ssh_changed",
                "security.two_factor_changed",
                "subscription.created",
                "subscription.updated",
                "subscription.cancelled",
                "invoice.paid",
                "invoice.payment_failed",
                "billing.state_changed",
                "usage.threshold",
                "addon.enabled",
                "addon.disabled",
                "auto_update.completed",
                "auto_update.failed",
                "auto_update.run.started",
                "auto_update.run.completed",
                "auto_update.run.failed",
                "auto_update.run.needs_confirmation",
                "auto_update.run.approved",
                "auto_update.run.rejected",
                "auto_update.run.expired",
                "migration.status_changed",
                "integrity.issue_found",
                "integrity.clean",
                "site.down",
                "site.up",
                "node.created",
                "node.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "webhooks:read",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/webhook-deliveries/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "getWebhookDelivery",
        "summary": "Get a delivery with its attempts",
        "description": "Returns one delivery with the event body it carried and every attempt in `attempts_log`, oldest first. Answers 404 when the delivery is not on one of the caller's endpoints.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the webhook delivery."
          }
        ],
        "x-wpwaterfall-scope": "webhooks:read",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Delivery, event body, and every attempt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryDetail"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/webhook-deliveries/{id}/redeliver": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "redeliverWebhook",
        "summary": "Redeliver an event",
        "description": "Queues a new attempt of the same event to the same endpoint.",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the webhook delivery."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "webhooks:write",
        "x-wpwaterfall-permission": "webhooks.manage",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "The delivery, queued again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/promo-codes/validate": {
      "post": {
        "tags": [
          "Promo codes"
        ],
        "operationId": "validatePromoCode",
        "summary": "Check a promo code for a plan or an add-on",
        "description": "Answers valid with the order the code produces (the discount, the first charge, the price after the discount, and whether it replaces a free first month), or valid false with one generic sentence for every reason: unknown, expired, used up, already used, off, or not for this plan. Changes nothing. A wrong guess counts against the company and the caller's address; past the limit this answers 429 promo_rate_limited with Retry-After.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidatePromoCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromoValidation"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/promo-redemptions": {
      "get": {
        "tags": [
          "Promo codes"
        ],
        "operationId": "listPromoRedemptions",
        "summary": "The company's promo code uses",
        "description": "Codes this company used, with the discount and when a repeating discount ends.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Redemptions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromoRedemptionList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/referrals/link": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "operationId": "getReferralLink",
        "summary": "The company's referral link",
        "description": "Every company has one referral link, made the first time this is read (or by the migration for older companies). Share the url: a friend who opens it, signs up, and pays gets account credit, and so does this company once the hold ends. Also returns the program numbers: the reward share and its limits, the new customer's credit, the hold in days, the yearly cap, and the cookie window.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The link and the program numbers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralLink"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/referrals/stats": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "operationId": "getReferralStats",
        "summary": "Referral sign-ups, paying customers, and credit",
        "description": "Sign-ups are new accounts the link brought in. Paying customers are referrals that made a first payment. Credit earned is already in the account balance; credit pending waits for the hold to end.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The numbers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralStats"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/referrals": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "operationId": "listReferrals",
        "summary": "The company's referrals",
        "description": "One row per friend who signed up, newest first, with a status: signed_up, converted, rewarded, expired, or rejected. The friend's address is masked, as a***@gmail.com. A rejected referral names the reason.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "signed_up",
                "converted",
                "rewarded",
                "expired",
                "rejected"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: at most 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Referrals",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/referrals/claim": {
      "post": {
        "tags": [
          "Referrals"
        ],
        "operationId": "claimReferral",
        "summary": "Claim a referral code saved in the browser",
        "description": "For a new account whose referral cookie did not arrive. The dashboard sends the code it saved when the visitor first followed a link. It counts only for a company the caller owns, made in the last 7 days and after the visit, with no referral yet. The same fraud rules apply. Answers claimed false, with 200, for anything else, so it never says why.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralClaimRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether the referral was recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralClaimResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/partner/commissions": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "operationId": "getPartnerCommissions",
        "summary": "The partner's commission by month",
        "description": "For a company in the Agency Partner Program: 10% of the profit WP Waterfall makes on each paid invoice of a customer who signed up through the company's link. One row per month and state (pending for the 30 day refund window, earned, paid, or void), with a count of the customers who paid, and the totals. It names no customer and no invoice. A company that is not a partner reads partner false and empty totals.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The commission by month",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerCommissions"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/affiliate/application": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "operationId": "getAffiliateApplication",
        "summary": "The company's Affiliate Program application",
        "description": "The state of the company's application (none, applied, approved, declined, or ended), what it sent, the terms version it accepted, the reason of a decline, and the program numbers: 10% of the profit, the 30 day hold, and the $50 minimum for a bank transfer. agency_partner is true for a company in the Agency Partner Program, which earns the same commission and does not apply.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The application",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AffiliateApplication"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Referrals"
        ],
        "operationId": "applyAffiliate",
        "summary": "Apply to the Affiliate Program",
        "description": "Signed-in session only. Sends the website or channel, how you will promote WP Waterfall, and your acceptance of the Affiliate Program Terms (terms_version must be the current one). Staff review it and you hear back by email. A company may apply when it never did, or after a decline or an end; a second application while one waits is refused with 409.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AffiliateApplyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The application",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AffiliateApplication"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/companies/me/connections": {
      "get": {
        "tags": [
          "Connections"
        ],
        "operationId": "listCompanyConnections",
        "summary": "List MCP connections for the current company",
        "description": "Owners and admins see every connection. Other members see the connections they approved. Each has access full, or limited for a connection approved before ADR 121 that the person can reconnect. Revoked connections are not listed; the audit log keeps the history. Expired connections stay listed until revoked. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: at most 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Connections",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpConnectionList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/connections/{id}": {
      "get": {
        "tags": [
          "Connections"
        ],
        "operationId": "getConnection",
        "summary": "Show one MCP connection",
        "description": "The approver or a member with api_keys.read. Other members get 404. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the MCP connection."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpConnection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Connections"
        ],
        "operationId": "revokeConnection",
        "summary": "Revoke an MCP connection",
        "description": "The approver, or a member with api_keys.write. Revoking also revokes the API key the connection minted. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the MCP connection."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "204": {
            "description": "Revoked",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/connections/{id}/announce": {
      "post": {
        "tags": [
          "Connections"
        ],
        "operationId": "announceConnection",
        "summary": "Tell the person about a connection they just approved",
        "description": "Writes a security notice in the bell and sends the security email for a connection the signed-in person just approved or reconnected. The hosted MCP server calls it with the person's session after Approve. The words come from the stored connection, never from the caller, and only the person who approved the connection can ask. A repeat within the hour sends nothing more. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the MCP connection."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnnounceConnection"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The notice was written",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/oauth/consent/{id}": {
      "get": {
        "tags": [
          "Connections"
        ],
        "operationId": "getConsentRequest",
        "summary": "Read a pending MCP consent request",
        "description": "Served by the hosted MCP server at mcp.wpwaterfall.com, not the API. Returns the client, the person, the companies they may connect it to with their roles, and whether two-factor authentication is on. There is no list of scopes: approving grants full access within the person's role (ADR 121). The id is a pending request from a client, or the id of an existing limited connection of the person to reconnect in place. The dashboard page at /dashboard/connect reads it. Signed-in user only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the pending consent request."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Consent request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentRequest"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Connections"
        ],
        "operationId": "decideConsentRequest",
        "summary": "Approve or deny a pending MCP consent request",
        "description": "Served by the hosted MCP server at mcp.wpwaterfall.com, not the API. Approve grants every customer scope the person's role allows, including delete and key scopes; staff and fleet scopes are never granted. With two-factor authentication on and a way to confirm (a password, or a passkey that checks the person), Approve answers 403 until the session confirmed it in the last 10 minutes (POST /users/me/step-up, or POST /users/me/step-up/passkey). A person with neither is never asked. Deny returns access_denied to the client. The answer is the URL to send the browser to. Signed-in user only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the pending consent request."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentDecision"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Where to send the browser",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/assistant/connection": {
      "get": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "getAssistantConnection",
        "summary": "Read whether the person approved the Nami assistant",
        "description": "available is false when the server has no model key or the assistant is off. status is none until the person approves, active after, and revoked after they turn it off. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Assistant approval",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantConnection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "approveAssistantConnection",
        "summary": "Approve the Nami assistant to act as the person",
        "description": "Records the approval as a connection named Nami assistant, so it shows on the Connections page and can be revoked there. The assistant acts with the person's own role on every call, asks before it deletes or spends, and holds no standing key: each answer makes a short key that ends with it. With two-factor authentication on and a way to confirm, it answers 403 until the session confirmed it in the last 10 minutes (POST /users/me/step-up). Session only. Not available while staff act as a customer.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveAssistantConnection"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Assistant approval",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantConnection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "revokeAssistantConnection",
        "summary": "Turn the Nami assistant off",
        "description": "Revokes the approval and cancels every confirmation still waiting. The chats stay. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "204": {
            "description": "Revoked",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/assistant/conversations": {
      "get": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "listAssistantConversations",
        "summary": "List the person's Nami chats",
        "description": "The person's own chats in the current company, newest first. Another member of the company never sees them. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Chats",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantConversationList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "createAssistantConversation",
        "summary": "Start a Nami chat",
        "description": "Makes an empty chat. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "201": {
            "description": "The new chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantConversation"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/assistant/conversations/{id}": {
      "get": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "getAssistantConversation",
        "summary": "Read a Nami chat with its messages",
        "description": "The messages in order, with the state of every confirmation card as it stands now. A secret that was shown once comes back empty. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the Nami chat."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantConversationDetail"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "patch": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "renameAssistantConversation",
        "summary": "Rename a Nami chat",
        "description": "Gives one of the person's own Nami chats a new `title` of 1 to 120 characters and returns the chat. Answers 404 when the chat is not theirs. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the Nami chat."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchAssistantConversation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The renamed chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantConversation"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "delete": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "deleteAssistantConversation",
        "summary": "Delete a Nami chat",
        "description": "The chat leaves the list at once and its messages are removed 30 days later. Confirmations still waiting in it are cancelled. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the Nami chat."
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/assistant/conversations/{id}/messages": {
      "post": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "sendAssistantMessage",
        "summary": "Send a message to Nami and stream the answer",
        "description": "Runs one turn of the assistant as the person. The answer is a Server-Sent Events stream. Each data field is one AssistantStreamEvent as JSON: message_start, then text_delta, status, block, and block_update events, then title (once, after the first answer), then message_end. An error event ends the stream. Closing the connection early leaves the stored message as it was; read the conversation again. Nami uses the same tools as the MCP server, with the person's role. A change that deletes or spends never runs here: it becomes a confirm block, and only POST /assistant/conversations/{id}/actions/{action_id} runs it. One answer at a time for a person: a second message while one runs answers 409. Answers 503 assistant_unavailable without a model key, 402 no_plan without a paid plan, 403 not_approved before the approval, and 429 when the person sends too fast or the company used its daily or monthly budget. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the Nami chat."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendAssistantMessage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantStreamEvent"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/assistant/conversations/{id}/actions/{action_id}": {
      "post": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "decideAssistantAction",
        "summary": "Confirm or cancel a change Nami asked about",
        "description": "A click on a confirm block. decision confirm runs the change once, with the person's role, and streams what happened. The answer is a Server-Sent Events stream. Each data field is one AssistantStreamEvent as JSON: message_start, then text_delta, status, block, and block_update events, then title (once, after the first answer), then message_end. An error event ends the stream. Closing the connection early leaves the stored message as it was; read the conversation again. typed_name must equal the name the card asked for, when it asked for one. A decision from another person, in another chat, after the 15 minutes, or twice answers 404 or 409 and runs nothing. decision cancel answers 204. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the Nami chat."
          },
          {
            "name": "action_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the change Nami asked about."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecideAssistantAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantStreamEvent"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/onboarding": {
      "get": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "getOnboarding",
        "summary": "Read where the account is on the guided start",
        "description": "Read only. The guided start (ADR 270) is the scripted first run of the Nami screen: welcome, plan, site, launch live, domain, and done. The step comes from real data: a live plan, a real site (an Enterprise sandbox counts, a platform test site does not), and a custom domain. guided is true while the account has no plan or no site, the person did not skip, and no staff member acts as the customer; the dashboard then opens the Nami screen first. resumable is true while the guided start applies to the person, skipped or not; the star in the top bar uses it to put them back in. can_buy is false for a role that cannot buy a plan. An Enterprise company has enterprise true and skips the plan step. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Guided start state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/onboarding/dismiss": {
      "put": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "dismissOnboarding",
        "summary": "Skip the guided start",
        "description": "Remembers for this person that they chose Skip to the dashboard. The guided start does not open again for them, in any company. It changes nothing else. Repeating the call is harmless. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Guided start state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/onboarding/resume": {
      "put": {
        "tags": [
          "Nami assistant"
        ],
        "operationId": "resumeOnboarding",
        "summary": "Return to the guided start",
        "description": "Clears this person's Skip, so the guided start can open for them again. The star in the top bar calls it when the account still has no plan or no site. It changes nothing else, and it does nothing for staff acting as the customer. Repeating the call is harmless. It writes the audit entry onboarding.resumed when it clears a Skip. Session only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": null,
        "x-wpwaterfall-permission": "company.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Guided start state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingState"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/environments/additional-preview-quote": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "getAdditionalPreviewQuote",
        "summary": "Whether the next preview environment needs a slot",
        "description": "Read only. Says how many of the 5 included previews the site has used, whether the next preview environment is an additional one, how many additional preview slots the company holds and has free, and what a used slot costs a month. Nothing is created or charged.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "staging",
                "preview"
              ],
              "default": "preview"
            }
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 30
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The quote for the next preview environment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdditionalPreviewQuote"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/convert-to-included": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "convertToIncludedPreview",
        "summary": "Turn an additional preview environment into an included one",
        "description": "For an additional (paid) preview environment on a site that has fewer than its 5 included preview environments in use. The environment stays as it is. It stops using an additional preview slot, and the hours it used stay on the invoice. Answers 409 no_included_preview_room when every included place is taken (delete a preview first), and 409 when the environment is already included. Staging and live are never additional. Audited. Needs permission to update environments.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The environment is included now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertToIncludedResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/billing/additional-previews": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "listAdditionalPreviews",
        "summary": "The additional preview slots of the company and what they cost so far",
        "description": "Read only. Says how many additional preview slots the company holds, how many hold an environment, the slot hours used so far this billing period and what they cost, and lists the additional preview environments using a slot. A slot costs $10 a month, billed by the hour an environment uses it. Time a slot sits empty is never charged.",
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "billing:read",
        "x-wpwaterfall-permission": "billing.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The slots and the environments in them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdditionalPreviewsUsage"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Billing"
        ],
        "operationId": "setAdditionalPreviewSlots",
        "summary": "Set how many additional preview slots the company holds",
        "description": "A slot is a license to have one additional preview environment (beyond a site's 5 included ones) at a time, and to create and delete them freely. A slot costs $10 a month, billed by the hour an environment uses it: nothing is charged for time a slot sits empty, so setting slots charges nothing now. Answers 409 additional_preview_slots_in_use when fewer slots than environments are asked for (delete a preview first), and 409 additional_preview_company_limit above the company limit (100 until staff raise it). Needs an Owner, an Admin, or a Billing user, or an API key with billing:write, and a saved card (402 payment_method_required). Audited.",
        "security": [
          {
            "bearerAuth": [
              "billing:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "billing:write",
        "x-wpwaterfall-permission": "billing.write",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetAdditionalPreviewSlotsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The slots now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdditionalPreviewSlots"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/environments/switcher": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "getEnvironmentSwitcher",
        "summary": "The environment switcher: live, staging, and the rest",
        "description": "Live first, then staging, then previews by name. Each row has its role (staging, live, or preview) and the commit its release runs.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Environments, live first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvironmentSwitcher"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/launch": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "launchLive",
        "summary": "Launch live from staging",
        "description": "A new site starts on staging only. This creates its live environment from staging: a new container on staging's node, a copy of staging's database, a clone of its uploads, a read-only release of the commit staging runs, its own temporary hostname, and a certificate. Needs confirm=true. Answers 409 when live exists, when staging is not running, when staging is in SFTP mode with uncommitted changes (commit them first), or when the last launch failed (delete the failed live environment first). While the site's migration is in progress it answers 409 `site_migrating` and does nothing. A sandbox site (every new Enterprise site) goes live on a free site license an earlier plan left behind, or the company buys the site's 1 site license at the Single `tier` in the body (default `base`, Single 20GB) on the saved card at the company's level price. With no saved card or billing details it answers 409 `no_payment_method` or `billing_details_required` and nothing is bought. A `tier` on any other site answers 422.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LaunchLiveRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/promote/preview": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "previewPromote",
        "summary": "Preview a promote from staging to live",
        "description": "Read only. The commits and files that differ between live's release and staging's release, staging's tables and uploads size for the content choices, the connection mode of each side (live is always Git mode; staging is Git mode unless it was switched to SFTP mode), and the blockers that stop a promote now.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "What a promote would change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotePreview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/promote": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "promoteToLive",
        "summary": "Promote staging to live",
        "description": "The only way code reaches live. Builds the commit staging runs into a release on live, copies the chosen database tables and uploads folders from staging (only with confirm_content_overwrite=true), and swaps live to the release with a restore point first. Send the sha the preview showed: a different commit on staging answers 409 (staging_changed). Needs confirm=true. Returns the promote_environment job; each step is a child job. While the site's migration is in progress it answers 409 `site_migrating` and does nothing.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromoteRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/clone-content": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "cloneContent",
        "summary": "Clone content into a preview environment",
        "description": "Refreshes the database and uploads from live or another environment, with table and folder selection and a search and replace. Code never moves this way. While the site's migration is in progress it answers 409 `site_migrating` and does nothing. A full clone of an environment that holds more than a sandbox's 5 GB into a sandbox answers 409 `sandbox_disk_full` before any job is queued.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloneContentRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/copy-into-live/preview": {
      "get": {
        "tags": [
          "Environments"
        ],
        "operationId": "previewCopyIntoLive",
        "summary": "Preview a copy of staging or a preview into live",
        "description": "Read only. {id} is live. Pass from_env_id, the staging or preview environment to copy from. Returns the tables a copy would replace and the tables live has that the source lacks (a copy keeps those), the uploads size and what merging them would do, whether the site runs WooCommerce, the name the person must type to confirm, the warning sentences, and the blockers that stop a copy now. Needs the code.deploy permission.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "from_env_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "What a copy into live would do",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyIntoLivePreview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/copy-into-live": {
      "post": {
        "tags": [
          "Environments"
        ],
        "operationId": "copyIntoLive",
        "summary": "Copy staging or a preview into live",
        "description": "Replaces the chosen database tables on live, and adds the chosen uploads, from staging or a preview of the same site and server. {id} is live. Code never moves this way: it moves by merge and promote. Nothing is selected by default: send tables (all, or table names) and uploads (all, or folders). Three confirmations are required: confirm=true, confirm_live=true, and live_name_confirmation set to live's primary hostname or the site name, typed exactly. A missing one answers 422 (live_confirmation_required) and says which. WP Waterfall first takes a restore point of live, kept 14 days and not counted against the manual snapshots, and stops without changing live if that fails. The copy keeps live's search engine visibility, the wpwaterfall_* options, and live's user roles, rewrites the source hostname to live's, purges live's caches, and checks that the homepage answers 200. Needs the code.deploy and environments.update permissions. An API key also needs the backups:restore_live scope. Returns the copy_into_live job; its result names the restore point (backup_id).",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CopyIntoLiveRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/sites/{id}/branches": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "listBranches",
        "summary": "List repository branches",
        "description": "Lists the branches of the site's repository, each with the commit it points at (`sha`) and `environment_id`, the environment that runs the branch, or null. A site with no environment returns an empty list.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the site."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Branches with the environment that runs each one",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/merge-check": {
      "get": {
        "tags": [
          "Code"
        ],
        "operationId": "mergeCheck",
        "summary": "Check a merge for conflicts",
        "description": "Read only. Lists the files that would conflict when merging into a branch.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "into",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "code.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Conflict check",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergeCheck"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/merge": {
      "post": {
        "tags": [
          "Code"
        ],
        "operationId": "mergeBranch",
        "summary": "Merge this environment's branch into another branch",
        "description": "Runs the conflict check first and answers 409 with the conflicting files when it fails. Merging a branch into staging's branch (master unless a connected repository says otherwise) redeploys staging: a staging in Git mode builds and mounts a release of the merge commit, and a staging in SFTP mode pulls it into its working tree. Both sides must have no uncommitted changes: an environment in SFTP mode with some answers 409 working_tree_dirty and names the commit route. Code reaches live only through POST /sites/{id}/promote.",
        "security": [
          {
            "bearerAuth": [
              "sites:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "sites:write",
        "x-wpwaterfall-permission": "code.deploy",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeBranchRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/backups": {
      "get": {
        "tags": [
          "Backups"
        ],
        "operationId": "listBackups",
        "summary": "List snapshots of an environment",
        "description": "Manual, system, and daily snapshots, newest first, with their expiry. A snapshot holds the environment's code (a Git commit), database, and uploads.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: 1 to 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "Snapshots",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "createBackup",
        "summary": "Take a manual snapshot",
        "description": "Takes a manual snapshot that holds the code, the database, and the uploads. The body's retention says how long to keep it: 14d (the default), 30d, or 6m (six months). An environment holds at most five manual snapshots at a time, and a sixth answers 409 with the code manual_backup_limit before any job is queued. Scheduled backups and system restore points never count, and deleting a manual snapshot frees its place at once. In SFTP mode, uncommitted changes are committed to the branch first, so the code is always a Git commit.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBackupRequest"
              },
              "example": {
                "label": "Before the theme update",
                "retention": "30d"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "example": {
                  "id": "01934f2b-0d5e-7f61-9a72-8b9c0d1e2f3a",
                  "type": "create_snapshot",
                  "status": "queued",
                  "environment_id": "01934f2a-7c1f-7a10-8b21-3c4d5e6f7a8b",
                  "site_id": "01934f2a-7c1e-7d3b-9a52-6e8f1b2c3d4e",
                  "node_id": "01934e10-2a3b-7c4d-8e5f-6a7b8c9d0e1f",
                  "group_id": null,
                  "progress": 0,
                  "attempts": 0,
                  "error": null,
                  "result": null,
                  "requested_by": {
                    "type": "api_key",
                    "id": "01934d00-1111-7222-8333-444455556666",
                    "label": "CI deploys"
                  },
                  "idempotency_key": "5f1c2a9e-8b7d-4e3f-9a61-2c4d8e0b7f13",
                  "created_at": "2026-11-10T09:15:00.000Z",
                  "started_at": null,
                  "finished_at": null,
                  "updated_at": "2026-11-10T09:15:00.000Z"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/backups/{id}/restore": {
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "restoreBackup",
        "summary": "Restore a snapshot",
        "description": "Restores any of the code, the database, and the files (uploads) of a snapshot into its environment or another environment of the same site. The body's parts pick which, and all three by default. Code on live changes by activating the release the snapshot recorded. Takes a pre-snapshot first. Restoring to live with an API key needs the backups:restore_live scope. Live takes only its own snapshots: a snapshot of staging or a preview answers 409 with the code use_copy_into_live, because data from staging reaches live only through Copy into live. A snapshot larger than a sandbox's 5 GB disk answers 409 with the code sandbox_disk_full before any job is queued.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the backup."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestoreBackupRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/backups/{id}": {
      "delete": {
        "tags": [
          "Backups"
        ],
        "operationId": "deleteBackup",
        "summary": "Delete a backup",
        "description": "Removes the backup's database dump, its file snapshot, and its saved code from the server. A backup that is being made or restored cannot be deleted. The kept copy of a deleted environment goes on its own when it expires.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the backup."
          },
          {
            "name": "confirm",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "required": true
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": true,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/backups/{id}/download": {
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "downloadBackup",
        "summary": "Prepare a backup download",
        "description": "Packs the backup into a .tar.gz (database.sql.gz, wp-content/uploads/, code/, and manifest.json) and stores it. The finished job's result has the filename and size, but never the link: claim the link with POST /backups/{id}/download-link. The archive holds the whole database, so this needs the database permission. A company gets 5 backup downloads in 7 days across all its sites (429 with code backup_download_limit after that: contact support for more).",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the backup."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/backups/{id}/download-link": {
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "claimBackupDownloadLink",
        "summary": "Claim a backup download link",
        "description": "Returns the short lived link of a finished backup download job, once, to the person or API key that asked for the download. A second claim answers 410. The claim writes an audit entry.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the backup."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupDownloadLinkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The link and when it stops working",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupDownloadLink"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/download-backups": {
      "get": {
        "tags": [
          "Backups"
        ],
        "operationId": "listDownloadBackups",
        "summary": "List the downloadable backups of an environment",
        "description": "The archives made in the last 7 days, newest first, with their state and when the file goes. The answer never holds a link. The create object says whether another archive is possible now; when it is not, its code is download_backup_weekly_limit (with next_at, the first moment a new one is possible) or server_too_old.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The downloadable backups and whether another is possible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadBackupList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "createDownloadBackup",
        "summary": "Make a downloadable backup",
        "description": "Packs the whole environment (the code, the database as database.sql.gz, and the uploads) into one .tar.gz and keeps it in WP Waterfall's storage for 48 hours. An environment can make one every 7 days: a second request answers 409 with the code download_backup_weekly_limit and a sentence that names the next possible time. A server whose agent is too old answers 409 with the code server_too_old. It is not charged and does not count toward the five manual backups. The job's result never holds the link: fetch it with POST /download-backups/{id}/download-link. The archive holds the whole database, so this needs the database permission.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "202": {
            "description": "Accepted. The body is the Job object. Follow GET /jobs/{id}/events or poll GET /jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/download-backups/{id}/download-link": {
      "post": {
        "tags": [
          "Backups"
        ],
        "operationId": "claimDownloadBackupLink",
        "summary": "Get a fresh download link for a downloadable backup",
        "description": "Signs a new link that works for 15 minutes and starts the download. Each call returns a new link and uses one of the company's 5 backup downloads for the week (429 with code backup_download_limit after that: contact support for more), while the archive is ready (for 48 hours). Each call writes an audit entry that never holds the link. An archive that expired answers 410, one that is not ready yet answers 409, and another company's archive answers 404.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the downloadable backup."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "database.access",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The link and when it stops working",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadBackupLink"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/backup-schedule": {
      "get": {
        "tags": [
          "Backups"
        ],
        "operationId": "getBackupSchedule",
        "summary": "Read the backup schedule and retention",
        "description": "Daily or weekly backups, or off, and how many are kept. An environment nobody changed uses the default: daily at 03:00 UTC, keep 14. max_keep is the most the plan allows, and 3 for a free sandbox site, whose backups live 3 days.",
        "security": [
          {
            "bearerAuth": [
              "sites:read"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          }
        ],
        "x-wpwaterfall-scope": "sites:read",
        "x-wpwaterfall-permission": "sites.read",
        "x-wpwaterfall-confirm": false,
        "responses": {
          "200": {
            "description": "The schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupSchedule"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      },
      "put": {
        "tags": [
          "Backups"
        ],
        "operationId": "setBackupSchedule",
        "summary": "Change the backup schedule and retention",
        "description": "WP Waterfall takes the scheduled backups and deletes the oldest past the keep count. System restore points (before risky changes) keep their own rule. A keep above max_keep answers 422; a sandbox site keeps at most 3.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutBackupScheduleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupSchedule"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/environments/{id}/backup-schedule/hourly": {
      "put": {
        "tags": [
          "Backups"
        ],
        "operationId": "setHourlyBackups",
        "summary": "Change how often the Hourly backups add-on backs up",
        "description": "Every 6 hours or every hour (every_hours 6 or 1), each backup kept 24 hours. Needs the Hourly Backups add-on on this environment: 402 hourly_backups_required without it. Both choices cost the same, so a change bills nothing, and the daily schedule stays as it is.",
        "security": [
          {
            "bearerAuth": [
              "backups:write"
            ]
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the environment."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-scope": "backups:write",
        "x-wpwaterfall-permission": "environments.update",
        "x-wpwaterfall-confirm": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutHourlyBackupsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupSchedule"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "4XX": {
            "$ref": "#/components/responses/Problem"
          }
        }
      }
    },
    "/auth/providers": {
      "get": {
        "tags": [
          "Sign in"
        ],
        "operationId": "getAuthProviders",
        "summary": "Which sign-in methods the server offers",
        "description": "No sign-in. The dashboard hides the Google and GitHub buttons when the server has no client credentials for them.",
        "security": [],
        "responses": {
          "200": {
            "description": "Methods",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthProviders"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/auth/sign-in": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "signInWithPassword",
        "summary": "Sign in with an email and a password",
        "description": "A wrong password and an unknown address get the same 401. Five wrong passwords for one address, or thirty from one IP address, lock it with a wait that doubles. When the account has two-factor authentication on, the answer is `two_factor_required` and the session starts after `/auth/two-factor/verify`. A company that requires single sign-on refuses its domain with the `sso_required` code, except for its owner and its exceptions list. When the browser holds a pending Google or GitHub link, a finished sign-in settles it and `provider_link` says how: `linked` for a sign-in to the same account, `other_account` or `expired` otherwise.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordSignInRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in, or a second step is needed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignInResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "Not signed in, or the answer was not right",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/sign-up": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "signUpWithPassword",
        "summary": "Create an account with a password",
        "description": "Always answers 202, whether or not the address already has an account (the owner of an existing address gets an email instead). The account starts after the emailed link is opened and confirmed with `/auth/verification/confirm`. The answer sets a cookie that ties the sign-up to this browser: only that browser is signed in by the confirmation, and from any other the person chooses a new password. Passwords are 12 to 128 characters and are checked against a local list of common passwords.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignUpRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Verification email sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignUpResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/verification/confirm": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "confirmVerificationEmail",
        "summary": "Confirm an email address with the emailed link",
        "description": "Takes the token from the emailed link, which opens the dashboard page `/verify`. Opening the link changes nothing: this call confirms the address. From the browser that signed up (it holds the cookie the sign-up set) the answer is `signed_in` with a session. From any other browser the address is confirmed, the password stored at sign-up is removed, and the answer is `password_required` with a `reset_token` for `/auth/password/reset`, so whoever made the sign-up cannot use the password they chose. A second use answers `already_confirmed` and changes nothing. A token that is not valid or has expired answers 400 with the `invalid_verification_link` code. Throttled per address.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmVerificationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmed, or confirmed before",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfirmVerificationResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request was not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/verification/resend": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "resendVerificationEmail",
        "summary": "Send the verification email again",
        "description": "Always answers 202. Throttled per address.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResendVerificationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignUpResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/auth/password/forgot": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "forgotPassword",
        "summary": "Email a password reset link",
        "description": "Always answers 202 for any address. The link works once and expires after 30 minutes. Only a hash of the token is stored.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgotPasswordResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/auth/password/reset": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "resetPassword",
        "summary": "Choose a new password with a reset link",
        "description": "Ends every session and every trusted browser of the account, and sends a security notice.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Password reset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request was not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/recovery/cancel": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "cancelAccountRecovery",
        "summary": "Stop an account recovery change with the emailed link",
        "description": "No sign-in. Takes the token from the link WP Waterfall emails to the old address when support asks to change an account after a recovery request (ADR 325). Opening the link changes nothing: the dashboard page `/recovery-cancel` calls this with a POST. The token's only power is to stop that one change during its 24 hour wait. Answers `cancelled: false` for an unknown, used, or ended link. Wrong links are throttled per address.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelRecoveryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stopped, or nothing to stop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelRecoveryResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/two-factor/verify": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "verifyTwoFactor",
        "summary": "Answer the second step of sign-in",
        "description": "Needs the pending sign-in cookie from a correct password. `method` is `totp` (authenticator app), `email` (emailed code), or `recovery` (a single use recovery code). With `remember_device` the browser skips this step for 30 days.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyTwoFactorRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignInResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request was not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the answer was not right",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/passkey/options": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "startPasskeySignIn",
        "summary": "Start a passkey sign-in or second step",
        "description": "`purpose` `sign_in` is a passkey on its own, with no password. It needs a passkey that checks the person (PIN, fingerprint, or face). `second_factor` needs the pending sign-in cookie from a correct password. The answer holds the WebAuthn options for the browser. The challenge lasts three minutes and works once. Browser only: an API key cannot use it.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyAuthOptionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "WebAuthn options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyOptionsResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "Not signed in, or the answer was not right",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/passkey/verify": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "verifyPasskeySignIn",
        "summary": "Finish a passkey sign-in or second step",
        "description": "Checks the browser's WebAuthn answer against the saved public key, the origin, the relying party id, and the signature counter. A wrong answer is a 401 with the code `passkey_failed`. Wrong answers count against the same lock as wrong codes.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyAuthVerifyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignInResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request was not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the answer was not right",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/two-factor/email/send": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "sendTwoFactorEmailCode",
        "summary": "Email a sign-in code",
        "description": "Needs the pending sign-in cookie. Six digits, valid for 10 minutes, five tries. A new code can be sent every 30 seconds. When the mail provider refuses the message the answer is 503 with the code `email_send_failed`, and a new code can be asked for at once.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailCodeResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "Not signed in, or the answer was not right",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Not set up on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/social/start": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "startSocialSignIn",
        "summary": "Start sign-in with Google or GitHub",
        "description": "Answers the provider's address, built with state and a PKCE challenge. A provider without client credentials answers 503 with the `provider_not_configured` code. The provider must report a verified email address. A provider account that is not linked to the account with its address never signs in and never links by itself: the browser comes back to the sign-in page with `link=google` or `link=github`, and the link is made only after the person signs in to that account the way they already do, within 10 minutes.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SocialStartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Provider address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedirectUrl"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not set up on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/sso/discover": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "discoverSso",
        "summary": "Find out whether an email domain signs in through a company",
        "description": "Send an `email`. The answer says whether its domain signs in through a company's single sign-on (`sso`), gives the company name, and sets `enforced` to true when that company requires SSO, so a password is refused for the address. Only a company whose domain is verified is named. The sign-in page calls it before anyone is signed in, so it takes no session and no API key, and it is rate limited by IP address.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoDiscoverRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoDiscoverResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/auth/sso/start": {
      "post": {
        "tags": [
          "Sign in"
        ],
        "operationId": "startSso",
        "summary": "Start company single sign-on",
        "description": "Answers the identity provider's address with a signed-in-request id the response must answer.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoStartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Identity provider address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedirectUrl"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/security": {
      "get": {
        "tags": [
          "Account security"
        ],
        "operationId": "getSecurityOverview",
        "summary": "Password, two-factor, and connection state",
        "description": "Returns the person's sign-in state: whether they have a password, their sign-in methods, the two-factor methods that are on (passkeys, the authenticator app, and emailed codes), the recovery codes left, and whether a company requires two-factor. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Overview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityOverview"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/security/events": {
      "get": {
        "tags": [
          "Account security"
        ],
        "operationId": "listSecurityEvents",
        "summary": "Recent sign-ins and security changes",
        "description": "Lists the person's own sign-ins and security changes of the last 3 days, each with its IP address and browser, in pages of up to 200 (default 30). Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Events",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityEventList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 30
            },
            "description": "How many rows to return in one page: at most 200, and 30 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ]
      }
    },
    "/users/me/password": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "setPassword",
        "summary": "Change the password, or create one",
        "description": "A person with a password sends the current one. A person who signed in with Google or GitHub and has none sends only the new one, and also `email_code` when their session started more than 15 minutes ago (see `POST /users/me/security/first-factor-code`). Answers 403 with `email_code_required` when the code is missing, `email_code_invalid` when it is wrong, expired, or used. Every other session ends.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPasswordRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/security/first-factor-code": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "sendFirstFactorCode",
        "summary": "Email a code to add a first password or passkey",
        "description": "For a person with no password and no passkey whose session started more than 15 minutes ago. Sends a 6 digit one-time code to the account address. It works for 10 minutes, once, and is void after 5 wrong tries. At most 3 codes an hour per person: the 4th answers 429 with `Retry-After`. A newer code replaces an older one. Send the code as `email_code` with the first password or the first passkey. Answers 409 `first_factor_code_not_needed` when the person already has a password or passkey, or the session is recent. Answers 422 when the mail provider refuses the message. Browser sessions only; staff acting as a customer cannot use it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FirstFactorCodeResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/password/skip": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "skipPasswordPrompt",
        "summary": "Skip the prompt to create a password",
        "description": "Records that the person skipped the prompt to create a password, which a person who signed in with Google or GitHub sees. The body is an empty object, and the answer is `status: skipped`. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkipPasswordPromptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Skipped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/passkeys": {
      "get": {
        "tags": [
          "Account security"
        ],
        "operationId": "listPasskeys",
        "summary": "List passkeys",
        "description": "Name, when it was added, and when it was last used. No key material.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Passkeys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ]
      },
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "addPasskey",
        "summary": "Finish adding a passkey",
        "description": "Checks the browser's WebAuthn answer and saves the public key. The first passkey on an account with no authenticator app also makes ten recovery codes, shown once in `recovery_codes`. Writes an audit event and emails the account address.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyRegisterRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyRegisterResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request was not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/passkeys/options": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "beginPasskeyRegistration",
        "summary": "Start adding a passkey",
        "description": "Asks for the password first when the account has one. A person with no password and no passkey whose session started more than 15 minutes ago also sends `email_code` (see `POST /users/me/security/first-factor-code`); the code is used up here. The answer holds WebAuthn options for the browser: attestation none, user verification preferred, and a resident key preferred so a passkey synced by the system works. At most ten passkeys per person. Browser only: an API key cannot use it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyRegisterOptionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "WebAuthn options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyOptionsResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/passkeys/{id}": {
      "patch": {
        "tags": [
          "Account security"
        ],
        "operationId": "renamePasskey",
        "summary": "Rename a passkey",
        "description": "Gives one of the person's own passkeys a new `name` of 1 to 60 characters and records a security event. Answers 404 when the passkey is not theirs. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id of the passkey, from the passkey list."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenamePasskeyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Renamed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/two-factor/totp": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "beginTotp",
        "summary": "Start the authenticator app setup",
        "description": "Answers the secret, the otpauth address for a QR code, and ten recovery codes. Nothing is on until `/two-factor/totp/confirm` accepts a code from the app. A person with no password and no passkey that checks them, whose session started more than 15 minutes ago, also sends `email_code` (see `POST /users/me/security/first-factor-code`).",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TotpBeginRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Setup details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TotpBeginResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/two-factor/totp/confirm": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "confirmTotp",
        "summary": "Finish the authenticator app setup",
        "description": "Send the `code` from the authenticator app to finish the setup that POST /users/me/two-factor/totp started. A right code turns two-factor on, ends the person's other sessions, and sends them a notice. A wrong code answers 400 `invalid_code`, and repeated wrong codes lock the check for a while. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CodeConfirmRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Turned on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request was not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/two-factor/email": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "beginEmailTwoFactor",
        "summary": "Start emailed sign-in codes",
        "description": "Sends a code to the account address. Answers 422 when the mail provider refuses the message, and a new code can be asked for at once.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordConfirmRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailCodeResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/two-factor/email/confirm": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "confirmEmailTwoFactor",
        "summary": "Finish emailed sign-in codes",
        "description": "Send the emailed `code` to finish turning on emailed sign-in codes. A right code turns two-factor on, ends the person's other sessions, and sends them a notice. A wrong code answers 400 `invalid_code`, and an expired one answers 400 `code_expired`. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CodeConfirmRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Turned on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "The request was not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/two-factor/email/code": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "sendTwoFactorCheckCode",
        "summary": "Email a code to confirm a two-factor change",
        "description": "For a person whose only two-factor method is emailed codes. Sends a code to the account address, to send as `second_factor` `{ method: \"email\", code }` when turning two-factor off. Answers 409 when emailed codes are not the person's only method. Counts against the same per person limit as sign-in codes.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailCodeResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/two-factor/disable": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "disableTwoFactor",
        "summary": "Turn off a two-factor method, or all of them",
        "description": "`method` is `totp`, `email`, `passkey` (with `passkey_id`), or `all`. The password is not enough: send a current `second_factor` too, an authenticator code, a recovery code, a passkey confirmed in the last 10 minutes, or (when emailed codes are the only method) an emailed code. Answers 403 `second_factor_required` without one and `second_factor_invalid` for a wrong one; wrong ones count against the same per person lock as sign-in. A person with no password and no passkey that checks them, whose session started more than 15 minutes ago, also sends `email_code`. Ends every trusted browser and every other session, and sends a security notice. Answers 409 with the code `two_factor_required_by_company` when it would remove the last method of a person whose company requires two-factor.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisableTwoFactorRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Turned off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityStatus"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/two-factor/recovery-codes": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "regenerateRecoveryCodes",
        "summary": "Make ten new recovery codes",
        "description": "The old codes stop working. The new ones are shown once. Needs the password and a current `second_factor`, as for turning two-factor off.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegenerateRecoveryCodesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New codes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryCodesResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/trusted-devices": {
      "get": {
        "tags": [
          "Account security"
        ],
        "operationId": "listTrustedDevices",
        "summary": "List trusted browsers",
        "description": "Lists the person's trusted browsers, each with the time it was trusted (`created_at`) and the time the trust ends (`expires_at`). Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Browsers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustedDeviceList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ]
      },
      "delete": {
        "tags": [
          "Account security"
        ],
        "operationId": "revokeAllTrustedDevices",
        "summary": "Forget every trusted browser",
        "description": "Sends the account a security notice.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Done",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/trusted-devices/{id}": {
      "delete": {
        "tags": [
          "Account security"
        ],
        "operationId": "revokeTrustedDevice",
        "summary": "Forget one trusted browser",
        "description": "Forgets one of the person's trusted browsers and records a security event. Answers 204, or 404 when the browser was not found. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The id of the trusted browser."
          }
        ],
        "responses": {
          "204": {
            "description": "Done",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/sessions": {
      "get": {
        "tags": [
          "Account security"
        ],
        "operationId": "listSessions",
        "summary": "List sign-in sessions",
        "description": "Every session of the signed-in person, newest first. `current` marks this one.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sessions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many rows to return in one page: at most 200, and 50 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ]
      },
      "delete": {
        "tags": [
          "Account security"
        ],
        "operationId": "revokeOtherSessions",
        "summary": "Sign out every other session",
        "description": "Sends the account a security notice.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "How many ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionsRevoked"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/intercom": {
      "get": {
        "tags": [
          "Account security"
        ],
        "operationId": "getIntercomIdentity",
        "summary": "The signed identity for the Nami chat",
        "description": "The Nami chat runs on Intercom's Messenger. The answer is a JSON Web Token, signed with HS256 by the Messenger secret, that tells Intercom who the signed-in person is: their user id, email, name, and the company in use. It lasts one hour, so the dashboard asks again before `expires_at`. Answers 403 while staff act as a customer, and 503 when the server has no Messenger secret.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The identity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntercomIdentity"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not set up on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/bug-reports": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "sendBugReport",
        "summary": "Report a bug from the dashboard",
        "description": "The dashboard's Report a bug button posts here. Emails the report to WP Waterfall staff with the person's address as the reply address, and stores nothing: the address of the page, what the person typed, the size of their browser window, their browser's name, and a picture of the page when they sent one (JPEG or PNG in base64, at most 1.5 MB). A dashboard session only: an API key is refused, and so is WP Waterfall staff acting as the customer. Limited to 10 reports an hour for a person and 30 for a company. The audit entry holds the path of the page only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BugReportRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Received",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BugReportResponse"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts. Retry-After says when to try again",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Not set up on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/security/secure-account": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "secureAccount",
        "summary": "Secure my account",
        "description": "Ends every other session, forgets every trusted browser, and ends every assistant connection the person approved, with the API key behind each. Lists the person's API keys that still work, so the screen can offer to revoke them. Sends the account a security notice. Needs a recent sign-in: answers 403 `step-up-required` otherwise.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecureAccountRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureAccountResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/users/me/connections": {
      "get": {
        "tags": [
          "Account security"
        ],
        "operationId": "listConnections",
        "summary": "Google and GitHub sign-in connections",
        "description": "Returns one row for Google and one for GitHub: `available` (sign-in with the provider is set up here), `linked`, and `linked_at`. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connections",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionList"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "How many rows to return in one page: at most 200, and 200 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` of the page before. Leave it out for the first page."
          }
        ]
      }
    },
    "/users/me/connections/{provider}/link": {
      "post": {
        "tags": [
          "Account security"
        ],
        "operationId": "linkConnection",
        "summary": "Start linking Google or GitHub",
        "description": "Adds a way to sign in, so it needs a recent sign-in: answers 403 `step-up-required` otherwise. The provider account must carry the address of this account, checked by the provider.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Provider address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedirectUrl"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "description": "Not set up on this server",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/connections/{provider}": {
      "delete": {
        "tags": [
          "Account security"
        ],
        "operationId": "unlinkConnection",
        "summary": "Unlink Google or GitHub",
        "description": "Refused for the last way to sign in. Needs a recent sign-in: answers 403 `step-up-required` otherwise.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Unlinked",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/sso": {
      "get": {
        "tags": [
          "SSO"
        ],
        "operationId": "getSso",
        "summary": "Get the SAML connection",
        "description": "Enterprise accounts only.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-permission": "sso.manage",
        "responses": {
          "200": {
            "description": "Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConnection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "put": {
        "tags": [
          "SSO"
        ],
        "operationId": "setSso",
        "summary": "Create or replace the SAML connection",
        "description": "Give the identity provider's metadata (a URL or the XML), or its entity ID, sign-in URL, and certificate. Signed assertions are required. Metadata URLs must be public https addresses.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-permission": "sso.manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertSsoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConnection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "tags": [
          "SSO"
        ],
        "operationId": "updateSso",
        "summary": "Change SSO settings",
        "description": "Mandatory SSO, domains, just-in-time provisioning and its roles, the exceptions list, and identity provider initiated sign-in (off by default). Mandatory SSO needs a verified domain and a passing test.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyOptional"
          }
        ],
        "x-wpwaterfall-permission": "sso.manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSsoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConnection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "tags": [
          "SSO"
        ],
        "operationId": "deleteSso",
        "summary": "Remove the SAML connection",
        "description": "Removes the company's SAML connection. Only the Owner of an Enterprise account may call it, after a recent sign-in: any other account type answers 403. Answers 204. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-permission": "sso.manage",
        "responses": {
          "204": {
            "description": "Removed",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/sso/sp-metadata": {
      "get": {
        "tags": [
          "SSO"
        ],
        "operationId": "getSsoServiceProviderMetadata",
        "summary": "What the identity provider needs from WP Waterfall",
        "description": "The entity ID, the assertion consumer service address, and metadata XML.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "x-wpwaterfall-permission": "sso.manage",
        "responses": {
          "200": {
            "description": "Service provider details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoSpMetadata"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/sso/verify-domain": {
      "post": {
        "tags": [
          "SSO"
        ],
        "operationId": "verifySsoDomain",
        "summary": "Check the DNS record that proves the domains",
        "description": "Looks up the TXT record on every domain of the connection. `verified` is true only when each domain has it, and `detail` names the domains that lack it. A check that fails also turns off required SSO when it was on. Only the Owner of an Enterprise account may call it, after a recent sign-in, and it answers 404 when no connection is set up. Needs a dashboard session: an API key cannot call it.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-permission": "sso.manage",
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoDomainCheck"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/sso/test": {
      "post": {
        "tags": [
          "SSO"
        ],
        "operationId": "testSso",
        "summary": "Test the connection",
        "description": "Checks the identity provider settings, certificate dates, the metadata URL, and the domain proof. A passing test is needed before mandatory SSO.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-permission": "sso.manage",
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoTestResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/sso/certificates": {
      "post": {
        "tags": [
          "SSO"
        ],
        "operationId": "addSsoCertificate",
        "summary": "Add a signing certificate (rotation)",
        "description": "Add the new certificate before the identity provider switches to it, then remove the old one.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-wpwaterfall-permission": "sso.manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddSsoCertificateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConnection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field is missing or not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/companies/me/sso/certificates/{fingerprint}": {
      "delete": {
        "tags": [
          "SSO"
        ],
        "operationId": "removeSsoCertificate",
        "summary": "Remove a signing certificate",
        "description": "A connection keeps at least one current certificate.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "fingerprint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-wpwaterfall-permission": "sso.manage",
        "responses": {
          "200": {
            "description": "Connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConnection"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Refused",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "Conflict with the current state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key: wpw_live_ or wpw_test_ plus 32 random bytes. Keys made before 2026-11-14 start with hk_live_ or hk_test_ and work until they expire or are revoked."
      },
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "better-auth.session_token"
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "Send a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422.",
        "schema": {
          "type": "string",
          "maxLength": 255
        },
        "example": "5f1c2a9e-8b7d-4e3f-9a61-2c4d8e0b7f13"
      },
      "IdempotencyKeyOptional": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Optional on PUT and PATCH. When the call starts a job, a retry with the same key, path, and body within 24 hours returns that job instead of starting another. A different path or body starts a new job.",
        "schema": {
          "type": "string",
          "maxLength": 255
        },
        "example": "5f1c2a9e-8b7d-4e3f-9a61-2c4d8e0b7f13"
      }
    },
    "responses": {
      "Problem": {
        "description": "Problem Details (RFC 9457)",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.",
        "headers": {
          "WWW-Authenticate": {
            "$ref": "#/components/headers/WwwAuthenticate"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "BadRequest": {
        "description": "The request could not be read: bad JSON, a bad header, or a malformed value.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NotFound": {
        "description": "The thing in the path does not exist, or it belongs to another company. The answer is the same for both.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Conflict": {
        "description": "The current state does not allow this: the same change is already running, or another change got there first.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "headers": {
      "RateLimitLimit": {
        "description": "The most requests the caller may make in the window this answer counted against. A job-creating route reports its own, lower window.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in the window. 0 means the next call answers 429.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "RateLimitReset": {
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before the same call can succeed.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "WwwAuthenticate": {
        "description": "How to sign in, as RFC 9110 and RFC 6750 ask: Bearer realm=\"WP Waterfall API\". When the request carried a Bearer token that was refused, it adds error=\"invalid_token\" and an error_description.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Domain": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "hostname": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(\\*\\.)?([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
          },
          "wildcard": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "txt_pending",
              "cname_pending",
              "validating",
              "securing",
              "active",
              "failed",
              "removed"
            ]
          },
          "ssl_status": {
            "type": "string",
            "enum": [
              "pending",
              "pending_validation",
              "pending_issuance",
              "active",
              "failed",
              "removed"
            ]
          },
          "setup_mode": {
            "type": "string",
            "enum": [
              "standard",
              "prepare_first"
            ]
          },
          "is_primary": {
            "type": "boolean"
          },
          "force_https_mode": {
            "type": "string",
            "enum": [
              "off",
              "all_hostnames",
              "primary_only"
            ]
          },
          "zero_touch": {
            "type": "boolean",
            "description": "True when the hostname sits in a Cloudflare DNS zone of this company: attach needs no manual step."
          },
          "dns_zone_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "cf_custom_hostname_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "cname_target": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 253,
            "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$",
            "description": "Always null. Replaced by the A and AAAA records of the verification records."
          },
          "ownership_txt": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "value"
            ]
          },
          "certificate_txt": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "value"
            ]
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job that attaches or removes the domain, while it runs."
          },
          "job_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "queued",
              "dispatched",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "failure_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "A plain sentence when the domain failed."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The 72 hour window closes here."
          },
          "activated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ownership_proof": {
            "type": "object",
            "properties": {
              "method": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "txt",
                  "zone",
                  "parent",
                  "legacy"
                ]
              },
              "state": {
                "type": "string",
                "enum": [
                  "pending",
                  "expired",
                  "verified",
                  "lapsed"
                ]
              },
              "record": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "value"
                ],
                "description": "The TXT record to set. Set while the method is `txt`."
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "verified_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "checked_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "The last daily re-check."
              },
              "lapsed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the record first went missing, while it is missing."
              }
            },
            "required": [
              "method",
              "state",
              "record",
              "expires_at",
              "verified_at",
              "checked_at",
              "lapsed_at"
            ],
            "default": {
              "method": null,
              "state": "pending",
              "record": null,
              "expires_at": null,
              "verified_at": null,
              "checked_at": null,
              "lapsed_at": null
            },
            "description": "Proof that the company controls the name. Nothing is set up at Cloudflare until it passes."
          },
          "parent_domain_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "For a name on staging or a preview: the live domain it sits under. Null on live. Removing that live domain removes this name too.",
            "default": null
          },
          "subsite_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 2,
            "default": null,
            "description": "The WordPress blog id of the subsite of a Multisite network this host serves, 2 or more. Null for every other domain."
          },
          "environment_name": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "The environment the name belongs to, by name and role, so a site wide list reads plainly."
          },
          "environment_role": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "staging",
              "live",
              "preview"
            ],
            "default": null
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "environment_id",
          "site_id",
          "hostname",
          "wildcard",
          "status",
          "ssl_status",
          "setup_mode",
          "is_primary",
          "force_https_mode",
          "zero_touch",
          "dns_zone_id",
          "cf_custom_hostname_id",
          "cname_target",
          "ownership_txt",
          "certificate_txt",
          "job_id",
          "job_status",
          "failure_reason",
          "expires_at",
          "activated_at",
          "ownership_proof",
          "parent_domain_id",
          "subsite_id",
          "environment_name",
          "environment_role",
          "created_at",
          "updated_at"
        ]
      },
      "DomainList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Domain"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CreateDomainRequest": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(\\*\\.)?([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
          },
          "include_www": {
            "type": "boolean",
            "description": "Also add the twin of `hostname`: `www.` for a bare name, the bare name for a `www.` one. Left out, it is true for a bare name such as `example.com` and for `www.example.com` on live, and false for any other subdomain, a wildcard, a Multisite subsite host, and staging. Send false to add one name only. The name you type stays the one you chose as primary."
          },
          "wildcard": {
            "type": "boolean",
            "default": false,
            "description": "A wildcard covers every name under the domain. Only a caller who can manage DNS for the whole company may add one (`WILDCARD_NEEDS_DNS_CODE`)."
          },
          "setup_mode": {
            "type": "string",
            "enum": [
              "standard",
              "prepare_first"
            ],
            "default": "standard"
          },
          "make_primary": {
            "type": "boolean",
            "default": false,
            "description": "Switch the primary domain to this hostname as soon as it is active. Live only."
          },
          "subsite_id": {
            "type": "integer",
            "minimum": 2,
            "description": "Map this host to one subsite of a WordPress Multisite network, by blog id (2 or more). Once the host is active, WordPress serves that subsite on it. Refused unless the environment is a network that has the subsite. Not with `wildcard`, `include_www`, or `make_primary`."
          }
        },
        "required": [
          "hostname"
        ],
        "description": "Adds a domain to the environment in the path. On live: any domain. On staging, or a branch: only a name under a custom domain connected to live, such as `staging.example.com`, or the wildcard `*.example.com`. Those take neither `include_www` nor `make_primary`, because the primary domain is a live only setting."
      },
      "PatchDomainRequest": {
        "type": "object",
        "properties": {
          "force_https_mode": {
            "type": "string",
            "enum": [
              "off",
              "all_hostnames",
              "primary_only"
            ]
          },
          "setup_mode": {
            "type": "string",
            "enum": [
              "standard",
              "prepare_first"
            ]
          }
        }
      },
      "MakePrimaryRequest": {
        "type": "object",
        "properties": {
          "redirect_old_primary": {
            "type": "boolean",
            "default": true,
            "description": "Add a 301 from the old primary hostname to the new one."
          }
        }
      },
      "RefreshSslRequest": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7",
            "default": null
          }
        },
        "description": "Refresh SSL: check the certificate of one custom domain again, or of the environment's temporary hostname when `domain_id` is null. One job per name at a time."
      },
      "CustomCertificate": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "hostname": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "installing",
              "installed",
              "failed"
            ]
          },
          "layer": {
            "type": "string",
            "enum": [
              "origin",
              "edge_and_origin"
            ],
            "description": "The layer that carries the certificate once it is installed."
          },
          "visitors_see": {
            "type": "string",
            "enum": [
              "cloudflare",
              "customer"
            ],
            "description": "What visitors receive: Cloudflare's own certificate, or this one."
          },
          "layer_note": {
            "type": "string",
            "description": "One plain sentence that says which layer carries the certificate and what visitors see."
          },
          "subject": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "sans": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "serial": {
            "type": "string"
          },
          "not_before": {
            "type": "string",
            "format": "date-time"
          },
          "not_after": {
            "type": "string",
            "format": "date-time"
          },
          "fingerprint_sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "installed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The install job, while it runs or after it failed."
          },
          "failure_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "domain_id",
          "environment_id",
          "hostname",
          "status",
          "layer",
          "visitors_see",
          "layer_note",
          "subject",
          "issuer",
          "sans",
          "serial",
          "not_before",
          "not_after",
          "fingerprint_sha256",
          "installed_at",
          "job_id",
          "failure_reason",
          "created_at"
        ],
        "description": "Metadata only. The private key is never part of any answer."
      },
      "CustomCertificateList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomCertificate"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          },
          "edge_layer_available": {
            "type": "boolean",
            "description": "True when the platform can also put the certificate on Cloudflare's edge (Enterprise only)."
          }
        },
        "required": [
          "data",
          "next_cursor",
          "edge_layer_available"
        ]
      },
      "InstallCustomCertificateRequest": {
        "type": "object",
        "properties": {
          "certificate_pem": {
            "type": "string",
            "minLength": 100,
            "maxLength": 32768,
            "description": "The certificate, then its intermediates, as PEM."
          },
          "private_key_pem": {
            "type": "string",
            "minLength": 100,
            "maxLength": 8192,
            "description": "The private key as unencrypted PEM. Write-only."
          }
        },
        "required": [
          "certificate_pem",
          "private_key_pem"
        ],
        "additionalProperties": false,
        "description": "`PUT /domains/{id}/custom-certificate`. The private key is write-only: the API seals it and never returns it, puts it in a job, an event, a result, an audit entry, or a log."
      },
      "DomainCheckRequest": {
        "type": "object",
        "properties": {}
      },
      "VerificationRecords": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "hostname": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(\\*\\.)?([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "txt_pending",
              "cname_pending",
              "validating",
              "securing",
              "active",
              "failed",
              "removed"
            ]
          },
          "cname_target": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 253,
            "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$",
            "description": "Always null. The routing target is the CNAME row in `records`. Kept so older clients still parse."
          },
          "dns_addresses": {
            "type": "object",
            "properties": {
              "a": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "ipv4"
                }
              },
              "aaaa": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "ipv6"
                }
              }
            },
            "required": [
              "a",
              "aaaa"
            ],
            "default": {
              "a": [],
              "aaaa": []
            },
            "description": "The fixed addresses the A and AAAA rows point at. The same set as `dns_addresses` on the environment. Empty until staff set it."
          },
          "dns_provider": {
            "type": "string",
            "enum": [
              "wpwaterfall",
              "cloudflare",
              "other"
            ],
            "default": "other",
            "description": "Where the domain's DNS lives, which decides the routing record."
          },
          "routing_mode": {
            "type": "string",
            "enum": [
              "a_records",
              "cname"
            ],
            "default": "cname",
            "description": "`a_records` or `cname`: the form of the routing rows in `records`."
          },
          "records": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "purpose": {
                  "type": "string",
                  "enum": [
                    "proof",
                    "ownership",
                    "certificate",
                    "routing",
                    "delegation"
                  ],
                  "description": "`proof`: the TXT record that proves the company controls the name. `ownership` is Cloudflare's own hostname check, which only exists after the proof passed."
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "TXT",
                    "CNAME",
                    "A",
                    "AAAA"
                  ],
                  "description": "The routing records are `A` and `AAAA` rows, one per address of `dns_addresses` (only when `routing_mode` is `a_records`), or one `CNAME` row to the fallback origin. The other `CNAME` rows and the `TXT` rows are the certificate and ownership records of ADR 030."
                },
                "name": {
                  "type": "string"
                },
                "expected": {
                  "type": "string"
                },
                "found": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  },
                  "description": "Set after a check. The exact values the resolver found."
                },
                "ok": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "required": {
                  "type": "boolean",
                  "description": "False for a record that only speeds things up, such as the ownership TXT with HTTP validation."
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "One plain sentence for this record, such as how to set a CNAME at the apex."
                }
              },
              "required": [
                "purpose",
                "type",
                "name",
                "expected",
                "found",
                "ok",
                "required",
                "note"
              ]
            },
            "description": "Never two records at one name when one of them is a CNAME: DNS forbids it."
          },
          "routing": {
            "type": "string",
            "enum": [
              "ok",
              "legacy_cname",
              "wrong",
              "missing",
              "unchecked"
            ],
            "default": "unchecked",
            "description": "How the name reaches WP Waterfall after the last check. `ok`: through the records of the routing mode. `legacy_cname`: through a CNAME that works but is not the form the routing mode asks for (replace it with the A and AAAA records). `wrong`: records that point elsewhere. `missing`: nothing at the name. `unchecked`: no check yet, or a prepare-first domain before the move."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": [],
            "description": "Plain advice that is not a problem, one sentence each: a CNAME that works but should be replaced by the records above, or missing AAAA records. Empty when there is nothing to say."
          },
          "dcv_method": {
            "type": "string",
            "enum": [
              "http",
              "txt",
              "none"
            ]
          },
          "origin_certificate": {
            "type": "string",
            "enum": [
              "pending",
              "installed",
              "not_applicable"
            ]
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "One plain sentence per problem, naming the exact wrong record. Empty when all is well."
          },
          "cloudflare_errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": [],
            "description": "What Cloudflare itself says is wrong with the name or its certificate, in its own words. Empty while Cloudflare only waits for the records: it reports that on every healthy setup."
          },
          "ownership_proof": {
            "type": "object",
            "properties": {
              "method": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "txt",
                  "zone",
                  "parent",
                  "legacy"
                ]
              },
              "state": {
                "type": "string",
                "enum": [
                  "pending",
                  "expired",
                  "verified",
                  "lapsed"
                ]
              }
            },
            "required": [
              "method",
              "state"
            ],
            "default": {
              "method": null,
              "state": "pending"
            },
            "description": "The ownership proof state, so the Domains tab can lead with it."
          }
        },
        "required": [
          "domain_id",
          "hostname",
          "status",
          "cname_target",
          "dns_addresses",
          "dns_provider",
          "routing_mode",
          "records",
          "routing",
          "notes",
          "dcv_method",
          "origin_certificate",
          "checked_at",
          "problems",
          "cloudflare_errors",
          "ownership_proof"
        ]
      },
      "DnsZone": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "name": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "moved",
              "failed",
              "deleted"
            ]
          },
          "cf_zone_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "nameservers": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 253,
              "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
            },
            "description": "The nameservers the customer sets at the registrar."
          },
          "dnssec_status": {
            "type": "string",
            "enum": [
              "disabled",
              "pending",
              "active",
              "pending_disabled",
              "error"
            ]
          },
          "ds_record": {
            "type": [
              "string",
              "null"
            ]
          },
          "record_count": {
            "type": "integer",
            "minimum": 0
          },
          "record_limit": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "job_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "queued",
              "dispatched",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "last_activation_check_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "activated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "adopted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "default": null,
            "description": "Set when the zone already existed in WP Waterfall's Cloudflare account and WP Waterfall adopted it."
          },
          "ownership_txt": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "value"
            ],
            "default": null,
            "description": "The TXT record that proves control of a zone waiting for adoption. Null once adopted, and for zones WP Waterfall created itself."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "cf_zone_id",
          "nameservers",
          "dnssec_status",
          "ds_record",
          "record_count",
          "record_limit",
          "job_id",
          "job_status",
          "last_activation_check_at",
          "activated_at",
          "adopted_at",
          "ownership_txt",
          "created_at",
          "updated_at"
        ]
      },
      "DnsZoneList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsZone"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          },
          "limit": {
            "type": "object",
            "properties": {
              "used": {
                "type": "integer",
                "minimum": 0
              },
              "allowed": {
                "type": [
                  "integer",
                  "null"
                ],
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "used",
              "allowed"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor",
          "limit"
        ]
      },
      "CreateDnsZoneRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
          },
          "scan": {
            "type": "boolean",
            "default": true,
            "description": "Look up the common records at the current host and import them."
          }
        },
        "required": [
          "name"
        ]
      },
      "ActivationCheckRequest": {
        "type": "object",
        "properties": {
          "quiet": {
            "type": "boolean",
            "default": false,
            "description": "Skip the in-app notice when this check finds the zone live. The dashboard polls with it and shows the result on the zone itself, so the bell stays quiet."
          }
        },
        "description": "POST /dns/zones/{id}/activation-check. The body is optional."
      },
      "ActivationCheckResult": {
        "type": "object",
        "properties": {
          "zone_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "moved",
              "failed",
              "deleted"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "expected_nameservers": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 253,
              "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
            }
          },
          "found_nameservers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "message": {
            "type": "string",
            "description": "One plain sentence: what to change at the registrar, or that the zone is live."
          },
          "adopted": {
            "type": "boolean",
            "default": false,
            "description": "True when this check adopted a zone that already existed in WP Waterfall's Cloudflare account."
          },
          "imported_records": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Records read from Cloudflare by this check (an active zone refreshes its records)."
          },
          "ownership_txt": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "value"
            ],
            "default": null,
            "description": "Still waiting for this TXT record before the zone can be adopted."
          }
        },
        "required": [
          "zone_id",
          "status",
          "active",
          "expected_nameservers",
          "found_nameservers",
          "checked_at",
          "message",
          "adopted",
          "imported_records",
          "ownership_txt"
        ]
      },
      "DnsZoneAdoptResult": {
        "type": "object",
        "properties": {
          "zone_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "moved",
              "failed",
              "deleted"
            ]
          },
          "adopted": {
            "type": "boolean"
          },
          "imported_records": {
            "type": "integer",
            "minimum": 0
          },
          "ownership_txt": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "value"
            ],
            "description": "Set while the zone still waits for the ownership TXT record."
          },
          "message": {
            "type": "string",
            "description": "One plain sentence: adopted, or what to add and where."
          }
        },
        "required": [
          "zone_id",
          "status",
          "adopted",
          "imported_records",
          "ownership_txt",
          "message"
        ],
        "description": "The answer to an adoption attempt on a zone that already exists in WP Waterfall's Cloudflare account."
      },
      "DnsRefreshResult": {
        "type": "object",
        "properties": {
          "imported": {
            "type": "integer",
            "minimum": 0
          },
          "updated": {
            "type": "integer",
            "minimum": 0
          },
          "removed": {
            "type": "integer",
            "minimum": 0
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsRecord"
            }
          },
          "snapshot_version": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "imported",
          "updated",
          "removed",
          "records",
          "snapshot_version"
        ],
        "description": "A read-only refresh of the mirror from the records Cloudflare holds."
      },
      "DnsRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "zone_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "type": {
            "type": "string",
            "enum": [
              "A",
              "AAAA",
              "CNAME",
              "MX",
              "TXT",
              "SRV",
              "CAA",
              "NS"
            ]
          },
          "name": {
            "type": "string",
            "description": "Fully qualified, without a trailing dot."
          },
          "content": {
            "type": "string"
          },
          "ttl": {
            "type": "integer"
          },
          "priority": {
            "type": [
              "integer",
              "null"
            ]
          },
          "managed": {
            "type": "boolean",
            "description": "Written by WP Waterfall (zero-touch attach). Locked in the editor."
          },
          "comment": {
            "type": [
              "string",
              "null"
            ]
          },
          "cf_record_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "proxied": {
            "type": "boolean",
            "default": false,
            "description": "Traffic goes through Cloudflare's proxy. Read from Cloudflare; WP Waterfall writes DNS-only records."
          },
          "imported": {
            "type": "boolean",
            "default": false,
            "description": "Read from Cloudflare (an adopted zone, or a refresh), not written by WP Waterfall."
          },
          "points_at_site": {
            "type": "boolean",
            "default": false,
            "description": "The name or target matches a domain attached to one of the company's sites."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "zone_id",
          "type",
          "name",
          "content",
          "ttl",
          "priority",
          "managed",
          "comment",
          "cf_record_id",
          "proxied",
          "imported",
          "points_at_site",
          "created_at",
          "updated_at"
        ]
      },
      "DnsRecordList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsRecord"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Live warnings such as the SPF lookup count, for the records on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as cursor for the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "warnings"
        ]
      },
      "DnsRecordRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "A",
              "AAAA",
              "CNAME",
              "MX",
              "TXT",
              "SRV",
              "CAA",
              "NS"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "pattern": "^(@|(\\*\\.)?[A-Za-z0-9_]([A-Za-z0-9_-]{0,61}[A-Za-z0-9_])?(\\.[A-Za-z0-9_]([A-Za-z0-9_-]{0,61}[A-Za-z0-9_])?)*\\.?|\\*)$"
          },
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "ttl": {
            "type": "integer",
            "default": 1
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 65535,
            "description": "MX and SRV only."
          },
          "comment": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "type",
          "name",
          "content"
        ]
      },
      "PatchDnsRecordRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "A",
              "AAAA",
              "CNAME",
              "MX",
              "TXT",
              "SRV",
              "CAA",
              "NS"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "pattern": "^(@|(\\*\\.)?[A-Za-z0-9_]([A-Za-z0-9_-]{0,61}[A-Za-z0-9_])?(\\.[A-Za-z0-9_]([A-Za-z0-9_-]{0,61}[A-Za-z0-9_])?)*\\.?|\\*)$"
          },
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "ttl": {
            "type": "integer",
            "default": 1
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 65535
          },
          "comment": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "DnsSnapshot": {
        "type": "object",
        "properties": {
          "zone_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "record_count": {
            "type": "integer",
            "minimum": 0
          },
          "actor_type": {
            "type": "string",
            "enum": [
              "user",
              "api_key",
              "mcp_agent",
              "system"
            ]
          },
          "actor_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor_label": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "zone_id",
          "version",
          "record_count",
          "actor_type",
          "actor_id",
          "actor_label",
          "reason",
          "created_at"
        ]
      },
      "DnsSnapshotList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsSnapshot"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CreateDnsSnapshotRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "Saved on request"
          }
        },
        "description": "A snapshot taken on request, before a risky change. The reason shows in the version list."
      },
      "RestoreSnapshotRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "NameserverRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "zone_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "hostnames": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 253,
              "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
            },
            "minItems": 2,
            "maxItems": 4
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "approved",
              "rejected",
              "active"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "zone_id",
          "hostnames",
          "status",
          "note",
          "created_at",
          "updated_at"
        ],
        "description": "Vanity nameservers for a zone. Stored as a request: Cloudflare account custom nameservers arrive through support."
      },
      "CreateNameserverRequestRequest": {
        "type": "object",
        "properties": {
          "hostnames": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 253,
              "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
            },
            "minItems": 2,
            "maxItems": 4
          },
          "note": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "hostnames"
        ]
      },
      "CacheSettings": {
        "type": "object",
        "properties": {
          "server_enabled": {
            "type": "boolean"
          },
          "server_ttl": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "edge_enabled": {
            "type": "boolean"
          },
          "edge_ttl": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "static_ttl": {
            "type": "integer",
            "minimum": 60,
            "maximum": 31536000
          },
          "stale_while_revalidate": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3600
          },
          "stale_if_error": {
            "type": "integer",
            "minimum": 0,
            "maximum": 604800
          },
          "exclusions": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "pattern": "^\\/[^\\s?#]*$"
            },
            "maxItems": 200
          },
          "ignored_params": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "pattern": "^[A-Za-z0-9_*.-]+$"
            },
            "maxItems": 100
          },
          "image_optimization": {
            "type": "string",
            "enum": [
              "off",
              "lossless",
              "lossy"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "server_enabled",
          "server_ttl",
          "edge_enabled",
          "edge_ttl",
          "static_ttl",
          "stale_while_revalidate",
          "stale_if_error",
          "exclusions",
          "ignored_params",
          "image_optimization",
          "updated_at"
        ],
        "description": "Defaults: HTML 1 hour, static 30 days, SWR 60 seconds, SIE 1 day."
      },
      "PutCacheSettingsRequest": {
        "type": "object",
        "properties": {
          "server_enabled": {
            "type": "boolean"
          },
          "server_ttl": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "edge_enabled": {
            "type": "boolean"
          },
          "edge_ttl": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "static_ttl": {
            "type": "integer",
            "minimum": 60,
            "maximum": 31536000
          },
          "stale_while_revalidate": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3600
          },
          "stale_if_error": {
            "type": "integer",
            "minimum": 0,
            "maximum": 604800
          },
          "exclusions": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "pattern": "^\\/[^\\s?#]*$"
            },
            "maxItems": 200
          },
          "ignored_params": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "pattern": "^[A-Za-z0-9_*.-]+$"
            },
            "maxItems": 100
          },
          "image_optimization": {
            "type": "string",
            "enum": [
              "off",
              "lossless",
              "lossy"
            ]
          }
        }
      },
      "PurgeCacheRequest": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "all",
              "urls",
              "tags",
              "cdn"
            ],
            "default": "all"
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "maxItems": 1000,
            "default": []
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 100,
            "default": []
          },
          "include_subdirectories": {
            "type": "boolean",
            "default": false,
            "description": "With scope `urls`: also clear every page under each URL, such as everything under /blog/. Runs as a Cloudflare purge by prefix, so it takes at most 100 URLs."
          }
        }
      },
      "CdnSettings": {
        "type": "object",
        "properties": {
          "image_optimization": {
            "type": "string",
            "enum": [
              "off",
              "lossless",
              "lossy"
            ]
          },
          "exclusions": {
            "type": "object",
            "properties": {
              "paths": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 200
                },
                "maxItems": 50
              },
              "urls": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "maxItems": 50
              },
              "extensions": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "7z",
                    "avi",
                    "avif",
                    "apk",
                    "bin",
                    "bmp",
                    "bz2",
                    "class",
                    "css",
                    "csv",
                    "doc",
                    "docx",
                    "dmg",
                    "ejs",
                    "eot",
                    "eps",
                    "exe",
                    "flac",
                    "gif",
                    "gz",
                    "ico",
                    "iso",
                    "jar",
                    "jpg",
                    "jpeg",
                    "js",
                    "mid",
                    "midi",
                    "mkv",
                    "mp3",
                    "mp4",
                    "ogg",
                    "otf",
                    "pdf",
                    "pict",
                    "pls",
                    "png",
                    "ppt",
                    "pptx",
                    "ps",
                    "rar",
                    "svg",
                    "svgz",
                    "swf",
                    "tar",
                    "tif",
                    "tiff",
                    "ttf",
                    "webm",
                    "webp",
                    "woff",
                    "woff2",
                    "xls",
                    "xlsx",
                    "zip",
                    "zst"
                  ]
                },
                "maxItems": 56
              }
            },
            "required": [
              "paths",
              "urls",
              "extensions"
            ]
          },
          "enforcement": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "pending",
                  "applied",
                  "failed",
                  "never"
                ]
              },
              "origin_applied": {
                "type": "boolean"
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "image_optimization": {
                "type": "string",
                "enum": [
                  "off",
                  "lossless",
                  "lossy"
                ],
                "description": "The image optimization mode the web server held after that job. It differs from the saved mode while the server cannot take it yet. Left out when the job did not report it."
              },
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "UUIDv7"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "state",
              "origin_applied",
              "notes",
              "job_id",
              "updated_at"
            ],
            "description": "What the last apply job did, so the cards say what is in force and not only what is saved."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "image_optimization",
          "exclusions",
          "enforcement",
          "updated_at"
        ]
      },
      "PutCdnSettingsRequest": {
        "type": "object",
        "properties": {
          "image_optimization": {
            "type": "string",
            "enum": [
              "off",
              "lossless",
              "lossy"
            ]
          },
          "exclusions": {
            "type": "object",
            "properties": {
              "paths": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 200
                },
                "maxItems": 50
              },
              "urls": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    {
                      "type": "string",
                      "format": "uri",
                      "maxLength": 500
                    }
                  ]
                },
                "maxItems": 50
              },
              "extensions": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "7z",
                    "avi",
                    "avif",
                    "apk",
                    "bin",
                    "bmp",
                    "bz2",
                    "class",
                    "css",
                    "csv",
                    "doc",
                    "docx",
                    "dmg",
                    "ejs",
                    "eot",
                    "eps",
                    "exe",
                    "flac",
                    "gif",
                    "gz",
                    "ico",
                    "iso",
                    "jar",
                    "jpg",
                    "jpeg",
                    "js",
                    "mid",
                    "midi",
                    "mkv",
                    "mp3",
                    "mp4",
                    "ogg",
                    "otf",
                    "pdf",
                    "pict",
                    "pls",
                    "png",
                    "ppt",
                    "pptx",
                    "ps",
                    "rar",
                    "svg",
                    "svgz",
                    "swf",
                    "tar",
                    "tif",
                    "tiff",
                    "ttf",
                    "webm",
                    "webp",
                    "woff",
                    "woff2",
                    "xls",
                    "xlsx",
                    "zip",
                    "zst"
                  ]
                },
                "maxItems": 56
              }
            }
          }
        }
      },
      "EdgeSettings": {
        "type": "object",
        "properties": {
          "force_https_mode": {
            "type": "string",
            "enum": [
              "off",
              "all_hostnames",
              "primary_only"
            ]
          },
          "geolocation": {
            "type": "boolean",
            "description": "Geolocation: PHP gets the visitor's country on every page, and cached pages vary by country. City, region, postal code, coordinates, and time zone reach only pages that are never cached."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "enforcement": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "pending",
                  "applied",
                  "failed",
                  "never"
                ]
              },
              "origin_applied": {
                "type": "boolean"
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "image_optimization": {
                "type": "string",
                "enum": [
                  "off",
                  "lossless",
                  "lossy"
                ],
                "description": "The image optimization mode the web server held after that job. It differs from the saved mode while the server cannot take it yet. Left out when the job did not report it."
              },
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "UUIDv7"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "state",
              "origin_applied",
              "notes",
              "job_id",
              "updated_at"
            ],
            "description": "The last `apply_edge_settings` job (see `edgeEnforcement`)."
          }
        },
        "required": [
          "force_https_mode",
          "geolocation",
          "updated_at"
        ]
      },
      "PutEdgeSettingsRequest": {
        "type": "object",
        "properties": {
          "force_https_mode": {
            "type": "string",
            "enum": [
              "off",
              "all_hostnames",
              "primary_only"
            ]
          },
          "geolocation": {
            "type": "boolean"
          }
        }
      },
      "PutMobileCacheRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "Mobile cache: keep a separate page cache for mobile devices, on the server and at the edge. Turning it on or off clears the site's caches."
      },
      "RedirectRule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "source": {
            "type": "string"
          },
          "destination": {
            "type": "string"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "number",
                "const": 301
              },
              {
                "type": "number",
                "const": 302
              }
            ]
          },
          "is_regex": {
            "type": "boolean"
          },
          "domain_scope": {
            "type": [
              "string",
              "null"
            ],
            "description": "A hostname, or null for every hostname of the environment."
          },
          "position": {
            "type": "integer",
            "minimum": 0
          },
          "enabled": {
            "type": "boolean"
          },
          "hits_30d": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "environment_id",
          "source",
          "destination",
          "status_code",
          "is_regex",
          "domain_scope",
          "position",
          "enabled",
          "hits_30d",
          "created_at",
          "updated_at"
        ]
      },
      "RedirectList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RedirectRule"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "enforcement": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "edge",
                  "server",
                  "edge_and_server",
                  "pending",
                  "failed",
                  "off"
                ]
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The last apply job, or null when nothing was applied yet."
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "state",
              "notes",
              "job_id",
              "updated_at"
            ]
          },
          "redirects_enabled": {
            "type": "boolean",
            "description": "False when the environment's redirects are switched off: the rules stay saved, but the web server runs none of them. Every response sets it."
          }
        },
        "required": [
          "data"
        ]
      },
      "CreateRedirectRequest": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "destination": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "status_code": {
            "anyOf": [
              {
                "type": "number",
                "const": 301
              },
              {
                "type": "number",
                "const": 302
              }
            ],
            "default": 301
          },
          "is_regex": {
            "type": "boolean",
            "default": false
          },
          "domain_scope": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 253,
            "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$",
            "default": null
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "description": "Insert here. Defaults to the end of the list."
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "source",
          "destination"
        ]
      },
      "PutRedirectRequest": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "destination": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "status_code": {
            "anyOf": [
              {
                "type": "number",
                "const": 301
              },
              {
                "type": "number",
                "const": 302
              }
            ],
            "default": 301
          },
          "is_regex": {
            "type": "boolean",
            "default": false
          },
          "domain_scope": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 253,
            "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$",
            "default": null
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "description": "Insert here. Defaults to the end of the list."
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "source",
          "destination"
        ]
      },
      "PutRedirectsEnabledRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "Switches every redirect rule of the environment on or off without deleting any. Reversible, so no confirm. The `apply_redirects` job writes the rules, or none, into the web server."
      },
      "RedirectImportRequest": {
        "type": "object",
        "properties": {
          "csv": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1048576,
            "description": "CSV with the columns source, destination, status_code, is_regex, domain_scope."
          },
          "dry_run": {
            "type": "boolean",
            "default": true,
            "description": "Preview the rules without saving. Defaults to true."
          }
        },
        "required": [
          "csv"
        ]
      },
      "RedirectImportResult": {
        "type": "object",
        "properties": {
          "dry_run": {
            "type": "boolean"
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateRedirectRequest"
            }
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "line": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "line",
                "message"
              ]
            }
          },
          "saved": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "dry_run",
          "rules",
          "problems",
          "saved"
        ]
      },
      "RedirectTestRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "description": "A path such as `/old/page` or a full URL."
          }
        },
        "required": [
          "url"
        ]
      },
      "RedirectTestResult": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "matched": {
            "type": "boolean"
          },
          "hops": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rule_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "from": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                },
                "status_code": {
                  "anyOf": [
                    {
                      "type": "number",
                      "const": 301
                    },
                    {
                      "type": "number",
                      "const": 302
                    }
                  ]
                }
              },
              "required": [
                "rule_id",
                "from",
                "to",
                "status_code"
              ]
            }
          },
          "final_url": {
            "type": "string"
          },
          "loop": {
            "type": "boolean",
            "description": "True when the rules send the URL around in a circle, or past 10 hops."
          }
        },
        "required": [
          "url",
          "matched",
          "hops",
          "final_url",
          "loop"
        ]
      },
      "IpRule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "cidr": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "deny",
              "allow"
            ]
          },
          "note": {
            "type": "string"
          },
          "applied_edge": {
            "type": "boolean"
          },
          "applied_origin": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "environment_id",
          "cidr",
          "action",
          "note",
          "applied_edge",
          "applied_origin",
          "created_at"
        ]
      },
      "IpRuleList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IpRule"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "your_ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "The caller's current IP, for \"add my current IP\"."
          },
          "enforcement": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "edge",
                  "server",
                  "edge_and_server",
                  "pending",
                  "failed",
                  "off"
                ]
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The last apply job, or null when nothing was applied yet."
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "state",
              "notes",
              "job_id",
              "updated_at"
            ]
          },
          "ip_deny_enabled": {
            "type": "boolean",
            "description": "False when the environment's IP deny is switched off: the rules stay saved, but neither Cloudflare nor the web server blocks anyone from the list. Every response sets it."
          }
        },
        "required": [
          "data",
          "your_ip"
        ]
      },
      "CreateIpRuleRequest": {
        "type": "object",
        "properties": {
          "cidr": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "deny",
              "allow"
            ],
            "default": "deny"
          },
          "note": {
            "type": "string",
            "maxLength": 200,
            "default": ""
          },
          "allow_self_lockout": {
            "type": "boolean",
            "default": false,
            "description": "WP Waterfall refuses to block the IP you are calling from unless you set this."
          }
        },
        "required": [
          "cidr"
        ]
      },
      "PutIpRulesRequest": {
        "type": "object",
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "cidr": {
                  "type": "string"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "deny",
                    "allow"
                  ],
                  "default": "deny"
                },
                "note": {
                  "type": "string",
                  "maxLength": 200,
                  "default": ""
                }
              },
              "required": [
                "cidr"
              ]
            },
            "maxItems": 1000
          },
          "allow_self_lockout": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "rules"
        ]
      },
      "PutIpDenyEnabledRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "Switches every IP rule of the environment on or off without deleting any. Reversible, so no confirm. The `apply_ip_rules` job writes the rules, or none, to the edge and the web server."
      },
      "BotProtection": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "off",
              "monitor",
              "challenge",
              "block"
            ],
            "description": "Legacy: off, challenge, or block, derived from `enabled` and `level`."
          },
          "enabled": {
            "type": "boolean",
            "description": "False when the owner turned bot protection off. The always-on baseline still runs."
          },
          "level": {
            "type": "string",
            "enum": [
              "block_malicious",
              "block_automations",
              "challenge_bots",
              "challenge_non_browsers",
              "challenge_everyone"
            ]
          },
          "matrix_key": {
            "type": "string",
            "description": "Which version of `BOT_LEVELS` the levels follow."
          },
          "allow_verified": {
            "type": "boolean",
            "description": "Verified crawlers (search engines, uptime monitors) always pass."
          },
          "exclusions": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "pattern": "^\\/[^\\s?#]*$"
            },
            "description": "Paths that skip bot checks, such as webhooks."
          },
          "allowlist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IPs and ranges that skip bot checks."
          },
          "block_ai_crawlers": {
            "type": "boolean",
            "description": "Refuse AI training and AI search crawlers at the edge (no Cloudflare rule)."
          },
          "user_agent_allowlist": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9 ._/-]+$"
            },
            "description": "User agent fragments that skip bot checks and the AI crawler block, such as a monitor."
          },
          "rule_expression": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Cloudflare rule expression WP Waterfall writes for this mode."
          },
          "applied": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "fixed": {
            "type": "boolean",
            "description": "True on staging, preview, and preview environments. They always refuse crawlers and bots at the edge and on the server; the setting cannot be changed there, and live's setting does not apply to them."
          },
          "enforcement": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "edge",
                  "server",
                  "edge_and_server",
                  "pending",
                  "failed",
                  "off"
                ]
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The last apply job, or null when nothing was applied yet."
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "state",
              "notes",
              "job_id",
              "updated_at"
            ]
          },
          "stats": {
            "$ref": "#/components/schemas/BotStats"
          }
        },
        "required": [
          "mode",
          "enabled",
          "level",
          "matrix_key",
          "allow_verified",
          "exclusions",
          "allowlist",
          "block_ai_crawlers",
          "user_agent_allowlist",
          "rule_expression",
          "applied",
          "updated_at"
        ]
      },
      "PutBotProtectionRequest": {
        "type": "object",
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "block_malicious",
              "block_automations",
              "challenge_bots",
              "challenge_non_browsers",
              "challenge_everyone"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "mode": {
            "type": "string",
            "enum": [
              "off",
              "monitor",
              "challenge",
              "block"
            ]
          },
          "allow_verified": {
            "type": "boolean"
          },
          "exclusions": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "pattern": "^\\/[^\\s?#]*$"
            },
            "maxItems": 100
          },
          "allowlist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 100
          },
          "block_ai_crawlers": {
            "type": "boolean"
          },
          "user_agent_allowlist": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9 ._/-]+$"
            },
            "maxItems": 20
          }
        },
        "description": "Change bot protection. Send `level`, `enabled`, or both; a field left out keeps its value. Older clients may send `mode` instead: off and monitor turn protection off, challenge means Challenge bots, and block means Block automations."
      },
      "BotStats": {
        "type": "object",
        "properties": {
          "window": {
            "type": "string",
            "const": "24h"
          },
          "available": {
            "type": "boolean",
            "description": "True when Cloudflare reports security events for this environment's hostnames. False when the token lacks analytics access or the zone's plan cannot filter by hostname; the counts are zero then and `note` says why."
          },
          "requests": {
            "type": "integer",
            "minimum": 0
          },
          "challenged": {
            "type": "integer",
            "minimum": 0
          },
          "blocked": {
            "type": "integer",
            "minimum": 0
          },
          "verified_allowed": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Null when the zone has no Cloudflare Bot Management, which verified bot counts need."
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "window",
          "available",
          "requests",
          "challenged",
          "blocked",
          "verified_allowed",
          "note"
        ]
      },
      "BotBreakdown": {
        "type": "object",
        "properties": {
          "window": {
            "type": "string",
            "const": "24h"
          },
          "available": {
            "type": "boolean"
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Every request Cloudflare saw for the environment's hostnames."
          },
          "classes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "enum": [
                    "browsers",
                    "named_bots",
                    "unclassified"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "count": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "percent": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100
                }
              },
              "required": [
                "id",
                "label",
                "count",
                "percent"
              ]
            },
            "description": "Requests by the user agent name Cloudflare reports. The three add up to `total`."
          },
          "outcomes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "enum": [
                    "allowed",
                    "challenged",
                    "blocked"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "count": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "percent": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100
                }
              },
              "required": [
                "id",
                "label",
                "count",
                "percent"
              ]
            },
            "description": "Requests by what Cloudflare answered. The three add up to `total` when all are counted."
          },
          "note": {
            "type": "string",
            "description": "Plain words on what is measured and what is not."
          }
        },
        "required": [
          "window",
          "available",
          "total",
          "classes",
          "outcomes",
          "note"
        ]
      },
      "AnalyticsResult": {
        "type": "object",
        "properties": {
          "view": {
            "type": "string",
            "enum": [
              "visits",
              "visits-dispersion",
              "bandwidth",
              "cdn-bandwidth",
              "edge-cache-bandwidth",
              "disk-space",
              "response-codes",
              "top-countries",
              "top-asns",
              "top-hosts",
              "top-referrers",
              "top-browsers",
              "page-views",
              "requests",
              "top-requests",
              "top-paths-bytes",
              "top-cities",
              "top-user-agents",
              "top-client-ips",
              "device-series",
              "bot-classes",
              "bot-results",
              "top-traffic-paths",
              "top-traffic-user-agents",
              "top-traffic-countries",
              "top-traffic-ips",
              "redirect-series",
              "client-error-series",
              "server-error-series",
              "status-codes",
              "top-404",
              "top-cached-paths",
              "top-bypassed-paths",
              "php-throughput",
              "php-share",
              "cache-status",
              "response-time",
              "bot-traffic",
              "cache-series",
              "response-series",
              "cache-breakdown"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "environment",
              "company"
            ]
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "time_span": {
            "type": "string",
            "enum": [
              "hour",
              "day",
              "week",
              "month"
            ]
          },
          "unit": {
            "type": "string",
            "enum": [
              "count",
              "bytes",
              "percent",
              "ms"
            ]
          },
          "total": {
            "type": "number"
          },
          "available": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "permission_needed",
              "not_configured",
              "not_on_plan"
            ],
            "description": "Why a figure is missing, when it is: `permission_needed` means Cloudflare refused the platform token (it needs Zone > Analytics > Read), `not_configured` means no Cloudflare token is set, and `not_on_plan` means the zone's plan does not offer the field. Absent when the view has numbers or the reason is something else."
          },
          "query_version": {
            "type": "string",
            "description": "Versions the counting rules, such as `visits-v2-node` for node visits."
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "bucket": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "Start of the bucket (ISO 8601) for a series, null for a top list."
                },
                "key": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The dimension value, such as a country code, host, or client IP. Null for a total series."
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number"
                },
                "share": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Share of the total, 0 to 1. Null when the total is zero."
                },
                "bytes": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Bytes sent for the row, on top lists that know them (top requests, countries)."
                },
                "requests": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Requests for the row, on top lists that rank by something else (paths ranked by bytes carry the bytes in `value`). Absent on series and on lists with no request count."
                }
              },
              "required": [
                "bucket",
                "key",
                "label",
                "value",
                "share"
              ]
            }
          }
        },
        "required": [
          "view",
          "scope",
          "environment_id",
          "from",
          "to",
          "time_span",
          "unit",
          "total",
          "available",
          "note",
          "query_version",
          "rows"
        ]
      },
      "ApmStatus": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "enabled": {
            "type": "boolean",
            "description": "True while APM is collecting (a `set_apm` window is running, or always on). Starting and stopping a collection is `PUT /v1/environments/{id}/monitor`. Whether the APM tool is on, which only shows the APM tab, is `tool_enabled`."
          },
          "tool_enabled": {
            "type": "boolean",
            "default": false,
            "description": "True while the APM tool is on in Tools: the APM tab shows and a collection can start."
          },
          "mode": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "window_2h",
              "window_4h",
              "window_12h",
              "window_24h",
              "always_on"
            ]
          },
          "sample_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "retention_days": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "available": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "changed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a window mode turns APM off. Null for always on or when off."
          },
          "last_data_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The newest minute of APM data stored. Null when nothing was ever collected."
          }
        },
        "required": [
          "environment_id",
          "enabled",
          "tool_enabled",
          "mode",
          "sample_rate",
          "retention_days",
          "available",
          "note",
          "changed_at"
        ]
      },
      "PutApmRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "mode": {
            "type": "string",
            "enum": [
              "window_2h",
              "window_4h",
              "window_12h",
              "window_24h",
              "always_on"
            ],
            "default": "window_2h"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "Starts or stops collecting. `enabled: true` with a window `mode` starts a collection that ends by itself (or runs always on, sampled). `enabled: false` stops it now. Starting with the APM tool off turns the tool on first, so an older client that only knew this call keeps working."
      },
      "PutApmToolRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "The APM tool in Tools: only shows or hides the APM tab. It holds no duration. Turning it off while a collection runs stops the collection first (a `set_apm` job)."
      },
      "ApmToolResult": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "tool_enabled": {
            "type": "boolean"
          },
          "stopped_collection_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The `set_apm` job that stopped a running collection. Null when none was running."
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "environment_id",
          "tool_enabled",
          "stopped_collection_job_id",
          "message"
        ],
        "description": "The answer to `PUT /v1/environments/{id}/tools/monitor`."
      },
      "ApmOverview": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_data_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "bucket_seconds": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "totals": {
            "type": "object",
            "properties": {
              "requests": {
                "type": "integer",
                "minimum": 0
              },
              "errors": {
                "type": "integer",
                "minimum": 0
              },
              "client_errors": {
                "type": "integer",
                "minimum": 0
              },
              "error_rate": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 1,
                "description": "5xx share of requests, 0 to 1. Null with no requests."
              },
              "throughput_per_min": {
                "type": "number",
                "minimum": 0,
                "description": "Requests a minute over the window."
              },
              "avg_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "p95_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "description": "About: read from a response time histogram, so it is the upper edge of a bucket."
              },
              "max_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "cache_hit_ratio": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 1,
                "description": "Page cache hits over all requests, 0 to 1."
              },
              "php_requests": {
                "type": "integer",
                "minimum": 0,
                "description": "Requests that reached PHP."
              },
              "db_queries_avg": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "ext_calls_avg": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "breakdown": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "php_ms": {
                    "type": "number",
                    "minimum": 0,
                    "description": "PHP time outside the database and outside calls."
                  },
                  "db_ms": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Database (MySQL) time. Null when no request in the window reported it."
                  },
                  "ext_ms": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Outside HTTP calls. Null when no request reported it."
                  },
                  "other_ms": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Nginx, the network to the visitor, and cached responses."
                  }
                },
                "required": [
                  "php_ms",
                  "db_ms",
                  "ext_ms",
                  "other_ms"
                ]
              },
              "total_ms": {
                "type": "number",
                "minimum": 0,
                "description": "Sums of time over the window, for the chart legend."
              },
              "php_total_ms": {
                "type": "number",
                "minimum": 0
              },
              "db_total_ms": {
                "type": "number",
                "minimum": 0
              },
              "ext_total_ms": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "requests",
              "errors",
              "client_errors",
              "error_rate",
              "throughput_per_min",
              "avg_ms",
              "p95_ms",
              "max_ms",
              "cache_hit_ratio",
              "php_requests",
              "db_queries_avg",
              "ext_calls_avg",
              "breakdown",
              "total_ms",
              "php_total_ms",
              "db_total_ms",
              "ext_total_ms"
            ]
          },
          "slowest": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "avg_ms": {
                "type": "number",
                "minimum": 0
              },
              "max_ms": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "name",
              "avg_ms",
              "max_ms"
            ]
          },
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "requests": {
                  "type": "integer",
                  "minimum": 0
                },
                "errors": {
                  "type": "integer",
                  "minimum": 0
                },
                "avg_ms": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "php_ms": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Sums of time in the bucket."
                },
                "db_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "ext_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "other_ms": {
                  "type": "number",
                  "minimum": 0
                }
              },
              "required": [
                "at",
                "requests",
                "errors",
                "avg_ms",
                "php_ms",
                "db_ms",
                "ext_ms",
                "other_ms"
              ]
            }
          }
        },
        "required": [
          "environment_id",
          "from",
          "to",
          "enabled",
          "available",
          "note",
          "last_data_at",
          "bucket_seconds",
          "totals",
          "slowest",
          "series"
        ]
      },
      "ApmUrlList": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_data_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "total_rows": {
            "type": "integer",
            "minimum": 0,
            "description": "Rows that match before the limit."
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The URL group, such as `/wp-admin/admin-ajax.php` or `/product/:id/`."
                },
                "count": {
                  "type": "integer",
                  "minimum": 0
                },
                "errors": {
                  "type": "integer",
                  "minimum": 0
                },
                "client_errors": {
                  "type": "integer",
                  "minimum": 0
                },
                "error_rate": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "rate_per_min": {
                  "type": "number",
                  "minimum": 0
                },
                "total_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "share": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Share of all time spent in the window, 0 to 1 (Kinsta's \"Total duration (%)\")."
                },
                "avg_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "p95_ms": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "max_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "cache_hit_ratio": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "db_queries_avg": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "mem_peak_kb": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "breakdown": {
                  "type": "object",
                  "properties": {
                    "php_ms": {
                      "type": "number",
                      "minimum": 0,
                      "description": "PHP time outside the database and outside calls."
                    },
                    "db_ms": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Database (MySQL) time. Null when no request in the window reported it."
                    },
                    "ext_ms": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Outside HTTP calls. Null when no request reported it."
                    },
                    "other_ms": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Nginx, the network to the visitor, and cached responses."
                    }
                  },
                  "required": [
                    "php_ms",
                    "db_ms",
                    "ext_ms",
                    "other_ms"
                  ]
                }
              },
              "required": [
                "name",
                "count",
                "errors",
                "client_errors",
                "error_rate",
                "rate_per_min",
                "total_ms",
                "share",
                "avg_ms",
                "p95_ms",
                "max_ms",
                "cache_hit_ratio",
                "db_queries_avg",
                "mem_peak_kb",
                "breakdown"
              ]
            }
          }
        },
        "required": [
          "environment_id",
          "from",
          "to",
          "enabled",
          "available",
          "note",
          "last_data_at",
          "total_rows",
          "data"
        ]
      },
      "ApmUrlDetail": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_data_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "bucket_seconds": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "row": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "The URL group, such as `/wp-admin/admin-ajax.php` or `/product/:id/`."
              },
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "errors": {
                "type": "integer",
                "minimum": 0
              },
              "client_errors": {
                "type": "integer",
                "minimum": 0
              },
              "error_rate": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "rate_per_min": {
                "type": "number",
                "minimum": 0
              },
              "total_ms": {
                "type": "number",
                "minimum": 0
              },
              "share": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 1,
                "description": "Share of all time spent in the window, 0 to 1 (Kinsta's \"Total duration (%)\")."
              },
              "avg_ms": {
                "type": "number",
                "minimum": 0
              },
              "p95_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "max_ms": {
                "type": "number",
                "minimum": 0
              },
              "cache_hit_ratio": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "db_queries_avg": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "mem_peak_kb": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "breakdown": {
                "type": "object",
                "properties": {
                  "php_ms": {
                    "type": "number",
                    "minimum": 0,
                    "description": "PHP time outside the database and outside calls."
                  },
                  "db_ms": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Database (MySQL) time. Null when no request in the window reported it."
                  },
                  "ext_ms": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Outside HTTP calls. Null when no request reported it."
                  },
                  "other_ms": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Nginx, the network to the visitor, and cached responses."
                  }
                },
                "required": [
                  "php_ms",
                  "db_ms",
                  "ext_ms",
                  "other_ms"
                ]
              }
            },
            "required": [
              "name",
              "count",
              "errors",
              "client_errors",
              "error_rate",
              "rate_per_min",
              "total_ms",
              "share",
              "avg_ms",
              "p95_ms",
              "max_ms",
              "cache_hit_ratio",
              "db_queries_avg",
              "mem_peak_kb",
              "breakdown"
            ],
            "description": "Null when the group has no requests in the window."
          },
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "requests": {
                  "type": "integer",
                  "minimum": 0
                },
                "errors": {
                  "type": "integer",
                  "minimum": 0
                },
                "avg_ms": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "php_ms": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Sums of time in the bucket."
                },
                "db_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "ext_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "other_ms": {
                  "type": "number",
                  "minimum": 0
                }
              },
              "required": [
                "at",
                "requests",
                "errors",
                "avg_ms",
                "php_ms",
                "db_ms",
                "ext_ms",
                "other_ms"
              ]
            }
          },
          "samples": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 64,
                  "description": "The request id (Nginx `$request_id`), when the node kept it."
                },
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "method": {
                  "type": "string",
                  "maxLength": 12
                },
                "path": {
                  "type": "string",
                  "maxLength": 512
                },
                "status": {
                  "type": "integer",
                  "minimum": 100,
                  "maximum": 599
                },
                "total_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "php_ms": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "db_ms": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "db_queries": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "ext_ms": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "ext_calls": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "mem_kb": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "cache": {
                  "type": "string",
                  "maxLength": 16
                },
                "spans": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 999
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "hook",
                          "query",
                          "external",
                          "redis"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      "start_ms": {
                        "type": "number",
                        "minimum": 0
                      },
                      "duration_ms": {
                        "type": "number",
                        "minimum": 0
                      },
                      "plugin": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 100
                      },
                      "method": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 12,
                        "description": "HTTP method of an outside call."
                      },
                      "status": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 599,
                        "description": "HTTP status of an outside call. Null when it failed before an answer."
                      },
                      "stack": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "maxItems": 10,
                        "default": []
                      }
                    },
                    "required": [
                      "id",
                      "kind",
                      "name",
                      "start_ms",
                      "duration_ms",
                      "stack"
                    ]
                  },
                  "maxItems": 40
                }
              },
              "required": [
                "at",
                "method",
                "path",
                "status",
                "total_ms",
                "php_ms",
                "db_ms",
                "db_queries",
                "ext_ms",
                "ext_calls",
                "mem_kb",
                "cache"
              ]
            },
            "description": "The slowest requests of the window, slowest first."
          },
          "histogram": {
            "type": "object",
            "properties": {
              "edges_ms": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "counts": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "required": [
              "edges_ms",
              "counts"
            ]
          }
        },
        "required": [
          "environment_id",
          "from",
          "to",
          "enabled",
          "available",
          "note",
          "last_data_at",
          "name",
          "bucket_seconds",
          "row",
          "series",
          "samples",
          "histogram"
        ]
      },
      "ApmSpans": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_data_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "by": {
            "type": "string",
            "enum": [
              "plugin",
              "hook",
              "query",
              "external",
              "redis"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "totals",
              "slow_requests",
              "none"
            ]
          },
          "considered": {
            "type": "object",
            "properties": {
              "requests": {
                "type": "integer",
                "minimum": 0,
                "description": "Slow requests read, from the 25 transactions that took the most time."
              },
              "with_spans": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those, the ones that carry spans. Zero means the node reports no spans yet."
              }
            },
            "required": [
              "requests",
              "with_spans"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The plugin folder, hook, SQL, or outside URL. A plugin row for WordPress core is `core`."
                },
                "plugin": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The owner of the code, for every table but plugins. Null for WordPress core."
                },
                "method": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The HTTP method of an outside call, else null."
                },
                "calls": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Spans seen across the requests considered."
                },
                "requests": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Requests that held at least one such span. Null for a row from totals, which count calls only."
                },
                "total_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "share": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Share of all span time in this table, 0 to 1 (Kinsta's \"Total duration (%)\")."
                },
                "avg_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "max_ms": {
                  "type": "number",
                  "minimum": 0
                },
                "rate_per_min": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Calls a minute over the window (Kinsta's \"Rate Per Min.\")."
                },
                "transactions": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 3,
                  "description": "Up to 3 URL groups that held it, the one with the most time first."
                },
                "refs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "group": {
                        "type": "string",
                        "description": "The URL group of the request."
                      },
                      "at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "duration_ms": {
                        "type": "number",
                        "minimum": 0,
                        "description": "The time of this span in that request."
                      }
                    },
                    "required": [
                      "group",
                      "at",
                      "duration_ms"
                    ]
                  },
                  "maxItems": 3,
                  "description": "Up to 3 requests that held it, the slowest span first."
                }
              },
              "required": [
                "name",
                "plugin",
                "method",
                "calls",
                "requests",
                "total_ms",
                "share",
                "avg_ms",
                "max_ms",
                "rate_per_min",
                "transactions",
                "refs"
              ]
            }
          }
        },
        "required": [
          "environment_id",
          "from",
          "to",
          "enabled",
          "available",
          "note",
          "last_data_at",
          "by",
          "source",
          "considered",
          "data"
        ],
        "description": "The span tables. `source` says where the numbers come from: - `totals`: the span totals the node sums over every PHP request of each minute. Rows have no `transactions` or `refs`, and `requests` is null. - `slow_requests`: the spans of the slowest requests the node kept, for a node that sends no totals. Those numbers are about slow requests only, and `considered` says how many. - `none`: nothing collected for this table in the window."
      },
      "PhpEngine": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "enum": [
              "8.1",
              "8.2",
              "8.3",
              "8.4",
              "8.5"
            ]
          },
          "available_versions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "8.1",
                "8.2",
                "8.3",
                "8.4",
                "8.5"
              ]
            }
          },
          "tier": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "threads": {
                "type": "integer",
                "minimum": 0
              },
              "pool_mb": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "key",
              "threads",
              "pool_mb"
            ]
          },
          "pool": {
            "type": "object",
            "properties": {
              "pm": {
                "type": "string"
              },
              "max_children": {
                "type": "integer",
                "minimum": 0
              },
              "start_servers": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "min_spare_servers": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "max_spare_servers": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "process_idle_timeout_s": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "max_requests": {
                "type": "integer",
                "minimum": 0
              },
              "request_terminate_timeout_s": {
                "type": "integer",
                "minimum": 0
              },
              "slowlog_timeout_s": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              }
            },
            "required": [
              "pm",
              "max_children",
              "start_servers",
              "min_spare_servers",
              "max_spare_servers",
              "process_idle_timeout_s",
              "max_requests",
              "request_terminate_timeout_s",
              "slowlog_timeout_s"
            ]
          },
          "ini": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Effective values: the image ini, then the pool file on top."
          },
          "opcache": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "memory_mb": {
                "type": "integer",
                "minimum": 0
              },
              "interned_strings_mb": {
                "type": "integer",
                "minimum": 0
              },
              "max_accelerated_files": {
                "type": "integer",
                "minimum": 0
              },
              "validate_timestamps": {
                "type": "boolean"
              },
              "jit": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "enabled",
              "memory_mb",
              "interned_strings_mb",
              "max_accelerated_files",
              "validate_timestamps",
              "jit"
            ]
          },
          "status": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "process_manager": {
                "type": "string"
              },
              "start_since_s": {
                "type": "integer",
                "minimum": 0
              },
              "accepted_conn": {
                "type": "integer",
                "minimum": 0
              },
              "listen_queue": {
                "type": "integer",
                "minimum": 0
              },
              "max_listen_queue": {
                "type": "integer",
                "minimum": 0
              },
              "idle": {
                "type": "integer",
                "minimum": 0
              },
              "active": {
                "type": "integer",
                "minimum": 0
              },
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "max_active": {
                "type": "integer",
                "minimum": 0
              },
              "max_children_reached": {
                "type": "integer",
                "minimum": 0
              },
              "slow_requests": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "process_manager",
              "start_since_s",
              "accepted_conn",
              "listen_queue",
              "max_listen_queue",
              "idle",
              "active",
              "total",
              "max_active",
              "max_children_reached",
              "slow_requests"
            ],
            "description": "The live PHP-FPM status page. Null when it did not answer."
          },
          "watchdog": {
            "type": "object",
            "properties": {
              "health": {
                "type": "string",
                "enum": [
                  "ok",
                  "degraded",
                  "restarting"
                ]
              },
              "restarts_24h": {
                "type": "integer",
                "minimum": 0
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "kind": {
                      "type": "string",
                      "const": "php_pool_restarted"
                    },
                    "cause": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    },
                    "slow_requests": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "culprit": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "restarts_24h": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "at",
                    "kind",
                    "cause",
                    "detail",
                    "slow_requests",
                    "culprit",
                    "restarts_24h"
                  ]
                }
              }
            },
            "required": [
              "health",
              "restarts_24h",
              "events"
            ]
          },
          "read_at": {
            "type": "string",
            "format": "date-time"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "recorded_version": {
            "type": "string",
            "description": "The PHP version the control plane has on record. It differs from `version` mid-change."
          }
        },
        "required": [
          "version",
          "available_versions",
          "tier",
          "pool",
          "ini",
          "opcache",
          "status",
          "watchdog",
          "read_at",
          "environment_id",
          "recorded_version"
        ]
      },
      "CacheStats": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "available": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "requests": {
            "type": "integer",
            "minimum": 0
          },
          "edge_hits": {
            "type": "integer",
            "minimum": 0
          },
          "server_hits": {
            "type": "integer",
            "minimum": 0
          },
          "misses": {
            "type": "integer",
            "minimum": 0
          },
          "bypass": {
            "type": "integer",
            "minimum": 0
          },
          "hit_ratio": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1,
            "description": "Edge and server hits over all cacheable requests, 0 to 1. Null when there are none."
          }
        },
        "required": [
          "environment_id",
          "from",
          "to",
          "available",
          "note",
          "requests",
          "edge_hits",
          "server_hits",
          "misses",
          "bypass",
          "hit_ratio"
        ]
      },
      "AutoloadSize": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "total_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Bytes of autoloaded option values, for the main site of the environment."
          },
          "options": {
            "type": "integer",
            "minimum": 0,
            "description": "How many options load on every request."
          },
          "largest": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "maxLength": 300
                },
                "bytes": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "name",
                "bytes"
              ]
            },
            "maxItems": 5,
            "description": "The five largest autoloaded options, biggest first. Names and sizes only."
          },
          "threshold_bytes": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "over": {
            "type": "boolean",
            "description": "True when `total_bytes` is over `threshold_bytes`."
          },
          "measured_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "environment_id",
          "total_bytes",
          "options",
          "largest",
          "threshold_bytes",
          "over",
          "measured_at"
        ]
      },
      "CachePurgeSchedule": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "off",
              "daily",
              "weekly"
            ]
          },
          "hour_utc": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23,
            "description": "The hour of the day in UTC, 0 to 23."
          },
          "weekday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6,
            "description": "The day of the week for a weekly schedule: 0 is Sunday."
          },
          "last_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next purge runs. Null while the schedule is off."
          }
        },
        "required": [
          "environment_id",
          "frequency",
          "hour_utc",
          "weekday",
          "last_run_at",
          "next_run_at"
        ]
      },
      "PutCachePurgeScheduleRequest": {
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "enum": [
              "off",
              "daily",
              "weekly"
            ]
          },
          "hour_utc": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23,
            "default": 3
          },
          "weekday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6,
            "default": 0
          }
        },
        "required": [
          "frequency"
        ]
      },
      "PurgeHistory": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "job_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "status": {
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "urls": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "requested_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "finished_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "requested_by": {
                  "type": "string"
                }
              },
              "required": [
                "job_id",
                "status",
                "scope",
                "urls",
                "tags",
                "requested_at",
                "finished_at",
                "requested_by"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "PushRequest": {
        "type": "object",
        "properties": {
          "target_env_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "tables": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "type": "string",
                "const": "none"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_]+$"
                },
                "minItems": 1,
                "maxItems": 500
              }
            ],
            "default": "all"
          },
          "uploads": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "type": "string",
                "const": "none"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "minItems": 1,
                "maxItems": 500
              }
            ],
            "default": "all"
          },
          "search_replace": {
            "type": "boolean",
            "default": true,
            "description": "Replace the source hostname with the target's primary hostname in the database."
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "target_env_id",
          "confirm"
        ],
        "description": "Pushes content from the environment in the path to `target_env_id`. Code never moves by push: the body has no file list. Target-only settings (domains, Nginx rules, PHP settings, host keys) never move either."
      },
      "UndoPushRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "confirm"
        ]
      },
      "CommitRequest": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "paths": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "minItems": 1,
            "maxItems": 1000,
            "default": null,
            "description": "Limit the commit to these paths. Null commits every change."
          }
        },
        "required": [
          "message"
        ],
        "description": "Commits the uncommitted code of a classic (SFTP-writable) preview environment to its branch. Only environments in SFTP mode have anything to commit."
      },
      "WorkingTreeStatus": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "branch": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
          },
          "base_sha": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{40}$",
            "description": "The commit the working tree runs: where it was copied from or last committed or pulled."
          },
          "head_sha": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{40}$",
            "description": "The head of the branch now."
          },
          "behind": {
            "type": "boolean"
          },
          "clean": {
            "type": "boolean"
          },
          "added": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "modified": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "deleted": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "blocked": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "environment_id",
          "branch",
          "base_sha",
          "head_sha",
          "behind",
          "clean",
          "added",
          "modified",
          "deleted",
          "blocked",
          "truncated"
        ],
        "description": "The uncommitted changes of a staging or preview working tree, against the commit it runs. Paths are relative to the site root. `blocked` lists changed files that look like secrets (wp-config.php,.env, private keys), which a commit leaves out. `behind` is true when the branch has commits the working tree has not pulled yet (a push or a merge)."
      },
      "WorkingTreeDiff": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "branch": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
          },
          "base_sha": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{40}$"
          },
          "head_sha": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{40}$"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "maxLength": 1000
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "added",
                    "modified",
                    "deleted"
                  ]
                },
                "binary": {
                  "type": "boolean"
                },
                "additions": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Lines added and removed. Null for a binary file."
                },
                "deletions": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "patch": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The unified diff of this file. Null for a binary file."
                },
                "truncated": {
                  "type": "boolean",
                  "description": "True when `patch` was cut at the byte limit."
                }
              },
              "required": [
                "path",
                "status",
                "binary",
                "additions",
                "deletions",
                "patch",
                "truncated"
              ]
            },
            "maxItems": 200
          },
          "total_files": {
            "type": "integer",
            "minimum": 0,
            "description": "Changed files in all, including the ones past the limit."
          },
          "omitted_files": {
            "type": "integer",
            "minimum": 0
          },
          "blocked": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "environment_id",
          "branch",
          "base_sha",
          "head_sha",
          "files",
          "total_files",
          "omitted_files",
          "blocked"
        ],
        "description": "The line by line diff of a working tree against the commit it runs, for the step before Commit changes. At most `WORKING_TREE_DIFF_MAX_FILES` files carry a patch, and `omitted_files` counts the rest. `blocked` names the changed files a commit leaves out because they look like secrets; their content is never read."
      },
      "SyncWorkingTreeRequest": {
        "type": "object",
        "properties": {
          "commit_message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "description": "Brings a working tree up to the head of its branch after a push or a merge. A working tree with uncommitted changes answers 409 `working_tree_dirty`, unless `commit_message` is sent: then WP Waterfall commits the changes first (merging them with the new commits) and the working tree ends on the result."
      },
      "AnalyticsUsage": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "environment",
              "company"
            ]
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "billing_period": {
            "type": "boolean",
            "description": "True when the window is a whole billing period (the current one, or the previous one with `period=previous`), so the bars compare with the plan."
          },
          "plan_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "node_logs",
              "demo",
              "none"
            ],
            "description": "Where the numbers come from: the node logs, the demo seed, or nowhere yet."
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "query_version": {
            "type": "string"
          },
          "last_collected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "meters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "metric": {
                  "type": "string",
                  "enum": [
                    "visits",
                    "server_bandwidth",
                    "cdn_bandwidth",
                    "disk",
                    "sites"
                  ],
                  "description": "What the meter counts."
                },
                "unit": {
                  "type": "string",
                  "enum": [
                    "count",
                    "bytes"
                  ],
                  "description": "`bytes` for disk and bandwidth, `count` for visits and sites."
                },
                "used": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Null when the figure is not measured, so nothing is shown rather than a guess."
                },
                "included": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "What the plan includes for the period. Null when the plan does not limit it."
                },
                "percent": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Used over included, as a percentage with one decimal. Null without both numbers."
                },
                "available": {
                  "type": "boolean",
                  "description": "True when `used` holds a measured figure."
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Where the figure comes from, or why it is missing, in a plain sentence. Null when none."
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "permission_needed",
                    "not_configured",
                    "not_on_plan"
                  ],
                  "description": "`permission_needed` when Cloudflare refused the platform token; `used` is then null."
                }
              },
              "required": [
                "metric",
                "unit",
                "used",
                "included",
                "percent",
                "available",
                "note"
              ]
            }
          },
          "daily": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "visits": {
                  "type": "integer",
                  "minimum": 0
                },
                "page_views": {
                  "type": "integer",
                  "minimum": 0
                },
                "bytes": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Server bandwidth without bots."
                },
                "cdn_bytes": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "default": null,
                  "description": "CDN bandwidth of the day from the saved Cloudflare days. Null when Cloudflare has not answered for the window, so the chart draws no CDN part rather than a zero."
                },
                "bot_bytes": {
                  "type": "integer",
                  "minimum": 0
                },
                "disk_bytes": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Disk at the last reading of the day, or null when there was none."
                }
              },
              "required": [
                "day",
                "visits",
                "page_views",
                "bytes",
                "cdn_bytes",
                "bot_bytes",
                "disk_bytes"
              ]
            }
          },
          "disk_limit_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "The disk quota of the environment (site scope) or the plan (company scope)."
          },
          "sites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "site_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "site_name": {
                  "type": "string"
                },
                "environment_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "environment_name": {
                  "type": "string"
                },
                "environment_kind": {
                  "type": "string"
                },
                "visits": {
                  "type": "integer",
                  "minimum": 0
                },
                "server_bandwidth_bytes": {
                  "type": "integer",
                  "minimum": 0
                },
                "cdn_bandwidth_bytes": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "CDN bytes come from Cloudflare, saved per domain. Null when Cloudflare has not answered."
                },
                "disk_bytes": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                }
              },
              "required": [
                "site_id",
                "site_name",
                "environment_id",
                "environment_name",
                "environment_kind",
                "visits",
                "server_bandwidth_bytes",
                "cdn_bandwidth_bytes",
                "disk_bytes"
              ]
            }
          },
          "plans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "subscription_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "plan_name": {
                  "type": "string",
                  "description": "\"Single 20GB\", \"WP 5\"."
                },
                "pooled": {
                  "type": "boolean",
                  "description": "True for a plan with several site licenses (or several sites), whose sites share it."
                },
                "sites": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "site_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "UUIDv7"
                      },
                      "site_name": {
                        "type": "string",
                        "description": "The site's name."
                      }
                    },
                    "required": [
                      "site_id",
                      "site_name"
                    ]
                  },
                  "description": "The sites that use the plan, by name. Empty when no site uses it."
                },
                "meters": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "metric": {
                        "type": "string",
                        "enum": [
                          "visits",
                          "server_bandwidth",
                          "cdn_bandwidth",
                          "disk",
                          "sites"
                        ],
                        "description": "What the meter counts."
                      },
                      "unit": {
                        "type": "string",
                        "enum": [
                          "count",
                          "bytes"
                        ],
                        "description": "`bytes` for disk and bandwidth, `count` for visits and sites."
                      },
                      "used": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0,
                        "description": "Null when the figure is not measured, so nothing is shown rather than a guess."
                      },
                      "included": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0,
                        "description": "What the plan includes for the period. Null when the plan does not limit it."
                      },
                      "percent": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0,
                        "description": "Used over included, as a percentage with one decimal. Null without both numbers."
                      },
                      "available": {
                        "type": "boolean",
                        "description": "True when `used` holds a measured figure."
                      },
                      "note": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Where the figure comes from, or why it is missing, in a plain sentence. Null when none."
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "permission_needed",
                          "not_configured",
                          "not_on_plan"
                        ],
                        "description": "`permission_needed` when Cloudflare refused the platform token; `used` is then null."
                      }
                    },
                    "required": [
                      "metric",
                      "unit",
                      "used",
                      "included",
                      "percent",
                      "available",
                      "note"
                    ]
                  },
                  "description": "`sites` (a plan with several site licenses only), `disk`, `server_bandwidth`, `cdn_bandwidth`."
                }
              },
              "required": [
                "subscription_id",
                "plan_name",
                "pooled",
                "sites",
                "meters"
              ]
            },
            "default": [],
            "description": "Company scope, for someone who sees every site: each live plan with its sites and their usage, bigger plans first, then oldest. Empty for one environment, and for someone who sees only some sites."
          }
        },
        "required": [
          "scope",
          "environment_id",
          "from",
          "to",
          "billing_period",
          "plan_name",
          "source",
          "note",
          "query_version",
          "last_collected_at",
          "meters",
          "daily",
          "disk_limit_bytes",
          "sites",
          "plans"
        ]
      },
      "ClearLogRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "confirm"
        ]
      },
      "EnvironmentGit": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "kind": {
            "type": "string"
          },
          "branch": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
          },
          "connection_mode": {
            "type": "string",
            "enum": [
              "sftp",
              "git"
            ]
          },
          "can_switch_mode": {
            "type": "boolean"
          },
          "mode_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Live: \"Git: code arrives only by promote.\""
          },
          "source": {
            "type": "string",
            "enum": [
              "wpwaterfall",
              "external"
            ]
          },
          "wpwaterfall_remote": {
            "type": "object",
            "properties": {
              "ssh": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "ready",
                      "off",
                      "ssh_disabled",
                      "live",
                      "external"
                    ]
                  },
                  "available": {
                    "type": "boolean"
                  },
                  "ssh_enabled": {
                    "type": "boolean"
                  },
                  "host": {
                    "type": "string"
                  },
                  "port": {
                    "type": "integer"
                  },
                  "username": {
                    "type": "string"
                  },
                  "path": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "clone_command": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "remote_command": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "key_count": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "push_allowed": {
                    "type": "boolean"
                  },
                  "push_branches": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255,
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
                    }
                  },
                  "refused_reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "status",
                  "available",
                  "ssh_enabled",
                  "host",
                  "port",
                  "username",
                  "path",
                  "url",
                  "clone_command",
                  "remote_command",
                  "key_count",
                  "push_allowed",
                  "push_branches",
                  "refused_reason"
                ]
              },
              "https": {
                "type": "object",
                "properties": {
                  "available": {
                    "type": "boolean"
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "username": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Any username works; this one is shown in the clone command."
                  },
                  "clone_command": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "token_count": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Active tokens (not revoked, not expired) for this environment."
                  },
                  "can_make_token": {
                    "type": "boolean",
                    "description": "True when making a token works now: it turns HTTPS Git on at the same time. False on live, with no WP Waterfall hostname yet, or with SSH off for the environment."
                  },
                  "max_push_mb": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "description": "The largest push over HTTPS, in MB. Git over SSH has no such cap."
                  }
                },
                "required": [
                  "available",
                  "url",
                  "reason"
                ]
              }
            },
            "required": [
              "ssh",
              "https"
            ]
          },
          "connection": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "provider": {
                "type": "string",
                "enum": [
                  "github",
                  "gitlab",
                  "bitbucket",
                  "other"
                ]
              },
              "remote_url": {
                "type": "string"
              },
              "staging_branch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
                "description": "The remote branch staging follows."
              },
              "host_key_policy": {
                "type": "string",
                "enum": [
                  "pinned",
                  "accept_first"
                ]
              },
              "host_key_pinned": {
                "type": "boolean"
              },
              "auto_create_branches": {
                "type": "boolean",
                "description": "Create a preview environment when a new remote branch is pushed. Uses included slots only."
              },
              "webhook_url": {
                "type": "string"
              },
              "webhook_secret_hint": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "provider",
              "remote_url",
              "staging_branch",
              "host_key_policy",
              "host_key_pinned",
              "auto_create_branches",
              "webhook_url",
              "webhook_secret_hint",
              "created_at",
              "updated_at"
            ],
            "description": "The site's connection while it applies to this environment. Null on live and when none."
          },
          "external": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "environment_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "role": {
                "type": "string",
                "enum": [
                  "staging",
                  "preview"
                ]
              },
              "remote_branch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
                "description": "The remote branch this environment follows now (override, else its name; staging's own)."
              },
              "remote_branch_override": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
                "description": "Set on a branch that follows a remote branch with another name. Null for the name match."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "connected",
                  "error",
                  "waiting"
                ]
              },
              "last_pulled_sha": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9a-f]{40}$"
              },
              "last_pulled_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "last_error": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              }
            },
            "required": [
              "environment_id",
              "name",
              "role",
              "remote_branch",
              "remote_branch_override",
              "status",
              "last_pulled_sha",
              "last_pulled_at",
              "last_error"
            ],
            "description": "This environment's link to the connection: its remote branch and last pull."
          },
          "deploy_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeployKey"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_push": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "job_id": {
                "type": "string",
                "format": "uuid",
                "description": "The `import_git_push` job. Open it from the Jobs drawer."
              },
              "status": {
                "type": "string",
                "enum": [
                  "queued",
                  "dispatched",
                  "running",
                  "succeeded",
                  "failed",
                  "cancelled"
                ]
              },
              "pushed_at": {
                "type": "string",
                "format": "date-time"
              },
              "finished_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "requested_by": {
                "type": "string",
                "description": "Who asked: \"Git push\", or the person who ran Check for pushes."
              },
              "branch": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
              },
              "sha": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9a-f]{40}$",
                "description": "The commit the branch moved to. Null while the import runs, or when nothing moved."
              },
              "problem": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why the import refused a branch or failed, in plain words."
              },
              "apply": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUIDv7"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "build_release",
                      "sync_working_tree"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "queued",
                      "dispatched",
                      "running",
                      "succeeded",
                      "failed",
                      "cancelled"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "type",
                  "status"
                ],
                "description": "The job that put the commit on the environment, when one was queued."
              },
              "log": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 8,
                "description": "The last few log lines of the import job."
              }
            },
            "required": [
              "job_id",
              "status",
              "pushed_at",
              "finished_at",
              "requested_by",
              "branch",
              "sha",
              "problem",
              "apply",
              "log"
            ],
            "description": "The last push to the WP Waterfall remote. Null until one arrives, and always null on live."
          }
        },
        "required": [
          "environment_id",
          "site_id",
          "kind",
          "branch",
          "connection_mode",
          "can_switch_mode",
          "mode_note",
          "source",
          "wpwaterfall_remote",
          "connection",
          "deploy_key"
        ]
      },
      "PutConnectionModeRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "sftp",
              "git"
            ]
          },
          "commit_message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "To Git mode with uncommitted changes: commit them first with this message."
          },
          "discard": {
            "type": "boolean",
            "description": "To Git mode with uncommitted changes: drop them. Needs `confirm: true`."
          },
          "confirm": {
            "type": "boolean"
          }
        },
        "required": [
          "mode"
        ]
      },
      "EmptyGitRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "CreateDeployKeyRequest": {
        "type": "object",
        "properties": {
          "rotate": {
            "type": "boolean",
            "description": "Make a new key pair. The old public key stops working once removed from the Git host."
          },
          "confirm": {
            "type": "boolean"
          }
        }
      },
      "DeployKey": {
        "type": "object",
        "properties": {
          "public_key": {
            "type": "string"
          },
          "fingerprint": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "public_key",
          "fingerprint",
          "created_at"
        ]
      },
      "PutSiteGitConnectionRequest": {
        "type": "object",
        "properties": {
          "remote_url": {
            "type": "string",
            "maxLength": 400
          },
          "staging_branch": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
            "description": "The remote branch staging follows. Typed by the person: WP Waterfall never guesses it."
          },
          "provider": {
            "type": "string",
            "enum": [
              "github",
              "gitlab",
              "bitbucket",
              "other"
            ]
          },
          "host_key_policy": {
            "type": "string",
            "enum": [
              "pinned",
              "accept_first"
            ],
            "default": "pinned"
          },
          "known_hosts": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 2000,
              "pattern": "^[A-Za-z0-9.\\-[\\]:,]+ (ssh-ed25519|ecdsa-sha2-nistp(256|384|521)|ssh-rsa|sk-ssh-ed25519@openssh\\.com) [A-Za-z0-9+/=]{20,}$"
            },
            "maxItems": 10,
            "description": "Only for `pinned` on a host WP Waterfall does not know."
          },
          "auto_create_branches": {
            "type": "boolean",
            "description": "Create a preview environment when a new remote branch is pushed. Off unless sent."
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "remote_url",
          "staging_branch",
          "confirm"
        ],
        "additionalProperties": false,
        "description": "Connects an external repository to a site. One connection serves staging and every preview environment: staging follows `staging_branch`, and a preview environment follows the remote branch with its own name, or the one it is told to. Live is never connected."
      },
      "PutSiteGitConnectionResponse": {
        "type": "object",
        "properties": {
          "connection": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "provider": {
                "type": "string",
                "enum": [
                  "github",
                  "gitlab",
                  "bitbucket",
                  "other"
                ]
              },
              "remote_url": {
                "type": "string"
              },
              "staging_branch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
                "description": "The remote branch staging follows."
              },
              "host_key_policy": {
                "type": "string",
                "enum": [
                  "pinned",
                  "accept_first"
                ]
              },
              "host_key_pinned": {
                "type": "boolean"
              },
              "auto_create_branches": {
                "type": "boolean",
                "description": "Create a preview environment when a new remote branch is pushed. Uses included slots only."
              },
              "webhook_url": {
                "type": "string"
              },
              "webhook_secret_hint": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "provider",
              "remote_url",
              "staging_branch",
              "host_key_policy",
              "host_key_pinned",
              "auto_create_branches",
              "webhook_url",
              "webhook_secret_hint",
              "created_at",
              "updated_at"
            ]
          },
          "webhook": {
            "$ref": "#/components/schemas/GitWebhookInfo"
          },
          "deploy_key": {
            "$ref": "#/components/schemas/DeployKey"
          },
          "pull_job_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            },
            "description": "The first pull of each environment, started to prove the key works."
          }
        },
        "required": [
          "connection",
          "webhook",
          "deploy_key",
          "pull_job_ids"
        ]
      },
      "PatchSiteGitConnectionRequest": {
        "type": "object",
        "properties": {
          "auto_create_branches": {
            "type": "boolean",
            "description": "Create a preview environment when a new remote branch is pushed and an included slot is free."
          }
        },
        "required": [
          "auto_create_branches"
        ],
        "additionalProperties": false
      },
      "PutRemoteBranchRequest": {
        "type": "object",
        "properties": {
          "remote_branch": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "remote_branch",
          "confirm"
        ],
        "additionalProperties": false,
        "description": "The remote branch a preview environment follows. `null` goes back to the branch with the environment's own name. Staging always follows the connection's `staging_branch`."
      },
      "RemoteBranchChanged": {
        "type": "object",
        "properties": {
          "link": {
            "type": "object",
            "properties": {
              "environment_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "role": {
                "type": "string",
                "enum": [
                  "staging",
                  "preview"
                ]
              },
              "remote_branch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
                "description": "The remote branch this environment follows now (override, else its name; staging's own)."
              },
              "remote_branch_override": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
                "description": "Set on a branch that follows a remote branch with another name. Null for the name match."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "connected",
                  "error",
                  "waiting"
                ]
              },
              "last_pulled_sha": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9a-f]{40}$"
              },
              "last_pulled_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "last_error": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              }
            },
            "required": [
              "environment_id",
              "name",
              "role",
              "remote_branch",
              "remote_branch_override",
              "status",
              "last_pulled_sha",
              "last_pulled_at",
              "last_error"
            ]
          },
          "pull_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          }
        },
        "required": [
          "link",
          "pull_job_id"
        ]
      },
      "UnlinkedBranchRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "description": "A branch the remote pushed that no environment follows, named so the person can act on it."
      },
      "UnlinkedBranchIgnored": {
        "type": "object",
        "properties": {
          "ignored": {
            "type": "boolean",
            "const": true
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
          }
        },
        "required": [
          "ignored",
          "name"
        ]
      },
      "SiteGit": {
        "type": "object",
        "properties": {
          "connection": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "provider": {
                "type": "string",
                "enum": [
                  "github",
                  "gitlab",
                  "bitbucket",
                  "other"
                ]
              },
              "remote_url": {
                "type": "string"
              },
              "staging_branch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
                "description": "The remote branch staging follows."
              },
              "host_key_policy": {
                "type": "string",
                "enum": [
                  "pinned",
                  "accept_first"
                ]
              },
              "host_key_pinned": {
                "type": "boolean"
              },
              "auto_create_branches": {
                "type": "boolean",
                "description": "Create a preview environment when a new remote branch is pushed. Uses included slots only."
              },
              "webhook_url": {
                "type": "string"
              },
              "webhook_secret_hint": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "provider",
              "remote_url",
              "staging_branch",
              "host_key_policy",
              "host_key_pinned",
              "auto_create_branches",
              "webhook_url",
              "webhook_secret_hint",
              "created_at",
              "updated_at"
            ]
          },
          "deploy_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeployKey"
              },
              {
                "type": "null"
              }
            ]
          },
          "environments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "environment_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "name": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "staging",
                    "preview"
                  ]
                },
                "remote_branch": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
                  "description": "The remote branch this environment follows now (override, else its name; staging's own)."
                },
                "remote_branch_override": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
                  "description": "Set on a branch that follows a remote branch with another name. Null for the name match."
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "connected",
                    "error",
                    "waiting"
                  ]
                },
                "last_pulled_sha": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9a-f]{40}$"
                },
                "last_pulled_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "last_error": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              },
              "required": [
                "environment_id",
                "name",
                "role",
                "remote_branch",
                "remote_branch_override",
                "status",
                "last_pulled_sha",
                "last_pulled_at",
                "last_error"
              ]
            },
            "description": "Staging first, then branches by name. Empty until a repository is connected."
          },
          "unlinked_branches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
                },
                "last_seen_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "last_sha": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9a-f]{40}$"
                }
              },
              "required": [
                "name",
                "last_seen_at",
                "last_sha"
              ]
            }
          }
        },
        "required": [
          "connection",
          "deploy_key",
          "environments",
          "unlinked_branches"
        ],
        "description": "`GET /sites/{id}/git/connection`: the connection, its environments, and the unlinked branches."
      },
      "DeleteGitConnectionResponse": {
        "type": "object",
        "properties": {
          "disconnected": {
            "type": "boolean",
            "const": true
          },
          "job_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            },
            "description": "The jobs that reopen the WP Waterfall remote on the environments that had it set up."
          }
        },
        "required": [
          "disconnected",
          "job_ids"
        ]
      },
      "GitPullRequest": {
        "type": "object",
        "properties": {
          "replace": {
            "type": "boolean",
            "description": "Make the environment's branch the remote's branch when it is not a fast forward."
          },
          "confirm": {
            "type": "boolean"
          }
        }
      },
      "ConfirmOnlyRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "confirm"
        ]
      },
      "GitWebhookInfo": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "secret": {
            "type": "string",
            "description": "Shown once."
          },
          "content_type": {
            "type": "string",
            "const": "application/json"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "const": "push"
            }
          }
        },
        "required": [
          "url",
          "secret",
          "content_type",
          "events"
        ]
      },
      "CreateGitTokenRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "scope": {
            "type": "string",
            "enum": [
              "read",
              "write"
            ],
            "description": "read clones and fetches; write also pushes to the environment's branch."
          },
          "expires_in_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365,
            "default": 90
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "name",
          "scope",
          "confirm"
        ],
        "additionalProperties": false
      },
      "GitTokenCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "read",
              "write"
            ]
          },
          "prefix": {
            "type": "string",
            "description": "The first characters of the token, to tell tokens apart. Never enough to use it."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "expired": {
            "type": "boolean"
          },
          "token": {
            "type": "string",
            "pattern": "^wpw_git_[A-Za-z0-9_-]{40}$",
            "description": "Shown once. WP Waterfall stores only its SHA-256 hash."
          },
          "username": {
            "type": "string"
          },
          "clone_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "clone_command": {
            "type": [
              "string",
              "null"
            ]
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job that refreshes HTTPS Git on the node, null when Git is not set up there yet."
          }
        },
        "required": [
          "id",
          "environment_id",
          "name",
          "scope",
          "prefix",
          "expires_at",
          "last_used_at",
          "created_at",
          "created_by",
          "expired",
          "token",
          "username",
          "clone_url",
          "clone_command",
          "job_id"
        ]
      },
      "GitTokenList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "environment_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "name": {
                  "type": "string"
                },
                "scope": {
                  "type": "string",
                  "enum": [
                    "read",
                    "write"
                  ]
                },
                "prefix": {
                  "type": "string",
                  "description": "The first characters of the token, to tell tokens apart. Never enough to use it."
                },
                "expires_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "last_used_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "created_by": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "expired": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "environment_id",
                "name",
                "scope",
                "prefix",
                "expires_at",
                "last_used_at",
                "created_at",
                "created_by",
                "expired"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "GitTokenRevoked": {
        "type": "object",
        "properties": {
          "revoked": {
            "type": "boolean",
            "const": true
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          }
        },
        "required": [
          "revoked",
          "id"
        ]
      },
      "SiteAddonList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "enum": [
                    "additional_disk",
                    "additional_previews",
                    "php_performance",
                    "dedicated_server",
                    "disaster_recovery",
                    "safe_updates",
                    "reverse_proxy",
                    "object_cache",
                    "hourly_backups",
                    "external_backups",
                    "custom_ssl"
                  ]
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "description": {
                  "type": "string",
                  "minLength": 1
                },
                "monthly_cents": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "The price per `price_unit` in cents. Null means custom pricing (quoted by staff)."
                },
                "setup_cents": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "A one-time setup charge in cents, when the catalog has one."
                },
                "price_unit": {
                  "type": "string",
                  "enum": [
                    "month",
                    "year",
                    "backup"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "DRAFT",
                    "confirmed"
                  ]
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "toggle",
                    "request",
                    "connect",
                    "add_to_plan",
                    "enable",
                    "manage"
                  ]
                },
                "enabled": {
                  "type": "boolean",
                  "description": "True once the add-on is on for this site: the node switched it on (toggle), or staff fulfilled the request (request)."
                },
                "request": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "fulfilled",
                        "declined",
                        "ended"
                      ]
                    },
                    "requested_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "status",
                    "requested_at"
                  ],
                  "description": "The latest request for a contact us add-on. Null when there is none, or for other actions."
                },
                "purchase": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "addon_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The commerce add-on record."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "active"
                      ]
                    },
                    "quantity": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    },
                    "monthly_cents": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "The charge for the whole purchase per `price_unit`, in cents: per month, or per year for a yearly add-on. The name is kept for existing readers."
                    },
                    "price_unit": {
                      "type": "string",
                      "enum": [
                        "month",
                        "year",
                        "backup"
                      ],
                      "description": "What `monthly_cents` is per. `month` unless the add-on is billed yearly."
                    },
                    "renews_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "When a yearly add-on renews, and when its current year ends. Null for monthly add-ons."
                    },
                    "environment_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid"
                    },
                    "complimentary": {
                      "type": "boolean",
                      "description": "True when WP Waterfall support turned the add-on on at no charge. Absent or false when it is paid."
                    },
                    "added_gb": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Additional disk space only: GB added to the account."
                    },
                    "added_mb": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "PHP Performance only: MB added to the pool of the live environment."
                    },
                    "covers_gb": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "description": "Standby Failover only: the site size in GB this purchase covers (50 for the $300 base price, 100 for $400, and so on). A purchase made before size based pricing covers 50 GB."
                    },
                    "node_status": {
                      "type": "string",
                      "enum": [
                        "applied",
                        "applying",
                        "failed",
                        "none"
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "addon_id",
                    "status",
                    "quantity",
                    "monthly_cents",
                    "environment_id",
                    "added_gb",
                    "node_status",
                    "created_at"
                  ],
                  "description": "Self-serve add-ons: the purchase that is on now. Null while the add-on is off. For Hourly backups it is the purchase of the environment the list was read for."
                },
                "max_quantity": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Add-ons bought in blocks (Additional disk space, PHP Performance): the most blocks this site or account can hold. For PHP Performance it is zero when the included pool already reaches the limit. Absent for other add-ons."
                },
                "disk_overage": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "environment_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "environment_name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "used_bytes": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "allowance_bytes": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "billing"
                        ]
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "no_payment_method",
                          "billing_details",
                          "account_standing",
                          "switch_off",
                          "uptime_guarantee",
                          "staff_managed",
                          "too_large",
                          "purchase_failed",
                          "limit_reached"
                        ]
                      }
                    },
                    "required": [
                      "environment_id",
                      "environment_name",
                      "used_bytes",
                      "allowance_bytes",
                      "state",
                      "reason"
                    ]
                  },
                  "description": "Additional disk space only: the environments of this site that use more disk than they have, with the disk used and the disk each has. Absent or empty while none is over."
                },
                "object_cache": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "verified": {
                      "type": "boolean"
                    },
                    "verified_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "When the check last passed. Null when it never did."
                    },
                    "memory_mb": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "exclusiveMinimum": 0,
                      "description": "The Redis memory cap in MB."
                    },
                    "used_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Memory Redis used right after the last change, in bytes."
                    },
                    "round_trip_ms": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Time WordPress took to set a key in Redis and read it back, in milliseconds."
                    },
                    "drop_in": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The drop-in file WordPress uses."
                    },
                    "fpm_checked": {
                      "type": "boolean",
                      "description": "True when a request through the site's PHP-FPM pool confirmed the cache."
                    }
                  },
                  "required": [
                    "verified",
                    "verified_at",
                    "memory_mb",
                    "used_bytes",
                    "round_trip_ms",
                    "drop_in",
                    "fpm_checked"
                  ],
                  "description": "Redis object cache only: the verified state. Null while the add-on is off or for other add-ons."
                },
                "disaster_recovery": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/DisasterRecovery"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Standby Failover only: the state of the site's standby copy. Null while the add-on is off."
                },
                "uptime_guarantee": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "requested",
                        "being_set_up",
                        "active",
                        "not_available"
                      ],
                      "description": "`requested`: staff have the request and have not answered. `being_set_up`: staff agreed and the standby copy is being made. `active`: the copy was verified and is ready to take over. `not_available`: staff declined, or stopped the set-up and gave the money back."
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why it is not available, in the words staff wrote. Null in every other state."
                    }
                  },
                  "required": [
                    "state",
                    "reason"
                  ],
                  "description": "Standby Failover only: where the customer's request stands, in the four plain states the card shows: Requested, Being set up, Active, or Not available with the reason. Null when nobody asked for it and it is off."
                },
                "site_size_gb": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "Standby Failover only: the size of this site in GB for the price (the disk its plan lets one site use). `monthly_cents` is the price for that size, or what the site pays once it has bought."
                },
                "starts_at_cents": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "Standby Failover only: the starting price in cents a month, for a site up to 50 GB."
                },
                "preview_slots": {
                  "type": "object",
                  "properties": {
                    "slots": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "in_use": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "max_slots": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "slots",
                    "in_use",
                    "max_slots"
                  ],
                  "description": "Additional Preview Environments only: the company's slots."
                }
              },
              "required": [
                "id",
                "name",
                "description",
                "monthly_cents",
                "setup_cents",
                "price_unit",
                "status",
                "action",
                "enabled",
                "request"
              ]
            },
            "maxItems": 11
          },
          "next_cursor": {},
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The environment per environment add-ons (Hourly backups) were read for."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "description": "`GET /sites/{id}/add-ons`. One row per add-on in the catalog, so it is capped and not paged."
      },
      "AddOnRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "company_id": {
            "type": "string",
            "minLength": 1
          },
          "site_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null for a request about the whole company, such as the Enterprise support set-up task."
          },
          "add_on": {
            "type": "string",
            "enum": [
              "additional_disk",
              "additional_previews",
              "php_performance",
              "dedicated_server",
              "disaster_recovery",
              "safe_updates",
              "reverse_proxy",
              "object_cache",
              "hourly_backups",
              "external_backups",
              "custom_ssl",
              "enterprise_support"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "fulfilled",
              "declined",
              "ended"
            ]
          },
          "requested_by": {
            "type": "string",
            "minLength": 1
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "resolved_by": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "company_id",
          "site_id",
          "add_on",
          "note",
          "status",
          "requested_by",
          "requested_at",
          "resolved_at",
          "resolved_by"
        ],
        "description": "One add-on request. Staff see `company_id`; customers see only their own requests."
      },
      "CreateAddOnRequest": {
        "type": "object",
        "properties": {
          "add_on": {
            "type": "string",
            "enum": [
              "additional_disk",
              "php_performance",
              "dedicated_server",
              "disaster_recovery",
              "safe_updates",
              "reverse_proxy",
              "hourly_backups",
              "external_backups"
            ]
          },
          "note": {
            "type": "string",
            "maxLength": 1000,
            "description": "Anything staff should know: sizes, timing, the domain for a reverse proxy."
          },
          "confirm": {
            "type": "boolean",
            "description": "The MCP server and API keys send it. The dashboard confirms in its own dialog."
          }
        },
        "required": [
          "add_on"
        ],
        "additionalProperties": false,
        "description": "`POST /sites/{id}/add-on-requests`: ask WP Waterfall to apply a contact us add-on to the site."
      },
      "PurchaseSiteAddon": {
        "type": "object",
        "properties": {
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "description": "Additional disk space: the 20 GB blocks the account should hold in total. PHP Performance: the 512 MB blocks the site should hold in total."
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "Hourly backups: the environment. The live environment by default."
          },
          "confirm": {
            "type": "boolean",
            "description": "The MCP server and API keys send it. The dashboard confirms in its own dialog."
          }
        },
        "additionalProperties": false,
        "description": "`POST /sites/{id}/add-ons/{addon_id}/purchase`: turn on a self-serve add-on, or change it. It is billed at once: the rest of this period prorated on the next invoice, then monthly."
      },
      "CancelSiteAddon": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid"
          },
          "confirm": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "`POST /sites/{id}/add-ons/{addon_id}/cancel`: turn a self-serve add-on off now. The unused days of this period are credited to the account, and the monthly charge ends."
      },
      "RetrySiteAddon": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false,
        "description": "`POST /sites/{id}/add-ons/{addon_id}/retry`: queue the node work again. Charges nothing."
      },
      "SiteAddonChange": {
        "type": "object",
        "properties": {
          "add_on": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "enum": [
                  "additional_disk",
                  "additional_previews",
                  "php_performance",
                  "dedicated_server",
                  "disaster_recovery",
                  "safe_updates",
                  "reverse_proxy",
                  "object_cache",
                  "hourly_backups",
                  "external_backups",
                  "custom_ssl"
                ]
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string",
                "minLength": 1
              },
              "monthly_cents": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "The price per `price_unit` in cents. Null means custom pricing (quoted by staff)."
              },
              "setup_cents": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "A one-time setup charge in cents, when the catalog has one."
              },
              "price_unit": {
                "type": "string",
                "enum": [
                  "month",
                  "year",
                  "backup"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "DRAFT",
                  "confirmed"
                ]
              },
              "action": {
                "type": "string",
                "enum": [
                  "toggle",
                  "request",
                  "connect",
                  "add_to_plan",
                  "enable",
                  "manage"
                ]
              },
              "enabled": {
                "type": "boolean",
                "description": "True once the add-on is on for this site: the node switched it on (toggle), or staff fulfilled the request (request)."
              },
              "request": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "fulfilled",
                      "declined",
                      "ended"
                    ]
                  },
                  "requested_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "id",
                  "status",
                  "requested_at"
                ],
                "description": "The latest request for a contact us add-on. Null when there is none, or for other actions."
              },
              "purchase": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "addon_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The commerce add-on record."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "active"
                    ]
                  },
                  "quantity": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "monthly_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "The charge for the whole purchase per `price_unit`, in cents: per month, or per year for a yearly add-on. The name is kept for existing readers."
                  },
                  "price_unit": {
                    "type": "string",
                    "enum": [
                      "month",
                      "year",
                      "backup"
                    ],
                    "description": "What `monthly_cents` is per. `month` unless the add-on is billed yearly."
                  },
                  "renews_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When a yearly add-on renews, and when its current year ends. Null for monthly add-ons."
                  },
                  "environment_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "complimentary": {
                    "type": "boolean",
                    "description": "True when WP Waterfall support turned the add-on on at no charge. Absent or false when it is paid."
                  },
                  "added_gb": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Additional disk space only: GB added to the account."
                  },
                  "added_mb": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "PHP Performance only: MB added to the pool of the live environment."
                  },
                  "covers_gb": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "description": "Standby Failover only: the site size in GB this purchase covers (50 for the $300 base price, 100 for $400, and so on). A purchase made before size based pricing covers 50 GB."
                  },
                  "node_status": {
                    "type": "string",
                    "enum": [
                      "applied",
                      "applying",
                      "failed",
                      "none"
                    ]
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "addon_id",
                  "status",
                  "quantity",
                  "monthly_cents",
                  "environment_id",
                  "added_gb",
                  "node_status",
                  "created_at"
                ],
                "description": "Self-serve add-ons: the purchase that is on now. Null while the add-on is off. For Hourly backups it is the purchase of the environment the list was read for."
              },
              "max_quantity": {
                "type": "integer",
                "minimum": 0,
                "description": "Add-ons bought in blocks (Additional disk space, PHP Performance): the most blocks this site or account can hold. For PHP Performance it is zero when the included pool already reaches the limit. Absent for other add-ons."
              },
              "disk_overage": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "environment_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "environment_name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "used_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "allowance_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "billing"
                      ]
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "no_payment_method",
                        "billing_details",
                        "account_standing",
                        "switch_off",
                        "uptime_guarantee",
                        "staff_managed",
                        "too_large",
                        "purchase_failed",
                        "limit_reached"
                      ]
                    }
                  },
                  "required": [
                    "environment_id",
                    "environment_name",
                    "used_bytes",
                    "allowance_bytes",
                    "state",
                    "reason"
                  ]
                },
                "description": "Additional disk space only: the environments of this site that use more disk than they have, with the disk used and the disk each has. Absent or empty while none is over."
              },
              "object_cache": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "verified": {
                    "type": "boolean"
                  },
                  "verified_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When the check last passed. Null when it never did."
                  },
                  "memory_mb": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "exclusiveMinimum": 0,
                    "description": "The Redis memory cap in MB."
                  },
                  "used_bytes": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Memory Redis used right after the last change, in bytes."
                  },
                  "round_trip_ms": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Time WordPress took to set a key in Redis and read it back, in milliseconds."
                  },
                  "drop_in": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The drop-in file WordPress uses."
                  },
                  "fpm_checked": {
                    "type": "boolean",
                    "description": "True when a request through the site's PHP-FPM pool confirmed the cache."
                  }
                },
                "required": [
                  "verified",
                  "verified_at",
                  "memory_mb",
                  "used_bytes",
                  "round_trip_ms",
                  "drop_in",
                  "fpm_checked"
                ],
                "description": "Redis object cache only: the verified state. Null while the add-on is off or for other add-ons."
              },
              "disaster_recovery": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/DisasterRecovery"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Standby Failover only: the state of the site's standby copy. Null while the add-on is off."
              },
              "uptime_guarantee": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "requested",
                      "being_set_up",
                      "active",
                      "not_available"
                    ],
                    "description": "`requested`: staff have the request and have not answered. `being_set_up`: staff agreed and the standby copy is being made. `active`: the copy was verified and is ready to take over. `not_available`: staff declined, or stopped the set-up and gave the money back."
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Why it is not available, in the words staff wrote. Null in every other state."
                  }
                },
                "required": [
                  "state",
                  "reason"
                ],
                "description": "Standby Failover only: where the customer's request stands, in the four plain states the card shows: Requested, Being set up, Active, or Not available with the reason. Null when nobody asked for it and it is off."
              },
              "site_size_gb": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "Standby Failover only: the size of this site in GB for the price (the disk its plan lets one site use). `monthly_cents` is the price for that size, or what the site pays once it has bought."
              },
              "starts_at_cents": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "Standby Failover only: the starting price in cents a month, for a site up to 50 GB."
              },
              "preview_slots": {
                "type": "object",
                "properties": {
                  "slots": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "in_use": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "max_slots": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "slots",
                  "in_use",
                  "max_slots"
                ],
                "description": "Additional Preview Environments only: the company's slots."
              }
            },
            "required": [
              "id",
              "name",
              "description",
              "monthly_cents",
              "setup_cents",
              "price_unit",
              "status",
              "action",
              "enabled",
              "request"
            ]
          },
          "proration_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Cents added to the next invoice now for the rest of this period."
          },
          "credit_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Cents credited to the account for unused days."
          },
          "job_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Node jobs the change queued, such as one `set_disk_quota` per environment."
          }
        },
        "required": [
          "add_on",
          "proration_cents",
          "credit_cents",
          "job_ids"
        ],
        "description": "What a purchase, change, cancel, or retry did."
      },
      "ObjectCacheStatus": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid"
          },
          "enabled": {
            "type": "boolean"
          },
          "running": {
            "type": "boolean",
            "description": "True when Redis answers on its socket."
          },
          "memory_mb": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0
          },
          "used_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "keys": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "hits": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "misses": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "hit_rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1,
            "description": "Hits divided by hits plus misses, 0 to 1. Null until Redis has served a read."
          },
          "evicted_keys": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "uptime_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "verified": {
            "type": "boolean",
            "description": "True when this answer ran the check and it passed."
          },
          "verify_ran": {
            "type": "boolean",
            "description": "True when this answer ran the check."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the check failed, in plain words."
          },
          "round_trip_ms": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "drop_in": {
            "type": [
              "string",
              "null"
            ]
          },
          "key_prefix": {
            "type": [
              "string",
              "null"
            ]
          },
          "fpm_checked": {
            "type": "boolean"
          },
          "recorded": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "verified": {
                "type": "boolean"
              },
              "verified_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the check last passed. Null when it never did."
              },
              "memory_mb": {
                "type": [
                  "integer",
                  "null"
                ],
                "exclusiveMinimum": 0,
                "description": "The Redis memory cap in MB."
              },
              "used_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Memory Redis used right after the last change, in bytes."
              },
              "round_trip_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "description": "Time WordPress took to set a key in Redis and read it back, in milliseconds."
              },
              "drop_in": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The drop-in file WordPress uses."
              },
              "fpm_checked": {
                "type": "boolean",
                "description": "True when a request through the site's PHP-FPM pool confirmed the cache."
              }
            },
            "required": [
              "verified",
              "verified_at",
              "memory_mb",
              "used_bytes",
              "round_trip_ms",
              "drop_in",
              "fpm_checked"
            ],
            "description": "The last verified state the control plane recorded when the add-on was switched on."
          }
        },
        "required": [
          "environment_id",
          "enabled",
          "running",
          "memory_mb",
          "used_bytes",
          "keys",
          "hits",
          "misses",
          "hit_rate",
          "evicted_keys",
          "uptime_seconds",
          "verified",
          "verify_ran",
          "reason",
          "round_trip_ms",
          "drop_in",
          "key_prefix",
          "fpm_checked",
          "recorded"
        ],
        "description": "`GET /sites/{id}/object-cache`: the live state of the Redis object cache of one environment, read from the node. Memory used, keys, hits, and misses come from Redis INFO. With `verify=true` the node also runs the check again (it sets and deletes one short lived key) and says whether WordPress still uses the cache."
      },
      "OffsiteBackupStatus": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "available": {
            "type": "boolean",
            "description": "False while off-site backups are turned off on this WP Waterfall install."
          },
          "purchased": {
            "type": "boolean",
            "description": "True once the External backups add-on is on for the company (bought on the Add-ons tab). Connecting a bucket needs it. Always true on an install without self-serve billing."
          },
          "connection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OffsiteConnection"
              },
              {
                "type": "null"
              }
            ]
          },
          "runs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "environment_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "job_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "trigger": {
                  "type": "string",
                  "enum": [
                    "scheduled",
                    "manual"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "succeeded",
                    "failed"
                  ]
                },
                "snapshot_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "bytes_added": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "New data the run uploaded, after restic's deduplication and compression."
                },
                "total_bytes": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "The size of everything the snapshot holds."
                },
                "duration_ms": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "error": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "finished_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "environment_id",
                "job_id",
                "trigger",
                "status",
                "snapshot_id",
                "bytes_added",
                "total_bytes",
                "duration_ms",
                "error",
                "created_at",
                "finished_at"
              ]
            },
            "description": "The newest runs first, at most 20."
          },
          "snapshots": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "short_id": {
                  "type": "string"
                },
                "time": {
                  "type": "string",
                  "format": "date-time"
                },
                "environment_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The environment it was taken from (tag `env:<id>`), when WP Waterfall took it."
                },
                "hostname": {
                  "type": "string"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "paths": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "id",
                "short_id",
                "time",
                "environment_id",
                "hostname",
                "tags",
                "paths"
              ]
            },
            "description": "From the latest list job, newest first. Refresh with POST.../snapshots/refresh."
          },
          "snapshots_refreshed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "price": {
            "type": "object",
            "properties": {
              "per_backup_cents": {
                "type": "integer"
              },
              "per_gb_cents": {
                "type": "integer"
              }
            },
            "required": [
              "per_backup_cents",
              "per_gb_cents"
            ],
            "description": "The metered prices: each succeeded run, and each GB it uploads."
          }
        },
        "required": [
          "site_id",
          "available",
          "purchased",
          "connection",
          "runs",
          "snapshots",
          "snapshots_refreshed_at",
          "price"
        ],
        "description": "`GET /sites/{id}/offsite-backup`: the connection, recent runs, and the snapshot list."
      },
      "OffsiteConnection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "provider": {
            "type": "string",
            "enum": [
              "s3",
              "gcs"
            ]
          },
          "endpoint": {
            "type": "string",
            "description": "The S3-compatible endpoint, or the Google Cloud Storage address."
          },
          "bucket": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "credential_hint": {
            "type": "string",
            "description": "Enough to recognize the key: the end of the access key ID, or the service account email."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "connected",
              "error"
            ],
            "description": "`pending` until the first test passes, `error` after a failed test or run."
          },
          "enabled": {
            "type": "boolean",
            "description": "False pauses the daily run. On demand runs still work."
          },
          "retention": {
            "type": "object",
            "properties": {
              "keep_last": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "keep_daily": {
                "type": "integer",
                "minimum": 0,
                "maximum": 365
              },
              "keep_weekly": {
                "type": "integer",
                "minimum": 0,
                "maximum": 104
              }
            },
            "required": [
              "keep_last",
              "keep_daily",
              "keep_weekly"
            ]
          },
          "last_tested_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          },
          "last_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next daily run starts, or null while it is paused or not connected."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "site_id",
          "provider",
          "endpoint",
          "bucket",
          "prefix",
          "region",
          "credential_hint",
          "status",
          "enabled",
          "retention",
          "last_tested_at",
          "last_error",
          "last_run_at",
          "last_success_at",
          "next_run_at",
          "created_at",
          "updated_at"
        ],
        "description": "A site's bucket connection. Never holds a secret."
      },
      "PutOffsiteBackupRequest": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "s3",
              "gcs"
            ]
          },
          "endpoint": {
            "type": "string",
            "minLength": 8,
            "maxLength": 255,
            "description": "S3-compatible only: the service address, such as https://s3.eu-west-1.amazonaws.com."
          },
          "bucket": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9._-]{1,220}[a-z0-9]$"
          },
          "prefix": {
            "type": "string",
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(\\/[A-Za-z0-9][A-Za-z0-9._-]*)*$",
            "description": "The folder for this site's repository. Defaults to wpwaterfall/<site slug>."
          },
          "region": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{1,39}$"
          },
          "access_key_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "S3-compatible: an access key that can read, write, list, and delete in the bucket."
          },
          "secret_access_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "service_account_json": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000,
            "description": "Google Cloud Storage: a service account key file (JSON) with Storage Object Admin."
          },
          "repository_password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 256,
            "description": "Reuse an existing restic repository at this location. Leave out to make a new one."
          },
          "keep_last": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "keep_daily": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "keep_weekly": {
            "type": "integer",
            "minimum": 0,
            "maximum": 104
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "provider",
          "bucket",
          "confirm"
        ],
        "additionalProperties": false,
        "description": "`PUT /sites/{id}/offsite-backup`: connect (or replace) the site's bucket. WP Waterfall seals the credentials, generates a restic repository password unless `repository_password` reuses an existing repository, and queues a test that creates the repository."
      },
      "OffsiteBackupConnected": {
        "type": "object",
        "properties": {
          "connection": {
            "$ref": "#/components/schemas/OffsiteConnection"
          },
          "repository_password": {
            "type": [
              "string",
              "null"
            ],
            "description": "The restic repository password WP Waterfall made, shown this once. Save it: with it and your bucket you can restore without WP Waterfall. Null when the request reused an existing repository."
          },
          "test_job_id": {
            "type": "string",
            "format": "uuid",
            "description": "The `offsite_backup_test` job that checks the bucket and creates the repository."
          }
        },
        "required": [
          "connection",
          "repository_password",
          "test_job_id"
        ],
        "description": "`PUT /sites/{id}/offsite-backup` answers 201 with this."
      },
      "PatchOffsiteBackupRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "keep_last": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "keep_daily": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "keep_weekly": {
            "type": "integer",
            "minimum": 0,
            "maximum": 104
          }
        },
        "additionalProperties": false,
        "description": "`PATCH /sites/{id}/offsite-backup`: pause the daily run or change the retention."
      },
      "OffsiteBackupEmptyRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "`POST /environments/{id}/offsite-backup/run` and the test and refresh calls take no fields."
      },
      "OffsiteRestoreRequest": {
        "type": "object",
        "properties": {
          "snapshot_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{8,64}$"
          },
          "target_environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "database": {
            "type": "boolean",
            "default": true
          },
          "uploads": {
            "type": "boolean",
            "default": true
          },
          "code": {
            "type": "boolean",
            "default": false
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "snapshot_id",
          "target_environment_id",
          "confirm"
        ],
        "additionalProperties": false,
        "description": "`POST /sites/{id}/offsite-backup/restore`: restore one off-site snapshot into a staging or preview environment of the same site. Live is never a target. Code comes back only into an environment in SFTP mode, because Git mode code is a read-only release."
      },
      "OffsiteBackupRemoved": {
        "type": "object",
        "properties": {
          "disconnected": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "disconnected"
        ]
      },
      "AutoUpdateState": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "mode": {
            "type": "string",
            "enum": [
              "git",
              "sftp"
            ],
            "description": "How an update reaches this environment: `git` saves a commit, `sftp` changes the working copy."
          },
          "supported": {
            "type": "boolean",
            "description": "False on live, and while an external repository is connected."
          },
          "unsupported_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it is off here, in one sentence. Null when it can run."
          },
          "enabled": {
            "type": "boolean",
            "description": "True when at least one switch is on and automatic updates can run here."
          },
          "tier": {
            "type": "string",
            "enum": [
              "plain",
              "safe"
            ],
            "description": "`safe` while Safe Updates is on and the site holds the add-on, otherwise `plain`."
          },
          "cadence": {
            "type": "string",
            "enum": [
              "daily",
              "weekly"
            ],
            "description": "`weekly` for Safe Updates, `daily` otherwise."
          },
          "plugins": {
            "type": "object",
            "properties": {
              "all": {
                "type": "boolean"
              },
              "enabled": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
                },
                "maxItems": 500
              },
              "disabled": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
                },
                "maxItems": 500
              }
            },
            "required": [
              "all",
              "enabled",
              "disabled"
            ]
          },
          "themes": {
            "type": "object",
            "properties": {
              "all": {
                "type": "boolean"
              },
              "enabled": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
                },
                "maxItems": 500
              },
              "disabled": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
                },
                "maxItems": 500
              }
            },
            "required": [
              "all",
              "enabled",
              "disabled"
            ]
          },
          "safe": {
            "type": "object",
            "properties": {
              "entitled": {
                "type": "boolean",
                "description": "True when the site holds the Safe Updates add-on."
              },
              "enabled": {
                "type": "boolean",
                "description": "True when Safe Updates is switched on here and the site holds the add-on."
              },
              "days": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 6
                },
                "minItems": 1,
                "maxItems": 7,
                "description": "The days a run may start on, 0 is Sunday and 6 is Saturday, in `timezone`."
              },
              "hour": {
                "type": "integer",
                "minimum": 0,
                "maximum": 23,
                "description": "The window starts at this hour, in `timezone`, and lasts two hours."
              },
              "timezone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "window_hours": {
                "type": "number",
                "const": 2
              },
              "pages": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "^\\/(?!\\/)[^\\s\\\\\\u0000-\\u001f]*$"
                    },
                    "hide_selectors": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120,
                        "pattern": "^[A-Za-z0-9_\\-\\s.#[\\]=\"':>+~*,()^$|]+$"
                      },
                      "maxItems": 20,
                      "default": [],
                      "description": "Elements taken out of the page (display none) before its picture, on this page only."
                    },
                    "required_match": {
                      "type": "integer",
                      "minimum": 50,
                      "maximum": 100,
                      "default": 95,
                      "description": "How much of this page must match its picture from before the update, in percent."
                    }
                  },
                  "required": [
                    "path",
                    "hide_selectors",
                    "required_match"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 10,
                "description": "The pages tested, each with the match it must reach."
              },
              "exclude_selectors": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120,
                  "pattern": "^[A-Za-z0-9_\\-\\s.#[\\]=\"':>+~*,()^$|]+$"
                },
                "maxItems": 20,
                "description": "Elements taken out of the pictures of every page."
              },
              "capture": {
                "type": "object",
                "properties": {
                  "wait_seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 15,
                    "default": 2,
                    "description": "Seconds to wait after the page loads and after the scroll."
                  },
                  "enable_animations": {
                    "type": "boolean",
                    "default": true,
                    "description": "On: animations and scroll effects play, and the picture waits for running ones to finish. Off: animations are finished at once and frozen, and the browser is asked for reduced motion. Every page is scrolled down and back to the top before its picture, whatever this says."
                  },
                  "flatten_sticky": {
                    "type": "boolean",
                    "default": false,
                    "description": "Make fixed and sticky elements part of the flow for the picture."
                  }
                },
                "required": [
                  "wait_seconds",
                  "enable_animations",
                  "flatten_sticky"
                ],
                "additionalProperties": false,
                "description": "How a page is prepared before its picture: wait, animations, sticky elements."
              }
            },
            "required": [
              "entitled",
              "enabled",
              "days",
              "hour",
              "timezone",
              "window_hours",
              "pages",
              "exclude_selectors",
              "capture"
            ]
          },
          "deploy_to_live": {
            "type": "boolean",
            "description": "After a run passes its checks, ship staging's new code to live. Staging only."
          },
          "deploy_supported": {
            "type": "boolean",
            "description": "False on a preview, where there is nothing to deploy to live."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "plugin",
                    "theme"
                  ]
                },
                "slug": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
                },
                "version": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 80,
                  "description": "The version that broke the site. A newer version is tried again at once."
                },
                "reason": {
                  "type": "string",
                  "maxLength": 300,
                  "description": "One plain sentence."
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "health",
                    "visual",
                    "ai",
                    "isolation"
                  ],
                  "default": "health",
                  "description": "Which check failed. `isolation` means the run could not tell which of several it was."
                },
                "since": {
                  "type": "string",
                  "format": "date-time"
                },
                "until": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "kind",
                "slug",
                "version",
                "reason",
                "source",
                "since",
                "until"
              ]
            }
          },
          "last_run": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "UUIDv7"
              },
              "trigger": {
                "type": "string",
                "enum": [
                  "scheduled",
                  "manual",
                  "approved"
                ]
              },
              "tier": {
                "type": "string",
                "enum": [
                  "plain",
                  "safe"
                ],
                "default": "plain"
              },
              "mode": {
                "type": "string",
                "enum": [
                  "git",
                  "sftp"
                ]
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "updated",
                  "rolled_back",
                  "failed",
                  "skipped",
                  "nothing_to_update",
                  "needs_confirmation",
                  "rejected",
                  "expired"
                ]
              },
              "summary": {
                "type": "string",
                "maxLength": 400
              },
              "updates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "plugin",
                        "theme"
                      ]
                    },
                    "slug": {
                      "type": "string"
                    },
                    "from_version": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "to_version": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "result": {
                      "type": "string",
                      "enum": [
                        "updated",
                        "failed",
                        "skipped",
                        "rolled_back"
                      ],
                      "description": "`rolled_back` is an update a check failed on. It was undone and is left out."
                    },
                    "message": {
                      "type": "string",
                      "maxLength": 300
                    }
                  },
                  "required": [
                    "kind",
                    "slug",
                    "from_version",
                    "to_version",
                    "result"
                  ]
                }
              },
              "commit_sha": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The Git commit of a run that updated something in Git mode, or that committed to deploy."
              },
              "restore_point": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "backup_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "UUIDv7"
                  },
                  "snapshot_name": {
                    "type": "string"
                  },
                  "expires_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  }
                },
                "required": [
                  "backup_id",
                  "snapshot_name",
                  "expires_at"
                ]
              },
              "visual": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "^\\/(?!\\/)[^\\s\\\\\\u0000-\\u001f]*$"
                    },
                    "width": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    },
                    "changed_percent": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100,
                      "description": "Share of pixels that changed outside the masked regions, 0 to 100."
                    },
                    "match_percent": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100,
                      "default": 100,
                      "description": "100 minus `changed_percent`: how much of the page matches the picture before the update."
                    },
                    "required_match": {
                      "type": "integer",
                      "minimum": 50,
                      "maximum": 100,
                      "default": 95,
                      "description": "How much this page had to match. `ok` is true when `match_percent` reaches it."
                    },
                    "limit_percent": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 300,
                      "description": "One plain sentence, for example \"The page answered 500 after the update\"."
                    },
                    "before_key": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 300
                    },
                    "after_key": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 300
                    },
                    "diff_key": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 300
                    }
                  },
                  "required": [
                    "path",
                    "width",
                    "changed_percent",
                    "match_percent",
                    "required_match",
                    "limit_percent",
                    "ok",
                    "reason",
                    "before_key",
                    "after_key",
                    "diff_key"
                  ]
                },
                "default": [],
                "description": "Safe Updates only: one row per page and width. Empty for a daily run."
              },
              "visual_note": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 300,
                "default": null,
                "description": "Safe Updates only: why the pictures were not compared, when they were not."
              },
              "ai": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "used": {
                    "type": "boolean",
                    "description": "False when no model answered: the threshold rule decided alone."
                  },
                  "verdict": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "pass",
                      "fail"
                    ]
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 300
                  },
                  "model": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 80
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 300,
                    "description": "One plain sentence when the review did not run, for example \"The AI review was not available\"."
                  }
                },
                "required": [
                  "used",
                  "verdict",
                  "reason",
                  "model",
                  "note"
                ],
                "default": null
              },
              "deploy": {
                "type": "object",
                "properties": {
                  "requested": {
                    "type": "boolean"
                  },
                  "result": {
                    "type": "string",
                    "enum": [
                      "not_requested",
                      "deployed",
                      "skipped",
                      "failed"
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 300,
                    "description": "One plain sentence, such as \"Staging had other changes, so live was not updated.\""
                  },
                  "sha": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "requested",
                  "result",
                  "note",
                  "sha"
                ],
                "default": {
                  "requested": false,
                  "result": "not_requested",
                  "note": null,
                  "sha": null
                }
              },
              "required_match": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100,
                "default": null,
                "description": "The lowest requirement among the pages compared, in percent. Null for a run with no pictures."
              },
              "confirm_until": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "default": null,
                "description": "A run that waits for confirmation: when WP Waterfall puts the site back if nobody answers."
              },
              "pictures_kept": {
                "type": "boolean",
                "default": false,
                "description": "False once the pictures of the run are deleted (the run finished, was turned down, or expired)."
              },
              "leftover_keys": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 300
                },
                "maxItems": 200,
                "default": [],
                "description": "Pictures a delete missed. The daily retention task deletes them and clears the list."
              },
              "clean_before": {
                "type": [
                  "boolean",
                  "null"
                ],
                "default": null,
                "description": "SFTP mode: true when staging had no other uncommitted change, so the updates may go to live."
              },
              "skipped_by_settings": {
                "type": "integer",
                "minimum": 0,
                "default": 0,
                "description": "Updates the customer's settings leave out (an excluded plugin or theme, or a switch that is off)."
              },
              "error": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 400
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              },
              "started_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "finished_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "job_id",
              "trigger",
              "tier",
              "mode",
              "outcome",
              "summary",
              "updates",
              "commit_sha",
              "restore_point",
              "visual",
              "visual_note",
              "ai",
              "deploy",
              "required_match",
              "confirm_until",
              "pictures_kept",
              "leftover_keys",
              "clean_before",
              "skipped_by_settings",
              "error",
              "started_at",
              "finished_at"
            ]
          },
          "runs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "job_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "trigger": {
                  "type": "string",
                  "enum": [
                    "scheduled",
                    "manual",
                    "approved"
                  ]
                },
                "tier": {
                  "type": "string",
                  "enum": [
                    "plain",
                    "safe"
                  ],
                  "default": "plain"
                },
                "mode": {
                  "type": "string",
                  "enum": [
                    "git",
                    "sftp"
                  ]
                },
                "outcome": {
                  "type": "string",
                  "enum": [
                    "updated",
                    "rolled_back",
                    "failed",
                    "skipped",
                    "nothing_to_update",
                    "needs_confirmation",
                    "rejected",
                    "expired"
                  ]
                },
                "summary": {
                  "type": "string",
                  "maxLength": 400
                },
                "updates": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "plugin",
                          "theme"
                        ]
                      },
                      "slug": {
                        "type": "string"
                      },
                      "from_version": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "to_version": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "result": {
                        "type": "string",
                        "enum": [
                          "updated",
                          "failed",
                          "skipped",
                          "rolled_back"
                        ],
                        "description": "`rolled_back` is an update a check failed on. It was undone and is left out."
                      },
                      "message": {
                        "type": "string",
                        "maxLength": 300
                      }
                    },
                    "required": [
                      "kind",
                      "slug",
                      "from_version",
                      "to_version",
                      "result"
                    ]
                  }
                },
                "commit_sha": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The Git commit of a run that updated something in Git mode, or that committed to deploy."
                },
                "restore_point": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "backup_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "UUIDv7"
                    },
                    "snapshot_name": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "backup_id",
                    "snapshot_name",
                    "expires_at"
                  ]
                },
                "visual": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200,
                        "pattern": "^\\/(?!\\/)[^\\s\\\\\\u0000-\\u001f]*$"
                      },
                      "width": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      },
                      "changed_percent": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100,
                        "description": "Share of pixels that changed outside the masked regions, 0 to 100."
                      },
                      "match_percent": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100,
                        "default": 100,
                        "description": "100 minus `changed_percent`: how much of the page matches the picture before the update."
                      },
                      "required_match": {
                        "type": "integer",
                        "minimum": 50,
                        "maximum": 100,
                        "default": 95,
                        "description": "How much this page had to match. `ok` is true when `match_percent` reaches it."
                      },
                      "limit_percent": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      "ok": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 300,
                        "description": "One plain sentence, for example \"The page answered 500 after the update\"."
                      },
                      "before_key": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 300
                      },
                      "after_key": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 300
                      },
                      "diff_key": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 300
                      }
                    },
                    "required": [
                      "path",
                      "width",
                      "changed_percent",
                      "match_percent",
                      "required_match",
                      "limit_percent",
                      "ok",
                      "reason",
                      "before_key",
                      "after_key",
                      "diff_key"
                    ]
                  },
                  "default": [],
                  "description": "Safe Updates only: one row per page and width. Empty for a daily run."
                },
                "visual_note": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 300,
                  "default": null,
                  "description": "Safe Updates only: why the pictures were not compared, when they were not."
                },
                "ai": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "used": {
                      "type": "boolean",
                      "description": "False when no model answered: the threshold rule decided alone."
                    },
                    "verdict": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "pass",
                        "fail"
                      ]
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 300
                    },
                    "model": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 80
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 300,
                      "description": "One plain sentence when the review did not run, for example \"The AI review was not available\"."
                    }
                  },
                  "required": [
                    "used",
                    "verdict",
                    "reason",
                    "model",
                    "note"
                  ],
                  "default": null
                },
                "deploy": {
                  "type": "object",
                  "properties": {
                    "requested": {
                      "type": "boolean"
                    },
                    "result": {
                      "type": "string",
                      "enum": [
                        "not_requested",
                        "deployed",
                        "skipped",
                        "failed"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 300,
                      "description": "One plain sentence, such as \"Staging had other changes, so live was not updated.\""
                    },
                    "sha": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "requested",
                    "result",
                    "note",
                    "sha"
                  ],
                  "default": {
                    "requested": false,
                    "result": "not_requested",
                    "note": null,
                    "sha": null
                  }
                },
                "required_match": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100,
                  "default": null,
                  "description": "The lowest requirement among the pages compared, in percent. Null for a run with no pictures."
                },
                "confirm_until": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "default": null,
                  "description": "A run that waits for confirmation: when WP Waterfall puts the site back if nobody answers."
                },
                "pictures_kept": {
                  "type": "boolean",
                  "default": false,
                  "description": "False once the pictures of the run are deleted (the run finished, was turned down, or expired)."
                },
                "leftover_keys": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "maxItems": 200,
                  "default": [],
                  "description": "Pictures a delete missed. The daily retention task deletes them and clears the list."
                },
                "clean_before": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "default": null,
                  "description": "SFTP mode: true when staging had no other uncommitted change, so the updates may go to live."
                },
                "skipped_by_settings": {
                  "type": "integer",
                  "minimum": 0,
                  "default": 0,
                  "description": "Updates the customer's settings leave out (an excluded plugin or theme, or a switch that is off)."
                },
                "error": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string",
                      "maxLength": 400
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                },
                "started_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "finished_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "job_id",
                "trigger",
                "tier",
                "mode",
                "outcome",
                "summary",
                "updates",
                "commit_sha",
                "restore_point",
                "visual",
                "visual_note",
                "ai",
                "deploy",
                "required_match",
                "confirm_until",
                "pictures_kept",
                "leftover_keys",
                "clean_before",
                "skipped_by_settings",
                "error",
                "started_at",
                "finished_at"
              ]
            },
            "maxItems": 3,
            "default": [],
            "description": "The last runs, newest first. At most `AUTO_UPDATE_RUN_HISTORY`. The first is `last_run`."
          },
          "next_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next scheduled run starts, or null while every switch is off."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "environment_id",
          "mode",
          "supported",
          "unsupported_reason",
          "enabled",
          "tier",
          "cadence",
          "plugins",
          "themes",
          "safe",
          "deploy_to_live",
          "deploy_supported",
          "skipped",
          "last_run",
          "runs",
          "next_run_at",
          "updated_at"
        ],
        "description": "`GET /environments/{id}/auto-updates`."
      },
      "PutAutoUpdateSettingsRequest": {
        "type": "object",
        "properties": {
          "safe_enabled": {
            "type": "boolean"
          },
          "deploy_to_live": {
            "type": "boolean"
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "safe_days": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            },
            "minItems": 1,
            "maxItems": 7
          },
          "safe_hour": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23
          },
          "pages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^\\/(?!\\/)[^\\s\\\\\\u0000-\\u001f]*$"
                },
                "hide_selectors": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "pattern": "^[A-Za-z0-9_\\-\\s.#[\\]=\"':>+~*,()^$|]+$"
                  },
                  "maxItems": 20,
                  "default": [],
                  "description": "Elements taken out of the page (display none) before its picture, on this page only."
                },
                "required_match": {
                  "type": "integer",
                  "minimum": 50,
                  "maximum": 100,
                  "default": 95,
                  "description": "How much of this page must match its picture from before the update, in percent."
                }
              },
              "required": [
                "path"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 10
          },
          "exclude_selectors": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120,
              "pattern": "^[A-Za-z0-9_\\-\\s.#[\\]=\"':>+~*,()^$|]+$"
            },
            "maxItems": 20
          },
          "capture": {
            "type": "object",
            "properties": {
              "wait_seconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 15,
                "default": 2,
                "description": "Seconds to wait after the page loads and after the scroll."
              },
              "enable_animations": {
                "type": "boolean",
                "default": true,
                "description": "On: animations and scroll effects play, and the picture waits for running ones to finish. Off: animations are finished at once and frozen, and the browser is asked for reduced motion. Every page is scrolled down and back to the top before its picture, whatever this says."
              },
              "flatten_sticky": {
                "type": "boolean",
                "default": false,
                "description": "Make fixed and sticky elements part of the flow for the picture."
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false,
        "description": "`PUT /environments/{id}/auto-updates`. Every field is optional: a field left out keeps its value. The switches have their own routes. Turning Safe Updates on needs the add-on, and turns on the switch for every plugin and theme when all switches are off."
      },
      "AutoUpdateRunNowRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "`POST /environments/{id}/auto-updates/run`."
      },
      "AutoUpdateApplyRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "plugin",
              "theme"
            ]
          },
          "slug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
          }
        },
        "required": [
          "kind",
          "slug"
        ],
        "additionalProperties": false,
        "description": "`POST /environments/{id}/auto-updates/apply`: apply one held update anyway."
      },
      "AutoUpdatePictureLink": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "expires_in_seconds": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "url",
          "expires_in_seconds"
        ]
      },
      "AutoUpdateRecommendedPages": {
        "type": "object",
        "properties": {
          "pages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^\\/(?!\\/)[^\\s\\\\\\u0000-\\u001f]*$"
                },
                "visits": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Visits in the last 30 days. Null for the home page without data and for a found page."
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "home",
                    "analytics",
                    "discovered"
                  ]
                }
              },
              "required": [
                "path",
                "visits",
                "source"
              ]
            },
            "minItems": 1,
            "maxItems": 10
          },
          "from_analytics": {
            "type": "boolean",
            "description": "True when at least one page comes from the site's analytics."
          },
          "discovered": {
            "type": "boolean",
            "description": "True when at least one page was found on the site itself."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "One plain sentence when finding pages was not possible or was cut short. Null otherwise."
          }
        },
        "required": [
          "pages",
          "from_analytics",
          "discovered",
          "note"
        ],
        "description": "`GET /environments/{id}/auto-updates/recommended-pages`: the pages to test. The home page first, then the most visited pages of the last 30 days from the site's analytics, then, when those are fewer than 10, pages found on the site itself (links on the rendered home page), up to 10 in all."
      },
      "AutoUpdatePreviewRequest": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^\\/(?!\\/)[^\\s\\\\\\u0000-\\u001f]*$"
          },
          "exclude_selectors": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120,
              "pattern": "^[A-Za-z0-9_\\-\\s.#[\\]=\"':>+~*,()^$|]+$"
            },
            "maxItems": 20
          },
          "required_match": {
            "type": "integer",
            "minimum": 50,
            "maximum": 100,
            "description": "What this page must match. Left out, the saved requirement of the page, or 95."
          },
          "capture": {
            "type": "object",
            "properties": {
              "wait_seconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 15,
                "default": 2,
                "description": "Seconds to wait after the page loads and after the scroll."
              },
              "enable_animations": {
                "type": "boolean",
                "default": true,
                "description": "On: animations and scroll effects play, and the picture waits for running ones to finish. Off: animations are finished at once and frozen, and the browser is asked for reduced motion. Every page is scrolled down and back to the top before its picture, whatever this says."
              },
              "flatten_sticky": {
                "type": "boolean",
                "default": false,
                "description": "Make fixed and sticky elements part of the flow for the picture."
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "path"
        ],
        "additionalProperties": false,
        "description": "`POST /environments/{id}/auto-updates/preview`: tests one page twice, a few seconds apart, with the exclusions and capture settings given (or the saved ones), so the customer sees what changes by itself."
      },
      "AutoUpdatePreview": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^\\/(?!\\/)[^\\s\\\\\\u0000-\\u001f]*$"
          },
          "dynamic_found": {
            "type": "boolean",
            "description": "True when the two pictures differ outside the excluded parts."
          },
          "match_percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "required_match": {
            "type": "integer",
            "minimum": 50,
            "maximum": 100,
            "description": "The requirement of the page that was tested: its own, or 95."
          },
          "diff_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "The difference picture, as a key for the picture route. Null when nothing differs or no store."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "One plain sentence when the page could not be tested or the capture was cut short."
          }
        },
        "required": [
          "path",
          "dynamic_found",
          "match_percent",
          "required_match",
          "diff_key",
          "note"
        ]
      },
      "AutoUpdateResolveRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "confirm"
        ],
        "additionalProperties": false,
        "description": "`POST /sites/{id}/auto-updates/runs/{run_id}/approve` and `.../reject`: the answer to a run that waits for confirmation. `confirm` must be true. Approve deploys the staged updates to live when the run was set up to deploy, and keeps them on staging otherwise. Reject puts the restore point back on staging."
      },
      "AccessibilityState": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid"
          },
          "enabled": {
            "type": "boolean"
          },
          "eligible": {
            "type": "boolean",
            "description": "False while the site has no live environment to scan."
          },
          "ineligible_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "pages_per_scan": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2500
          },
          "max_pages_per_scan": {
            "type": "integer"
          },
          "scheduled_weekly": {
            "type": "boolean"
          },
          "next_scheduled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "allowance": {
            "type": "object",
            "properties": {
              "month": {
                "type": "string"
              },
              "cap": {
                "type": "integer"
              },
              "used": {
                "type": "integer",
                "minimum": 0
              },
              "left": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "month",
              "cap",
              "used",
              "left"
            ]
          },
          "pricing": {
            "type": "object",
            "properties": {
              "lookup_key": {
                "type": "string"
              },
              "first_tier_sites": {
                "type": "integer"
              },
              "first_tier_cents": {
                "type": "integer"
              },
              "next_tier_cents": {
                "type": "integer"
              },
              "sites_on": {
                "type": "integer",
                "minimum": 0,
                "description": "Sites of this company that have it on."
              },
              "monthly_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "What the company pays a month now."
              },
              "next_site_cents": {
                "type": "integer",
                "description": "What turning it on for one more site adds a month."
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "lookup_key",
              "first_tier_sites",
              "first_tier_cents",
              "next_tier_cents",
              "sites_on",
              "monthly_cents",
              "next_site_cents",
              "text"
            ]
          },
          "page_list": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 0,
                "description": "Pages that will be scanned, the removed ones left out."
              },
              "discovered_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "discovery": {
                "type": "string",
                "enum": [
                  "idle",
                  "running",
                  "failed"
                ]
              }
            },
            "required": [
              "count",
              "discovered_at",
              "discovery"
            ]
          },
          "active_scan_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "latest_scan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AccessibilityScan"
              },
              {
                "type": "null"
              }
            ]
          },
          "score_formula": {
            "type": "string"
          }
        },
        "required": [
          "site_id",
          "enabled",
          "eligible",
          "ineligible_reason",
          "pages_per_scan",
          "max_pages_per_scan",
          "scheduled_weekly",
          "next_scheduled_at",
          "allowance",
          "pricing",
          "page_list",
          "active_scan_id",
          "latest_scan",
          "score_formula"
        ]
      },
      "PutAccessibilitySettingsRequest": {
        "type": "object",
        "properties": {
          "pages_per_scan": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2500
          },
          "scheduled_weekly": {
            "type": "boolean"
          }
        }
      },
      "EnableAccessibilityRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true,
            "description": "Turning the add-on on adds to the monthly charge. Send true to agree."
          },
          "pages_per_scan": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2500
          }
        },
        "required": [
          "confirm"
        ]
      },
      "CreateAccessibilityScanRequest": {
        "type": "object",
        "properties": {
          "max_pages": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2500,
            "description": "Pages to scan. Default: the site's pages per scan setting."
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            },
            "minItems": 1,
            "maxItems": 2500,
            "description": "Scan exactly these pages of the live site instead of the page list."
          }
        }
      },
      "AddAccessibilityPagesRequest": {
        "type": "object",
        "properties": {
          "urls": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "required": [
          "urls"
        ]
      },
      "AccessibilityPageList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "url": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "home",
                    "sitemap",
                    "link",
                    "added"
                  ]
                },
                "last_seen_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "url",
                "source",
                "last_seen_at"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Pages in the list, the removed ones left out."
          },
          "discovered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "discovery": {
            "type": "string",
            "enum": [
              "idle",
              "running",
              "failed"
            ]
          },
          "hosts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The site's own live hostnames. Only these can be scanned."
          }
        },
        "required": [
          "data",
          "next_cursor",
          "total",
          "discovered_at",
          "discovery",
          "hosts"
        ]
      },
      "AccessibilityScan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "site_id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "audit",
              "discover"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "discovering",
              "running",
              "done",
              "partial",
              "failed"
            ]
          },
          "trigger": {
            "type": "string",
            "enum": [
              "manual",
              "scheduled"
            ]
          },
          "requested_by": {
            "type": "string",
            "description": "Who started it: a person's name, a key's name, or Schedule."
          },
          "month": {
            "type": "string",
            "description": "The calendar month (UTC) the pages count toward."
          },
          "pages_requested": {
            "type": "integer",
            "minimum": 0
          },
          "pages_total": {
            "type": "integer",
            "minimum": 0,
            "description": "Pages in this scan once the list is known."
          },
          "pages_done": {
            "type": "integer",
            "minimum": 0
          },
          "pages_failed": {
            "type": "integer",
            "minimum": 0
          },
          "batches_total": {
            "type": "integer",
            "minimum": 0
          },
          "batches_done": {
            "type": "integer",
            "minimum": 0
          },
          "progress_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "score": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Excellent, Good, Needs work, or Poor."
          },
          "counts": {
            "type": "object",
            "properties": {
              "critical": {
                "type": "integer",
                "minimum": 0
              },
              "serious": {
                "type": "integer",
                "minimum": 0
              },
              "moderate": {
                "type": "integer",
                "minimum": 0
              },
              "minor": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "critical",
              "serious",
              "moderate",
              "minor"
            ],
            "description": "Issues (failing elements) by impact."
          },
          "issue_count": {
            "type": "integer",
            "minimum": 0
          },
          "rule_count": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "screenshots_expire_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "site_id",
          "kind",
          "status",
          "trigger",
          "requested_by",
          "month",
          "pages_requested",
          "pages_total",
          "pages_done",
          "pages_failed",
          "batches_total",
          "batches_done",
          "progress_percent",
          "score",
          "label",
          "counts",
          "issue_count",
          "rule_count",
          "error",
          "job_id",
          "created_at",
          "started_at",
          "finished_at",
          "screenshots_expire_at"
        ]
      },
      "AccessibilityScanList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessibilityScan"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AccessibilityScanPage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "scan_id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "home": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "scanned",
              "failed"
            ]
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "score": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "counts": {
            "type": "object",
            "properties": {
              "critical": {
                "type": "integer",
                "minimum": 0
              },
              "serious": {
                "type": "integer",
                "minimum": 0
              },
              "moderate": {
                "type": "integer",
                "minimum": 0
              },
              "minor": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "critical",
              "serious",
              "moderate",
              "minor"
            ]
          },
          "issue_count": {
            "type": "integer",
            "minimum": 0
          },
          "screenshot": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              }
            },
            "required": [
              "width",
              "height"
            ],
            "description": "Present while the picture is kept (90 days)."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "scan_id",
          "url",
          "home",
          "status",
          "http_status",
          "error",
          "score",
          "label",
          "counts",
          "issue_count",
          "screenshot",
          "duration_ms"
        ]
      },
      "AccessibilityScanPageList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessibilityScanPage"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AccessibilityIssueList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "scan_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "page_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "page_url": {
                  "type": "string"
                },
                "rule_id": {
                  "type": "string"
                },
                "impact": {
                  "type": "string",
                  "enum": [
                    "critical",
                    "serious",
                    "moderate",
                    "minor"
                  ]
                },
                "help": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "help_url": {
                  "type": "string"
                },
                "wcag": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "WCAG success criteria such as 1.4.3."
                },
                "wcag_level": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "A",
                    "AA",
                    "AAA"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "selector": {
                  "type": "string",
                  "description": "The CSS selector of the failing element (iframes and shadow roots joined with ' >>> ')."
                },
                "html": {
                  "type": "string",
                  "description": "The element's HTML, cut to 500 characters. Page content: show it as plain text, never as HTML."
                },
                "failure_summary": {
                  "type": "string",
                  "description": "What failed, from axe. Page content: plain text only."
                },
                "fix_hint": {
                  "type": "string"
                },
                "box": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    },
                    "width": {
                      "type": "number",
                      "minimum": 0
                    },
                    "height": {
                      "type": "number",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "x",
                    "y",
                    "width",
                    "height"
                  ],
                  "description": "The element's box in pixels of the page picture: x and y from its top left corner."
                }
              },
              "required": [
                "id",
                "scan_id",
                "page_id",
                "page_url",
                "rule_id",
                "impact",
                "help",
                "description",
                "help_url",
                "wcag",
                "wcag_level",
                "tags",
                "selector",
                "html",
                "failure_summary",
                "fix_hint",
                "box"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AccessibilityRuleList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rule_id": {
                  "type": "string"
                },
                "impact": {
                  "type": "string",
                  "enum": [
                    "critical",
                    "serious",
                    "moderate",
                    "minor"
                  ]
                },
                "help": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "help_url": {
                  "type": "string"
                },
                "wcag": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "fix_hint": {
                  "type": "string"
                },
                "node_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "page_count": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "rule_id",
                "impact",
                "help",
                "description",
                "help_url",
                "wcag",
                "fix_hint",
                "node_count",
                "page_count"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AccessibilityScreenshotLink": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "expires_in_seconds": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          }
        },
        "required": [
          "url",
          "expires_in_seconds",
          "width",
          "height"
        ]
      },
      "AccessibilityReport": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid"
          },
          "site_name": {
            "type": "string"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "scan": {
            "$ref": "#/components/schemas/AccessibilityScan"
          },
          "score_formula": {
            "type": "string"
          },
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessibilityScanPage"
            }
          },
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rule_id": {
                  "type": "string"
                },
                "impact": {
                  "type": "string",
                  "enum": [
                    "critical",
                    "serious",
                    "moderate",
                    "minor"
                  ]
                },
                "help": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "help_url": {
                  "type": "string"
                },
                "wcag": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "fix_hint": {
                  "type": "string"
                },
                "node_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "page_count": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "rule_id",
                "impact",
                "help",
                "description",
                "help_url",
                "wcag",
                "fix_hint",
                "node_count",
                "page_count"
              ]
            }
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "scan_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "page_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "page_url": {
                  "type": "string"
                },
                "rule_id": {
                  "type": "string"
                },
                "impact": {
                  "type": "string",
                  "enum": [
                    "critical",
                    "serious",
                    "moderate",
                    "minor"
                  ]
                },
                "help": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "help_url": {
                  "type": "string"
                },
                "wcag": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "WCAG success criteria such as 1.4.3."
                },
                "wcag_level": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "A",
                    "AA",
                    "AAA"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "selector": {
                  "type": "string",
                  "description": "The CSS selector of the failing element (iframes and shadow roots joined with ' >>> ')."
                },
                "html": {
                  "type": "string",
                  "description": "The element's HTML, cut to 500 characters. Page content: show it as plain text, never as HTML."
                },
                "failure_summary": {
                  "type": "string",
                  "description": "What failed, from axe. Page content: plain text only."
                },
                "fix_hint": {
                  "type": "string"
                },
                "box": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    },
                    "width": {
                      "type": "number",
                      "minimum": 0
                    },
                    "height": {
                      "type": "number",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "x",
                    "y",
                    "width",
                    "height"
                  ],
                  "description": "The element's box in pixels of the page picture: x and y from its top left corner."
                }
              },
              "required": [
                "id",
                "scan_id",
                "page_id",
                "page_url",
                "rule_id",
                "impact",
                "help",
                "description",
                "help_url",
                "wcag",
                "wcag_level",
                "tags",
                "selector",
                "html",
                "failure_summary",
                "fix_hint",
                "box"
              ]
            }
          },
          "issues_truncated": {
            "type": "boolean",
            "description": "True when the export holds the first part of a very large list."
          }
        },
        "required": [
          "site_id",
          "site_name",
          "generated_at",
          "scan",
          "score_formula",
          "pages",
          "rules",
          "issues",
          "issues_truncated"
        ],
        "description": "The report as the json export writes it."
      },
      "StartAuditExportRequest": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the range, inclusive (RFC 3339). Not before the retention window."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the range, inclusive. Defaults to now."
          },
          "format": {
            "type": "string",
            "enum": [
              "csv",
              "ndjson"
            ],
            "default": "csv"
          },
          "actor": {
            "type": "string",
            "maxLength": 200,
            "description": "Keep only what one person or API key did (the id on the activity list)."
          },
          "action": {
            "type": "string",
            "maxLength": 200,
            "description": "Keep only one action name, such as `POST /v1/sites`."
          }
        },
        "required": [
          "from"
        ]
      },
      "AuditExportRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "building",
              "ready",
              "failed",
              "expired"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "csv",
              "ndjson"
            ]
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "actor": {
            "type": [
              "string",
              "null"
            ]
          },
          "action": {
            "type": [
              "string",
              "null"
            ]
          },
          "requested_by": {
            "type": "string"
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "ready_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the file leaves storage. Null until it is ready."
          },
          "rows": {
            "type": [
              "integer",
              "null"
            ]
          },
          "size_bytes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "truncated": {
            "type": "boolean",
            "description": "True when the file stopped at the row limit of the company's tier."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why a failed export failed, in plain words."
          },
          "download_count": {
            "type": "integer"
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "required": [
          "id",
          "status",
          "format",
          "from",
          "to",
          "actor",
          "action",
          "requested_by",
          "requested_at",
          "ready_at",
          "expires_at",
          "rows",
          "size_bytes",
          "truncated",
          "error",
          "download_count",
          "job_id"
        ]
      },
      "AuditExportRequestList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditExportRequest"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "AuditExportLimits": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "small",
              "medium",
              "large"
            ]
          },
          "max_rows": {
            "type": "integer"
          },
          "per_day": {
            "type": "integer"
          },
          "used_today": {
            "type": "integer"
          },
          "retention_days": {
            "type": "integer"
          },
          "file_hours": {
            "type": "integer"
          }
        },
        "required": [
          "tier",
          "max_rows",
          "per_day",
          "used_today",
          "retention_days",
          "file_hours"
        ],
        "description": "What a company may do now: the limits of its tier and what is in use."
      },
      "AuditExportDownloadLink": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "filename": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "expires_at",
          "filename"
        ]
      },
      "IntegrityLatest": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid"
          },
          "latest": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "clean",
                  "suspicious",
                  "incomplete"
                ]
              },
              "core": {
                "type": "string",
                "enum": [
                  "verified",
                  "modified",
                  "unavailable"
                ],
                "description": "WordPress core against the official checksums."
              },
              "plugins": {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "verified",
                      "modified",
                      "unavailable"
                    ]
                  },
                  "verified": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Plugins whose files all matched."
                  },
                  "modified": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Plugins with at least one file that did not match."
                  },
                  "unverified": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Plugins with no official checksums, such as a premium plugin."
                  }
                },
                "required": [
                  "state",
                  "verified",
                  "modified",
                  "unverified"
                ]
              },
              "release": {
                "type": "string",
                "enum": [
                  "compared",
                  "not_applicable",
                  "unavailable"
                ],
                "description": "Whether the release comparison ran: only for code that is a read-only Git mode release."
              },
              "files_scanned": {
                "type": "boolean",
                "description": "False when the uploads and web root scans could not run."
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "core_modified",
                        "core_added",
                        "core_missing",
                        "plugin_modified",
                        "plugin_added",
                        "plugin_missing",
                        "php_in_uploads",
                        "webshell_name",
                        "hidden_php",
                        "release_changed"
                      ]
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "suspicious",
                        "note"
                      ]
                    },
                    "path": {
                      "type": "string",
                      "maxLength": 300,
                      "description": "A path inside the site, without a leading slash."
                    },
                    "detail": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "One short plain sentence."
                    }
                  },
                  "required": [
                    "kind",
                    "severity",
                    "path",
                    "detail"
                  ]
                },
                "maxItems": 200
              },
              "finding_count": {
                "type": "integer",
                "minimum": 0,
                "description": "The real number of findings, which can be more than `findings` holds."
              },
              "suspicious_count": {
                "type": "integer",
                "minimum": 0,
                "description": "How many of them are `suspicious` and not `note`."
              },
              "truncated": {
                "type": "boolean"
              },
              "duration_ms": {
                "type": "integer",
                "minimum": 0
              },
              "job_id": {
                "type": "string",
                "format": "uuid"
              },
              "checked_at": {
                "type": "string",
                "format": "date-time"
              },
              "source": {
                "type": "string",
                "enum": [
                  "manual",
                  "scheduled"
                ]
              }
            },
            "required": [
              "status",
              "core",
              "plugins",
              "release",
              "files_scanned",
              "findings",
              "finding_count",
              "suspicious_count",
              "truncated",
              "duration_ms",
              "job_id",
              "checked_at",
              "source"
            ],
            "description": "Null until a check has run."
          }
        },
        "required": [
          "environment_id",
          "latest"
        ]
      },
      "MalwareFinding": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "path": {
            "type": "string",
            "maxLength": 1024
          },
          "reason": {
            "type": "string",
            "maxLength": 300
          },
          "severity": {
            "type": "string",
            "enum": [
              "known_bad",
              "worth_a_look"
            ]
          },
          "engine": {
            "type": "string",
            "enum": [
              "clamav",
              "rules"
            ]
          },
          "signature": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "source": {
            "type": "string",
            "enum": [
              "site_scan",
              "deploy",
              "upload",
              "install",
              "migration",
              "database_scan"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "quarantined",
              "reported",
              "blocked",
              "disputed",
              "restored",
              "confirmed"
            ]
          },
          "restorable": {
            "type": "boolean",
            "description": "True when staff can put the file back (it is in quarantine on the node)."
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "detected_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "database": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "option",
                  "post",
                  "user",
                  "usermeta",
                  "statement",
                  "meta",
                  "comment",
                  "link"
                ]
              },
              "table": {
                "type": "string",
                "maxLength": 64
              },
              "column": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 64
              },
              "key_column": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 64,
                "description": "The column the row keys are values of: `option_name`, `ID`, `user_login`, `meta_id`, and so on."
              },
              "keys": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 191
                },
                "maxItems": 20,
                "description": "The first row keys, at most 20."
              },
              "rows": {
                "type": "integer",
                "minimum": 0,
                "description": "How many rows the finding stands for. 0 when unknown."
              },
              "excerpt": {
                "type": "string",
                "maxLength": 240
              }
            },
            "required": [
              "kind",
              "table",
              "column",
              "key_column",
              "keys",
              "rows",
              "excerpt"
            ],
            "description": "For a finding in the database (`source: database_scan`): where the row is. Null for a file."
          },
          "category": {
            "type": "string",
            "enum": [
              "malware",
              "differs",
              "nulled"
            ],
            "description": "What the finding is about. A database finding is `malware`, as a file finding is."
          }
        },
        "required": [
          "id",
          "site_id",
          "environment_id",
          "path",
          "reason",
          "severity",
          "engine",
          "signature",
          "source",
          "status",
          "restorable",
          "job_id",
          "detected_at",
          "resolved_at",
          "category"
        ]
      },
      "MalwareFindingList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MalwareFinding"
            }
          },
          "last_scan": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "job_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "status": {
                "type": "string",
                "enum": [
                  "succeeded",
                  "failed",
                  "running",
                  "queued"
                ]
              },
              "files_seen": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              }
            },
            "required": [
              "at",
              "job_id",
              "status",
              "files_seen"
            ],
            "description": "The last node scan of this environment, or null when none ran yet."
          },
          "last_database_scan": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "UUIDv7"
              },
              "status": {
                "type": "string",
                "enum": [
                  "clean",
                  "findings",
                  "partial",
                  "failed"
                ]
              },
              "partial": {
                "type": "boolean",
                "description": "True when part of the database was not read. A scan with findings can be partial too."
              },
              "tables": {
                "type": "integer",
                "minimum": 0
              },
              "rows": {
                "type": "integer",
                "minimum": 0,
                "description": "Settings, posts, and accounts read."
              },
              "findings": {
                "type": "integer",
                "minimum": 0,
                "description": "Rows flagged in this scan."
              }
            },
            "required": [
              "at",
              "job_id",
              "status",
              "partial",
              "tables",
              "rows",
              "findings"
            ],
            "description": "The last database scan of this environment, or null when none ran yet."
          }
        },
        "required": [
          "data",
          "last_scan"
        ]
      },
      "DisputeMalwareFindingRequest": {
        "type": "object",
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "DisasterRecovery": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "purchased": {
            "type": "boolean",
            "description": "True when the add-on is on this site's subscription."
          },
          "state": {
            "type": "string",
            "enum": [
              "off",
              "setting_up",
              "active",
              "failing_over",
              "degraded",
              "resyncing",
              "failing_back"
            ]
          },
          "setup_step": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "queued",
              "finding_standby",
              "waiting_for_standby",
              "copying",
              "verifying",
              "done"
            ],
            "description": "The step of the first setup, while `state` is `setting_up`. Null otherwise."
          },
          "monthly_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The price of the add-on in cents a month."
          },
          "sla_applies": {
            "type": "boolean",
            "description": "True only while the state is `active`: the standby copy is ready to take over. It is not an uptime guarantee."
          },
          "standby": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "provider": {
                "type": "string"
              },
              "location": {
                "type": "string"
              }
            },
            "required": [
              "provider",
              "location"
            ],
            "description": "Where the standby copy lives: the provider's name and metro area, or null before one is chosen."
          },
          "replication": {
            "type": "object",
            "properties": {
              "lag_seconds": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Seconds since the newest copy on the standby, or null when none arrived yet."
              },
              "rpo_seconds": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "last_replicated_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "lag_seconds",
              "rpo_seconds",
              "last_replicated_at"
            ]
          },
          "last_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "active_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_failover_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "running_on": {
            "type": "string",
            "enum": [
              "primary",
              "standby"
            ],
            "description": "Where the live container runs now. `standby` from a failover until a failback or a role swap."
          },
          "epoch": {
            "type": "integer",
            "minimum": 0,
            "description": "The fencing epoch. It rises by one at every promotion and every role swap."
          },
          "failback_due_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the automatic failback is due (the resync is done and the stability window runs), or null."
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job that sets up or repairs the standby, while one runs."
          },
          "problem": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why setup stopped, in plain words. Null when nothing is wrong."
          }
        },
        "required": [
          "environment_id",
          "site_id",
          "purchased",
          "state",
          "setup_step",
          "monthly_cents",
          "sla_applies",
          "standby",
          "replication",
          "last_verified_at",
          "active_since",
          "last_failover_at",
          "running_on",
          "epoch",
          "failback_due_at",
          "job_id",
          "problem"
        ],
        "description": "`GET /v1/environments/{id}/disaster-recovery`."
      },
      "HaFailbackRequest": {
        "type": "object",
        "properties": {
          "role_swap": {
            "type": "boolean",
            "default": false,
            "description": "Keep the standby as the new primary and make the old primary the standby."
          },
          "confirm": {
            "type": "boolean",
            "description": "The MCP server and API keys send it."
          }
        },
        "additionalProperties": false,
        "description": "`POST /v1/environments/{id}/disaster-recovery/failback`: bring the site back to its home server early, or swap the roles so the standby stays the primary. Owners and admins only. The failback is never blind: it waits for the old primary to be resynced and healthy."
      },
      "UptimeReport": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string",
            "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
            "description": "The month this report describes, in UTC."
          },
          "uptime_percent": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Null until the probes have measured the month."
          },
          "downtime_minutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "incidents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "started_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "ended_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "The first good check. Null while the site is still down."
                },
                "minutes": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "The whole minutes that count: the daily window and any paused time are left out."
                }
              },
              "required": [
                "started_at",
                "ended_at",
                "minutes"
              ]
            },
            "maxItems": 100,
            "description": "This month's downtime that counts, oldest first."
          }
        },
        "required": [
          "month",
          "uptime_percent",
          "downtime_minutes",
          "incidents"
        ],
        "description": "`GET /v1/environments/{id}/disaster-recovery/uptime`."
      },
      "EnterpriseSupportStatus": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "included",
              "add_on"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "True once the support is on: always for an Enterprise account, after a purchase otherwise."
          },
          "monthly_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "The price of the add-on in cents a month. Null when the support is included."
          },
          "purchase": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "addon_id": {
                "type": "string",
                "format": "uuid",
                "description": "The commerce add-on record."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "active"
                ]
              },
              "quantity": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "monthly_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "The charge for the whole purchase per `price_unit`, in cents: per month, or per year for a yearly add-on. The name is kept for existing readers."
              },
              "price_unit": {
                "type": "string",
                "enum": [
                  "month",
                  "year",
                  "backup"
                ],
                "description": "What `monthly_cents` is per. `month` unless the add-on is billed yearly."
              },
              "renews_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When a yearly add-on renews, and when its current year ends. Null for monthly add-ons."
              },
              "environment_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "complimentary": {
                "type": "boolean",
                "description": "True when WP Waterfall support turned the add-on on at no charge. Absent or false when it is paid."
              },
              "added_gb": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Additional disk space only: GB added to the account."
              },
              "added_mb": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "PHP Performance only: MB added to the pool of the live environment."
              },
              "covers_gb": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "Standby Failover only: the site size in GB this purchase covers (50 for the $300 base price, 100 for $400, and so on). A purchase made before size based pricing covers 50 GB."
              },
              "node_status": {
                "type": "string",
                "enum": [
                  "applied",
                  "applying",
                  "failed",
                  "none"
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "addon_id",
              "status",
              "quantity",
              "monthly_cents",
              "environment_id",
              "added_gb",
              "node_status",
              "created_at"
            ],
            "description": "The add-on purchase that is on now. Null while it is off and for an included account."
          },
          "support": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "setting_up",
                  "ready"
                ]
              },
              "slack_channel": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The channel name, or the link as staff entered it. Null until staff enter it."
              },
              "slack_url": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Set when the channel is a Slack link, so the dashboard can open it."
              },
              "contact_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "contact_email": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "status",
              "slack_channel",
              "slack_url",
              "contact_name",
              "contact_email"
            ],
            "description": "The Slack channel and the support contact. Null while the support is off."
          }
        },
        "required": [
          "mode",
          "enabled",
          "monthly_cents",
          "purchase",
          "support"
        ],
        "description": "`GET /companies/me/enterprise-support`: where the company's Enterprise Support stands."
      },
      "EnableEnterpriseSupportRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "description": "The MCP server and API keys send it. The dashboard confirms in its own dialog."
          }
        },
        "additionalProperties": false,
        "description": "`POST /companies/me/enterprise-support`: turn the support on. For a company that buys it, the month is charged to the saved card now. For an Enterprise account it charges nothing and asks for the dedicated Slack channel."
      },
      "EnterpriseSupportChange": {
        "type": "object",
        "properties": {
          "support": {
            "$ref": "#/components/schemas/EnterpriseSupportStatus"
          },
          "proration_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Cents added to the next invoice now."
          },
          "credit_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Cents credited to the account for unused days."
          }
        },
        "required": [
          "support",
          "proration_cents",
          "credit_cents"
        ],
        "description": "What `POST` and `DELETE /companies/me/enterprise-support` did."
      },
      "EnvironmentUptime": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "tool_enabled": {
            "type": "boolean",
            "description": "False while the Monitor tool is off. The site is not asked, and nobody is told."
          },
          "data_center": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "group": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "operational",
                  "degraded",
                  "partial_outage",
                  "major_outage",
                  "maintenance",
                  "no_data"
                ]
              },
              "uptime_percent": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100,
                "description": "Uptime as a percent with two decimals, over the minutes that were measured in the last 90 days. A day nobody measured counts for nothing. Null when nothing was monitored."
              },
              "days": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string",
                      "description": "UTC date, YYYY-MM-DD."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "operational",
                        "degraded",
                        "partial_outage",
                        "major_outage",
                        "no_data"
                      ],
                      "description": "`no_data` means no minute of this day was measured. The API says so. The status page draws such a day blue with \"No issues reported\", as the owner decided on 2026-10-21, and never counts it in the uptime percent."
                    },
                    "outage_minutes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "degraded_minutes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "maintenance_minutes": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "description": "Minutes held in planned maintenance. Not downtime. Left out when zero."
                    },
                    "incidents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "title"
                        ]
                      },
                      "maxItems": 3,
                      "description": "Incidents that touched the component this day, up to three. Left out when there were none."
                    }
                  },
                  "required": [
                    "date",
                    "status",
                    "outage_minutes",
                    "degraded_minutes"
                  ]
                },
                "description": "Oldest day first, 90 entries ending today (UTC)."
              },
              "measured_days": {
                "type": "integer",
                "minimum": 0,
                "maximum": 90,
                "description": "Days of the 90 with at least one measured minute. Under 90 means the percent is \"since\"."
              },
              "measured_since": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The first UTC date of the 90 that was measured, or null when none was."
              },
              "measured_by": {
                "type": "string",
                "enum": [
                  "probes",
                  "provider"
                ],
                "description": "Where the row's status and days come from. `probes`: our own checks. `provider`: a data center where we run no server, read from Google Cloud's public incident record for its region. In a data center row measured by `probes`, a day our checks did not measure comes from that record too. The API always sends it. Left out by an older API, it means `probes`."
              },
              "history_start": {
                "type": "string",
                "description": "The first UTC date of the public history, when staff set one. Days before it are `no_data`, hold no minutes and no incident, and count for nothing. Left out when none is set."
              }
            },
            "required": [
              "id",
              "name",
              "group",
              "status",
              "uptime_percent",
              "days"
            ],
            "description": "The row of the data center this environment runs in, as the status page shows it. Null when the status page does not list one: the environment has no server yet, or runs on a dedicated server in a data center with no shared server."
          },
          "status_url": {
            "type": "string",
            "format": "uri",
            "description": "The public status page."
          }
        },
        "required": [
          "environment_id",
          "tool_enabled",
          "data_center",
          "status_url"
        ]
      },
      "PutUptimeToolRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "The Monitor tool in Tools: on asks the live site every minute, off stops every ask."
      },
      "UptimeToolResult": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "tool_enabled": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "environment_id",
          "tool_enabled",
          "message"
        ],
        "description": "The answer to `PUT /v1/environments/{id}/tools/uptime`."
      },
      "CurrentIncident": {
        "type": "object",
        "properties": {
          "incident": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "The status incident."
              },
              "title": {
                "type": "string",
                "description": "The incident's own sentence, as the status page shows it."
              },
              "url": {
                "type": "string",
                "description": "The incident's page on the status page."
              }
            },
            "required": [
              "id",
              "title",
              "url"
            ],
            "description": "The newest public incident that affects the company's sites, or null when none does. A held incident, a false alarm, and a hidden or resolved one are never shown."
          }
        },
        "required": [
          "incident"
        ],
        "description": "The customer's line: the newest public incident that touches the company's sites, or null."
      },
      "PagespeedOverview": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "available": {
            "type": "boolean"
          },
          "tool_enabled": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "live_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "report_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "The full report on PageSpeed Insights, or null without a live address."
          },
          "latest": {
            "type": "object",
            "properties": {
              "mobile": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PagespeedRun"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "desktop": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PagespeedRun"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "mobile",
              "desktop"
            ],
            "description": "The newest finished run of each strategy."
          },
          "active": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PagespeedRun"
            },
            "description": "Runs queued or running now."
          },
          "failed": {
            "type": "object",
            "properties": {
              "mobile": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PagespeedRun"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "desktop": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PagespeedRun"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "mobile",
              "desktop"
            ],
            "description": "The newest failed run of each strategy that is newer than its finished one, for the failure sentence."
          },
          "next_manual_at": {
            "type": "object",
            "properties": {
              "mobile": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "desktop": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "mobile",
              "desktop"
            ],
            "description": "The earliest time a manual test of each strategy may start again, or null when it may start now."
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "run_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "strategy": {
                  "type": "string",
                  "enum": [
                    "mobile",
                    "desktop"
                  ]
                },
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "performance": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100
                },
                "lcp_ms": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                }
              },
              "required": [
                "run_id",
                "strategy",
                "at",
                "performance",
                "lcp_ms"
              ]
            }
          },
          "retention_days": {
            "type": "integer"
          }
        },
        "required": [
          "site_id",
          "environment_id",
          "available",
          "tool_enabled",
          "reason",
          "live_url",
          "report_url",
          "latest",
          "active",
          "failed",
          "next_manual_at",
          "history",
          "retention_days"
        ],
        "description": "What the Lighthouse section of Monitor reads. `available` is false when this deployment has no Google key, and `reason` then says why in a plain sentence. `tool_enabled` is the Uptime switch of Monitor: while it is off, nothing runs and the lists are empty. `live_url` is the address that is tested, or null when the site has no live address yet."
      },
      "PagespeedRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "strategy": {
            "type": "string",
            "enum": [
              "mobile",
              "desktop"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ]
          },
          "trigger": {
            "type": "string",
            "enum": [
              "manual",
              "scheduled"
            ]
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "description": "The address that was tested."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "A plain sentence when the run failed."
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "not_configured",
              "unreachable",
              "no_content",
              "busy",
              "unavailable",
              "timeout",
              "stuck",
              "failed"
            ]
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "report": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "lighthouse_version": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 20
              },
              "fetched_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When Google ran the test."
              },
              "final_url": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2048,
                "description": "The address Google ended up on after redirects."
              },
              "scores": {
                "type": "object",
                "properties": {
                  "performance": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 100
                  },
                  "accessibility": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 100
                  },
                  "best_practices": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 100
                  },
                  "seo": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 100
                  }
                },
                "required": [
                  "performance",
                  "accessibility",
                  "best_practices",
                  "seo"
                ]
              },
              "metrics": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "enum": [
                        "fcp",
                        "lcp",
                        "tbt",
                        "cls",
                        "si",
                        "tti"
                      ]
                    },
                    "value": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "display": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 40,
                      "description": "The text Lighthouse shows, such as \"1.4 s\" or \"0.02\"."
                    },
                    "rating": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "good",
                        "needs_improvement",
                        "poor"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "value",
                    "display",
                    "rating"
                  ]
                },
                "maxItems": 6
              },
              "field": {
                "type": "object",
                "properties": {
                  "scope": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "page",
                      "origin"
                    ]
                  },
                  "overall": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "good",
                      "needs_improvement",
                      "poor"
                    ]
                  },
                  "metrics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "enum": [
                            "lcp",
                            "inp",
                            "cls",
                            "fcp",
                            "ttfb"
                          ]
                        },
                        "value": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "rating": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "good",
                            "needs_improvement",
                            "poor"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "value",
                        "rating"
                      ]
                    },
                    "maxItems": 5
                  }
                },
                "required": [
                  "scope",
                  "overall",
                  "metrics"
                ]
              },
              "audits": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "opportunity",
                        "diagnostic"
                      ]
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 160
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 320,
                      "description": "One plain sentence, with Lighthouse's links removed."
                    },
                    "savings_ms": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0
                    },
                    "savings_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0
                    },
                    "display": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 80,
                      "description": "Lighthouse's own words for the finding, such as \"Potential savings of 480 ms\"."
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "title",
                    "description",
                    "savings_ms",
                    "savings_bytes",
                    "display"
                  ]
                },
                "maxItems": 12
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "enum": [
                        "performance",
                        "accessibility",
                        "best_practices",
                        "seo"
                      ]
                    },
                    "score": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "maximum": 100
                    },
                    "audits": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "maxLength": 80
                          },
                          "title": {
                            "type": "string",
                            "maxLength": 200
                          },
                          "description": {
                            "type": "string",
                            "maxLength": 300
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "fail",
                              "average",
                              "pass",
                              "info",
                              "na"
                            ]
                          },
                          "display": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 80,
                            "description": "Lighthouse's own words for the finding, such as \"Potential savings of 480 ms\"."
                          },
                          "group": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 60,
                            "description": "The group of the audit inside its category, such as `metrics` or `load-opportunities`."
                          },
                          "savings_ms": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 0
                          },
                          "savings_bytes": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 0
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "maxLength": 160
                            },
                            "maxItems": 5
                          },
                          "items_total": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 0,
                            "description": "How many rows the audit's table has in all, when it has one."
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "description",
                          "status",
                          "display",
                          "group",
                          "savings_ms",
                          "savings_bytes",
                          "items",
                          "items_total"
                        ]
                      },
                      "maxItems": 160
                    }
                  },
                  "required": [
                    "id",
                    "score",
                    "audits"
                  ]
                },
                "maxItems": 4,
                "default": [],
                "description": "Every audit of each category, for the full report on the page. A run stored before this was kept has none, so the page shows its scores and metrics alone."
              }
            },
            "required": [
              "lighthouse_version",
              "fetched_at",
              "final_url",
              "scores",
              "metrics",
              "field",
              "audits",
              "categories"
            ],
            "description": "The result, once the run is done."
          }
        },
        "required": [
          "id",
          "site_id",
          "environment_id",
          "strategy",
          "status",
          "trigger",
          "url",
          "created_at",
          "started_at",
          "finished_at",
          "error",
          "error_code",
          "job_id",
          "report"
        ]
      },
      "PagespeedRunsStarted": {
        "type": "object",
        "properties": {
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PagespeedRun"
            }
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "strategy": {
                  "type": "string",
                  "enum": [
                    "mobile",
                    "desktop"
                  ]
                },
                "retry_after_seconds": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                }
              },
              "required": [
                "strategy",
                "retry_after_seconds"
              ]
            },
            "description": "Strategies left out because one was tested less than 10 minutes ago."
          }
        },
        "required": [
          "runs",
          "skipped"
        ]
      },
      "StartPagespeedRunRequest": {
        "type": "object",
        "properties": {
          "strategy": {
            "type": "string",
            "enum": [
              "mobile",
              "desktop",
              "both"
            ],
            "default": "both",
            "description": "The device profile to test. `both` starts a mobile and a desktop test."
          }
        }
      },
      "VulnerabilityProtection": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "pending",
              "yielded",
              "unsupported",
              "off",
              "failed",
              "needs_entitlement"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "One plain sentence for the status (why it is yielded, off, unsupported, failed, or waiting on Patchstack), or null."
          },
          "since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the status last changed, or null when the environment was never registered."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Patchstack plugin version the node runs, once it has reported, or null."
          },
          "vulnerable": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Plugins the firewall marks vulnerable, by slug (the folder name, or the file name without.php for a single file plugin). Empty until the plugin has reported or when none is vulnerable."
          },
          "vulnerability_count": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "How many vulnerabilities the plugin reports across the site's software, or null before it reports."
          }
        },
        "required": [
          "environment_id",
          "status",
          "reason",
          "since",
          "version",
          "vulnerable",
          "vulnerability_count"
        ],
        "description": "The answer of `GET /environments/{id}/vulnerability-protection`. Holds no key and no id."
      },
      "VulnerabilityList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "component_type": {
                  "type": "string",
                  "enum": [
                    "plugin",
                    "theme",
                    "core"
                  ]
                },
                "slug": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The plugin or theme folder name, or `wordpress` for core."
                },
                "name": {
                  "type": "string"
                },
                "installed_version": {
                  "type": "string",
                  "description": "The version the site runs. Empty when the platform has not read the plugin list yet."
                },
                "fixed_in": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The first version that fixes it. Without a vulnerability database this is the update the plugin list offers, when there is one. Null when no fix is known."
                },
                "update_available": {
                  "type": "boolean",
                  "description": "True when the plugin or theme list says an update is waiting for this component."
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "cve": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "cvss": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 10
                },
                "severity": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "critical",
                    "high",
                    "medium",
                    "low",
                    "unknown"
                  ],
                  "description": "Null without a vulnerability database: the plugin reports no tier."
                },
                "is_exploited": {
                  "type": "boolean",
                  "description": "True when the source has confirmed attacks on it in the wild."
                },
                "protected": {
                  "type": "boolean",
                  "description": "True when a virtual patch is known to protect this site from it."
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uri",
                  "description": "The public entry for this vulnerability, when the source has one."
                },
                "count": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "exclusiveMinimum": 0,
                  "description": "How many vulnerabilities this row stands for. 1 with `detail`, null without it."
                }
              },
              "required": [
                "id",
                "component_type",
                "slug",
                "name",
                "installed_version",
                "fixed_in",
                "update_available",
                "title",
                "cve",
                "cvss",
                "severity",
                "is_exploited",
                "protected",
                "url",
                "count"
              ]
            }
          },
          "counts": {
            "type": "object",
            "properties": {
              "critical": {
                "type": "integer",
                "minimum": 0
              },
              "high": {
                "type": "integer",
                "minimum": 0
              },
              "medium": {
                "type": "integer",
                "minimum": 0
              },
              "low": {
                "type": "integer",
                "minimum": 0
              },
              "unknown": {
                "type": "integer",
                "minimum": 0
              },
              "total": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "critical",
              "high",
              "medium",
              "low",
              "unknown",
              "total"
            ]
          },
          "detail": {
            "type": "boolean",
            "description": "True when the rows are individual vulnerabilities with titles and tiers."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "plugin",
              "patchstack"
            ]
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when more rows follow: send it back as `cursor`. `counts` always covers every row."
          }
        },
        "required": [
          "data",
          "counts",
          "detail",
          "source",
          "checked_at",
          "next_cursor"
        ],
        "description": "`GET /v1/environments/{id}/vulnerabilities`. Worst first, then by name. Without `detail` the tiers of `counts` are all 0 and only `total` (how many the plugin reports) is real; the rows are the vulnerable components. `source` and `checked_at` are null and the list is empty while nothing has reported yet; that is not an error."
      },
      "GoogleIntegrations": {
        "type": "object",
        "properties": {
          "connections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "tool": {
                  "type": "string",
                  "enum": [
                    "search_console",
                    "google_analytics"
                  ]
                },
                "google_email": {
                  "type": "string",
                  "description": "The Google account that connected, for example name@example.com."
                },
                "scopes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "The scopes Google granted."
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "connected",
                    "needs_reconnect"
                  ]
                },
                "status_reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Why the connection needs the person: access_revoked or access_denied. Null while it works."
                },
                "connected_by": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The name or email of the person who connected it."
                },
                "connected_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "tool",
                "google_email",
                "scopes",
                "status",
                "status_reason",
                "connected_by",
                "connected_at",
                "updated_at"
              ]
            },
            "description": "At most one connection for each tool."
          },
          "redirect_uri": {
            "type": "string",
            "description": "The address Google sends the person back to. It must be an authorized redirect URI."
          }
        },
        "required": [
          "connections",
          "redirect_uri"
        ]
      },
      "ConnectGoogleRequest": {
        "type": "object",
        "properties": {
          "tool": {
            "type": "string",
            "enum": [
              "search_console",
              "google_analytics"
            ]
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "The site the person is setting up. They come back to its Tools tab."
          }
        },
        "required": [
          "tool",
          "site_id"
        ]
      },
      "GoogleAuthorization": {
        "type": "object",
        "properties": {
          "authorization_url": {
            "type": "string",
            "format": "uri",
            "description": "Send the browser here. Google asks the person to allow read only access."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "authorization_url",
          "expires_at"
        ]
      },
      "GoogleDisconnected": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "tool": {
            "type": "string",
            "enum": [
              "search_console",
              "google_analytics"
            ]
          },
          "disconnected": {
            "type": "boolean"
          },
          "sites_cleared": {
            "type": "integer",
            "minimum": 0,
            "description": "Sites that had a property of this account chosen. Their choice is cleared."
          }
        },
        "required": [
          "id",
          "tool",
          "disconnected",
          "sites_cleared"
        ]
      },
      "GoogleToolSettings": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "tool": {
            "type": "string",
            "enum": [
              "search_console",
              "google_analytics"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "On when the person turned the tool on for this site. Off is the default."
          },
          "connection": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "google_email": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "connected",
                  "needs_reconnect"
                ]
              },
              "status_reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "connected_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "google_email",
              "status",
              "status_reason",
              "connected_at"
            ],
            "description": "The company's connection for this tool, or null when none is connected."
          },
          "property": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The property this site reads. Null until one is chosen."
          },
          "properties": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "What the tool stores and the reports use: a siteUrl, or properties/123."
                },
                "name": {
                  "type": "string",
                  "description": "The name to show."
                },
                "detail": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "A second line: the permission level (Search Console) or the Analytics account name."
                }
              },
              "required": [
                "id",
                "name",
                "detail"
              ]
            },
            "description": "The properties the connected account can read. Present only when the call asks for them with `list_properties=true`, and only while the connection works."
          },
          "properties_limited": {
            "type": "boolean",
            "description": "True when this caller may choose only some of the account's properties: a person limited to some sites (a Site Admin) gets the Search Console properties of this site's proven domains, and the property a person with a company wide role chose for the site. The list holds only those. False for a person with a company wide role, who may choose any."
          },
          "properties_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "One plain sentence when the property list could not be read."
          }
        },
        "required": [
          "site_id",
          "tool",
          "enabled",
          "connection",
          "property",
          "properties",
          "properties_limited",
          "properties_error"
        ],
        "description": "The settings of one Google tool on one site."
      },
      "PutGoogleToolRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "True turns the tool on for the site, false turns it off and forgets the chosen property."
          },
          "property_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 300,
            "description": "The property to read, as the list gives it. Send null to clear the choice. Leave it out to keep the one the site has. A person limited to some sites may send only a property the list gave them (`properties_limited`); any other answers 403 `google_property_not_allowed`."
          }
        },
        "required": [
          "enabled"
        ]
      },
      "SearchConsoleReport": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "property": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "overview",
              "queries",
              "pages",
              "countries",
              "devices"
            ]
          },
          "from": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "to": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "totals": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "clicks": {
                "type": "number"
              },
              "impressions": {
                "type": "number"
              },
              "ctr": {
                "type": "number"
              },
              "position": {
                "type": "number"
              }
            },
            "required": [
              "clicks",
              "impressions",
              "ctr",
              "position"
            ],
            "description": "Overview only: the totals of the range. Null for the other kinds."
          },
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "clicks": {
                  "type": "number"
                },
                "impressions": {
                  "type": "number"
                },
                "ctr": {
                  "type": "number"
                },
                "position": {
                  "type": "number"
                }
              },
              "required": [
                "date",
                "clicks",
                "impressions",
                "ctr",
                "position"
              ]
            },
            "description": "Overview only: one entry for each day with data."
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "clicks": {
                  "type": "number"
                },
                "impressions": {
                  "type": "number"
                },
                "ctr": {
                  "type": "number"
                },
                "position": {
                  "type": "number"
                }
              },
              "required": [
                "key",
                "clicks",
                "impressions",
                "ctr",
                "position"
              ]
            },
            "description": "The other kinds: the top 25 rows by clicks."
          },
          "cached": {
            "type": "boolean",
            "description": "True when this answer came from the 15 minute memory and not from Google."
          },
          "fetched_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "site_id",
          "property",
          "kind",
          "from",
          "to",
          "totals",
          "series",
          "rows",
          "cached",
          "fetched_at"
        ]
      },
      "GoogleAnalyticsReport": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "property": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "overview",
              "pages",
              "sources"
            ]
          },
          "from": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "to": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "totals": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "users": {
                "type": "number"
              },
              "sessions": {
                "type": "number"
              },
              "views": {
                "type": "number"
              },
              "engagement_rate": {
                "type": "number"
              }
            },
            "required": [
              "users",
              "sessions",
              "views",
              "engagement_rate"
            ]
          },
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "users": {
                  "type": "number"
                },
                "sessions": {
                  "type": "number"
                },
                "views": {
                  "type": "number"
                },
                "engagement_rate": {
                  "type": "number"
                }
              },
              "required": [
                "date",
                "users",
                "sessions",
                "views",
                "engagement_rate"
              ]
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "users": {
                  "type": "number"
                },
                "sessions": {
                  "type": "number"
                },
                "views": {
                  "type": "number"
                },
                "engagement_rate": {
                  "type": "number"
                }
              },
              "required": [
                "key",
                "users",
                "sessions",
                "views",
                "engagement_rate"
              ]
            },
            "description": "The pages kind has page paths as keys, the sources kind has source and medium."
          },
          "cached": {
            "type": "boolean"
          },
          "fetched_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "site_id",
          "property",
          "kind",
          "from",
          "to",
          "totals",
          "series",
          "rows",
          "cached",
          "fetched_at"
        ]
      },
      "LocalDevConfig": {
        "type": "object",
        "properties": {
          "site": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "slug"
            ]
          },
          "environment": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "live",
                  "staging",
                  "preview"
                ]
              },
              "role": {
                "type": "string",
                "enum": [
                  "staging",
                  "live",
                  "preview"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "role"
            ]
          },
          "runtime": {
            "type": "object",
            "properties": {
              "php_version": {
                "type": "string"
              },
              "wordpress_version": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "webroot": {
                "type": "string",
                "description": "The WordPress root inside the container, such as `/var/www/html`."
              },
              "webroot_subfolder": {
                "type": "string",
                "description": "A folder under the webroot that WordPress lives in, or an empty string."
              }
            },
            "required": [
              "php_version",
              "wordpress_version",
              "webroot",
              "webroot_subfolder"
            ]
          },
          "database": {
            "type": "object",
            "properties": {
              "engine": {
                "type": "string",
                "const": "mariadb"
              },
              "version": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The server version without a suffix, such as `11.4.2`. Null while the node cannot answer."
              },
              "table_prefix": {
                "type": "string",
                "description": "The prefix WP Waterfall writes into wp-config.php. A pull still reads the real one over SSH."
              }
            },
            "required": [
              "engine",
              "version",
              "table_prefix"
            ]
          },
          "multisite": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "subdirectory",
                  "subdomain"
                ]
              }
            },
            "required": [
              "enabled",
              "mode"
            ]
          },
          "network": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "subdirectory",
                  "subdomain"
                ]
              },
              "domain": {
                "type": "string",
                "description": "The network host (DOMAIN_CURRENT_SITE) on this environment."
              },
              "path": {
                "type": "string",
                "description": "PATH_CURRENT_SITE."
              },
              "subsites": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "blog_id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "main": {
                      "type": "boolean"
                    },
                    "domain": {
                      "type": "string",
                      "description": "The host WordPress holds for the subsite on this environment, and its path (`/` or `/es/`)."
                    },
                    "path": {
                      "type": "string"
                    },
                    "locale": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The WordPress language (`es_ES`), or null for the network default."
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "temp_hostname": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The temporary hostname of a subdomain subsite, or null."
                    }
                  },
                  "required": [
                    "blog_id",
                    "main",
                    "domain",
                    "path",
                    "locale",
                    "title",
                    "temp_hostname"
                  ]
                }
              }
            },
            "required": [
              "mode",
              "domain",
              "path",
              "subsites"
            ],
            "description": "The network, for the add-on's per-subsite rewrites. Null for a single site. Holds no secret. A pull maps each `domain` and `path` to a local address and writes the mapping to `.ddev/wpwaterfall-network.json`."
          },
          "urls": {
            "type": "object",
            "properties": {
              "primary": {
                "type": "string"
              },
              "temp_hostname": {
                "type": "string"
              }
            },
            "required": [
              "primary",
              "temp_hostname"
            ]
          },
          "ssh": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "host": {
                "type": "string"
              },
              "port": {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              "username": {
                "type": "string"
              },
              "host_key_fingerprint": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "`SHA256:...` of the container's ed25519 host key, or null while the node does not report it."
              },
              "accepts_account_keys": {
                "type": "boolean",
                "description": "False on live: account SSH keys are refused there. Pull from a backup instead."
              },
              "ssh_command": {
                "type": "string"
              }
            },
            "required": [
              "enabled",
              "host",
              "port",
              "username",
              "host_key_fingerprint",
              "accepts_account_keys",
              "ssh_command"
            ],
            "description": "Null when SSH is off or an external repository is connected (SSH is off there)."
          },
          "sftp": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "host": {
                "type": "string"
              },
              "port": {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              "username": {
                "type": "string"
              },
              "sftp_command": {
                "type": "string"
              }
            },
            "required": [
              "host",
              "port",
              "username",
              "sftp_command"
            ],
            "description": "The primary SFTP user. The password is never part of this answer."
          },
          "git_remote_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The WP Waterfall Git remote, such as `ssh://user@host:2204/srv/git/site.git`. One repository serves the whole site and staging holds it, so live (which has no remote of its own) reports the staging address. Null when an external repository is connected or SSH is off."
          },
          "git_default_branch": {
            "type": "string",
            "description": "The repository's default branch: staging runs it, and live runs releases promoted from it."
          },
          "git_branch": {
            "type": "string",
            "description": "The branch this environment runs: `master` for staging (or the connected repository's default branch), the branch's own name for a branch."
          },
          "release_sha": {
            "type": [
              "string",
              "null"
            ],
            "description": "The commit this environment runs. For live it is the promoted release, and `ddev wpwaterfall code --release live` checks it out. Null before the first release."
          },
          "pushable": {
            "type": "boolean",
            "description": "True when a `git push` to `git_branch` reaches this environment. False on live."
          },
          "paths": {
            "type": "object",
            "properties": {
              "webroot": {
                "type": "string"
              },
              "wp_config": {
                "type": "string"
              },
              "wp_content": {
                "type": "string"
              },
              "uploads": {
                "type": "string"
              },
              "mu_plugins": {
                "type": "string"
              }
            },
            "required": [
              "webroot",
              "wp_config",
              "wp_content",
              "uploads",
              "mu_plugins"
            ]
          },
          "sizes": {
            "type": "object",
            "properties": {
              "database_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "uploads_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              }
            },
            "required": [
              "database_bytes",
              "uploads_bytes"
            ]
          },
          "excludes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Patterns a pull skips inside `wp-content/uploads/`."
          },
          "platform_files": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Node files that are not in the repository. A pull never brings them. Nothing deletes them."
          },
          "dropins": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "neutralize": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "path",
                "neutralize"
              ]
            },
            "description": "Drop-ins to warn about when present. The add-on never deletes or rewrites a tracked one."
          },
          "local_db_options_to_drop": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Database options to drop from the LOCAL database after an import (a trailing `*` is a prefix)."
          },
          "read_only": {
            "type": "boolean",
            "description": "True on live: its code and its data are read only for local development."
          },
          "operations": {
            "type": "object",
            "properties": {
              "pull": {
                "type": "object",
                "properties": {
                  "allowed": {
                    "type": "boolean"
                  },
                  "parts": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "code",
                        "database",
                        "uploads"
                      ]
                    },
                    "description": "Which of code, database, and uploads may be pulled."
                  },
                  "methods": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "ssh",
                        "backup"
                      ]
                    },
                    "description": "How database and uploads travel. Code always travels by Git."
                  },
                  "recommended": {
                    "type": "string",
                    "enum": [
                      "ssh",
                      "backup"
                    ]
                  }
                },
                "required": [
                  "allowed",
                  "parts",
                  "methods",
                  "recommended"
                ]
              },
              "push": {
                "type": "object",
                "properties": {
                  "allowed": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A plain sentence when push is not allowed, otherwise null."
                  },
                  "parts": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "code",
                        "database",
                        "uploads"
                      ]
                    },
                    "description": "Which of code, database, and uploads may be pushed. Empty when push is not allowed."
                  }
                },
                "required": [
                  "allowed",
                  "reason",
                  "parts"
                ]
              }
            },
            "required": [
              "pull",
              "push"
            ]
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "site",
          "environment",
          "runtime",
          "database",
          "multisite",
          "urls",
          "ssh",
          "sftp",
          "git_remote_url",
          "git_default_branch",
          "git_branch",
          "release_sha",
          "pushable",
          "paths",
          "sizes",
          "excludes",
          "platform_files",
          "dropins",
          "local_db_options_to_drop",
          "read_only",
          "operations",
          "generated_at"
        ]
      },
      "LocalDevPullSession": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "format": "uuid",
            "description": "The activity log entry of this pull. Client calls can quote it."
          },
          "environment": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "live",
                  "staging",
                  "preview"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "kind"
            ]
          },
          "method": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ssh",
              "backup"
            ],
            "description": "Null when the session moves no database or uploads (code only)."
          },
          "parts": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "code",
                "database",
                "uploads"
              ]
            }
          },
          "ssh_ready": {
            "type": "boolean"
          },
          "ssh_keys_pending": {
            "type": "integer",
            "minimum": 0
          },
          "issued_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "latest_backup": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "cause": {
                "type": "string"
              },
              "size_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "age_seconds": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "id",
              "created_at",
              "label",
              "cause",
              "size_bytes",
              "age_seconds"
            ],
            "description": "The newest ready backup. Null when the environment has none: take one first."
          },
          "recommend_fresh_backup": {
            "type": "boolean"
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "order": {
                  "type": "integer",
                  "minimum": 1
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "create_backup",
                    "prepare_download",
                    "claim_download_link"
                  ]
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST"
                  ]
                },
                "path": {
                  "type": "string",
                  "description": "The path with `/v1` and real ids filled in, except `{backup_id}` when a backup is still to come."
                },
                "scope": {
                  "type": "string",
                  "description": "The API key scope this call needs."
                },
                "required": {
                  "type": "boolean",
                  "description": "False when the client may skip the step (a fresh backup it does not need)."
                }
              },
              "required": [
                "order",
                "action",
                "method",
                "path",
                "scope",
                "required"
              ]
            },
            "description": "Empty for `ssh` and for code only. For `backup`, the calls that fetch the archive."
          },
          "archive": {
            "type": "object",
            "properties": {
              "format": {
                "type": "string",
                "const": "tar.gz"
              },
              "database_file": {
                "type": "string",
                "const": "database.sql.gz"
              },
              "uploads_dir": {
                "type": "string",
                "const": "wp-content/uploads/"
              }
            },
            "required": [
              "format",
              "database_file",
              "uploads_dir"
            ],
            "description": "What the downloaded archive holds."
          },
          "excludes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "code": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "remote_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "branch": {
                "type": "string"
              },
              "release_sha": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The commit to check out for live, otherwise null (follow the branch)."
              }
            },
            "required": [
              "remote_url",
              "branch",
              "release_sha"
            ],
            "description": "Where code comes from: the Git remote and the ref to check out. Null without `code`."
          }
        },
        "required": [
          "session_id",
          "environment",
          "method",
          "parts",
          "ssh_ready",
          "ssh_keys_pending",
          "issued_at",
          "expires_at",
          "latest_backup",
          "recommend_fresh_backup",
          "steps",
          "archive",
          "excludes",
          "code"
        ]
      },
      "LocalDevPullSessionRequest": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "ssh",
              "backup"
            ],
            "description": "How database and uploads travel. Left out, the environment's recommended method."
          },
          "client": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9._\\-/ ]*$",
            "default": "unknown",
            "description": "Who asks, for the activity log, such as `ddev-wpwaterfall/0.1.0`. Plain text, no secrets."
          },
          "parts": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "code",
                "database",
                "uploads"
              ]
            },
            "minItems": 1,
            "maxItems": 3,
            "default": [
              "database",
              "uploads"
            ],
            "description": "The parts the client will pull."
          }
        },
        "description": "POST /environments/{id}/local-dev/pull-session"
      },
      "LocalDevPushSession": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "live",
                  "staging",
                  "preview"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "kind"
            ]
          },
          "parts": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "code",
                "database",
                "uploads"
              ]
            }
          },
          "ssh_ready": {
            "type": "boolean"
          },
          "ssh_keys_pending": {
            "type": "integer",
            "minimum": 0
          },
          "issued_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "order": {
                  "type": "integer",
                  "minimum": 1
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "create_backup",
                    "prepare_download",
                    "claim_download_link"
                  ]
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST"
                  ]
                },
                "path": {
                  "type": "string",
                  "description": "The path with `/v1` and real ids filled in, except `{backup_id}` when a backup is still to come."
                },
                "scope": {
                  "type": "string",
                  "description": "The API key scope this call needs."
                },
                "required": {
                  "type": "boolean",
                  "description": "False when the client may skip the step (a fresh backup it does not need)."
                }
              },
              "required": [
                "order",
                "action",
                "method",
                "path",
                "scope",
                "required"
              ]
            },
            "description": "Database and uploads replace data on the environment, so a backup comes first. The step is required when `parts` holds either. Code needs none (a Git push builds a new release)."
          },
          "code": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "remote_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "branch": {
                "type": "string"
              }
            },
            "required": [
              "remote_url",
              "branch"
            ],
            "description": "Where code goes: `git push` of the branch to the remote. Null without `code`."
          }
        },
        "required": [
          "session_id",
          "environment",
          "parts",
          "ssh_ready",
          "ssh_keys_pending",
          "issued_at",
          "expires_at",
          "steps",
          "code"
        ]
      },
      "LocalDevPushSessionRequest": {
        "type": "object",
        "properties": {
          "client": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9._\\-/ ]*$",
            "default": "unknown"
          },
          "parts": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "code",
                "database",
                "uploads"
              ]
            },
            "minItems": 1,
            "maxItems": 3,
            "default": [
              "code"
            ],
            "description": "The parts the client will push."
          }
        },
        "description": "POST /environments/{id}/local-dev/push-session"
      },
      "Migration": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The staging environment the site starts with."
          },
          "site_name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "checking",
              "queued",
              "in_progress",
              "ready_for_review",
              "declined",
              "complete",
              "needs_input",
              "malware_found",
              "cancelled",
              "failed"
            ]
          },
          "status_label": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "link",
                  "manual"
                ]
              },
              "link_host": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Where the link points, such as `drive.google.com`. The full link is never returned."
              },
              "site_url": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The address of the old site: what the customer typed, else what WP Waterfall found in the backup. Null until the checks have read the backup and when the backup does not name it."
              },
              "site_url_detected": {
                "type": "boolean",
                "description": "True when `site_url` was found in the backup, not typed."
              },
              "current_host": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "link_host",
              "site_url",
              "site_url_detected",
              "current_host"
            ]
          },
          "auto_import": {
            "type": "boolean"
          },
          "priority": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "True while the request is in the priority group."
              },
              "paid_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "fee_cents": {
                "type": "integer",
                "minimum": 0
              },
              "refunded_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "The fee comes back if the request is cancelled or fails before the work starts."
              },
              "available": {
                "type": "boolean",
                "description": "True when the customer can still pay for priority."
              },
              "due_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the work is due: the time the fee was paid plus `MIGRATION_PRIORITY_DUE_HOURS`. The work is done when the site is ready to review. Null without paid priority, or once the fee went back."
              },
              "clock": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "running",
                  "due_soon",
                  "late",
                  "met",
                  "missed",
                  "stopped"
                ],
                "description": "Where the clock stands: `running`, `due_soon` (an hour or less left), `late`, `met`, `missed`, or `stopped` (ended without the work). Null without paid priority, or once the fee went back."
              }
            },
            "required": [
              "enabled",
              "paid_at",
              "fee_cents",
              "refunded_at",
              "available",
              "due_at",
              "clock"
            ]
          },
          "malware": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "found_at": {
                "type": "string",
                "format": "date-time"
              },
              "total": {
                "type": "integer",
                "minimum": 0,
                "description": "How many items the check flagged. The list below holds up to `MIGRATION_MALWARE_FINDINGS_LISTED` of them, known bad first."
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "known_bad",
                        "worth_a_look"
                      ]
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 300
                      },
                      "maxItems": 12,
                      "description": "What the detector saw, most important first. Older records leave it out."
                    },
                    "headline": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "One plain sentence for the most important reason. Older records leave it out."
                    }
                  },
                  "required": [
                    "path",
                    "reason"
                  ]
                },
                "maxItems": 500
              },
              "known_bad_total": {
                "type": "integer",
                "minimum": 0,
                "description": "Findings by severity. Older records leave them out."
              },
              "worth_a_look_total": {
                "type": "integer",
                "minimum": 0
              },
              "dispute": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why the migration waits, in plain words."
                  }
                },
                "required": [
                  "at",
                  "reason"
                ],
                "description": "Set after the customer pressed \"Talk to support\", until support decides."
              },
              "clean": {
                "type": "object",
                "properties": {
                  "fee_cents": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "available": {
                    "type": "boolean",
                    "description": "True when the customer can pay for WP Waterfall to clean the backup now."
                  },
                  "paid_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  }
                },
                "required": [
                  "fee_cents",
                  "available",
                  "paid_at"
                ]
              }
            },
            "required": [
              "found_at",
              "total",
              "findings",
              "clean"
            ],
            "description": "Set while the status is `malware_found`."
          },
          "database_open": {
            "type": "integer",
            "minimum": 0,
            "description": "How many database items the team is still cleaning by hand. While it is above zero the customer cannot accept the site, and the page says so in one sentence. Items marked cleaned or safe do not count, and neither do items that are only worth a look."
          },
          "queue_position": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "Place in line among waiting requests. 1 is next. Null once the request left the line."
          },
          "assessment": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "verdict": {
                "type": "string",
                "enum": [
                  "automatic",
                  "automatic_with_review",
                  "human_needed"
                ]
              },
              "summary": {
                "type": "string"
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "required_fixes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Things the customer can do to help the migration along."
              },
              "checked_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "verdict",
              "summary",
              "findings",
              "required_fixes",
              "checked_at"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "The latest message from WP Waterfall support for the customer."
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "description": "Why the request failed, in plain words."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "from": {
                  "type": "string",
                  "enum": [
                    "you",
                    "support"
                  ],
                  "description": "`you` for the customer's own notes, `support` for WP Waterfall's messages."
                },
                "body": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "at",
                "from",
                "body"
              ]
            }
          },
          "decline": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "note": {
                "type": "string"
              },
              "declined_at": {
                "type": "string",
                "format": "date-time"
              },
              "declined_by": {
                "type": "string",
                "description": "Who declined: a name or an email address."
              }
            },
            "required": [
              "note",
              "declined_at",
              "declined_by"
            ],
            "description": "Set while the status is `declined`: what the customer said is not right."
          },
          "import": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "table_prefix": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[A-Za-z0-9_]{1,40}$"
              },
              "network": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "mode": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "subdirectory",
                      "subdomain"
                    ]
                  },
                  "sites": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "blog_id": {
                          "type": "integer",
                          "exclusiveMinimum": 0
                        },
                        "url": {
                          "type": "string",
                          "maxLength": 400,
                          "description": "The address on staging, such as `https://staging-name.wpwaterfall.dev/es`."
                        },
                        "ok": {
                          "type": "boolean",
                          "description": "True when the homepage answered below 400."
                        },
                        "http_status": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "The status of the homepage check, or null when it could not be asked."
                        }
                      },
                      "required": [
                        "blog_id",
                        "url",
                        "ok",
                        "http_status"
                      ]
                    },
                    "maxItems": 100
                  }
                },
                "required": [
                  "mode",
                  "sites"
                ]
              },
              "at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "table_prefix",
              "network",
              "at"
            ],
            "description": "What the import did: the table prefix, and for a network each site and how it answered."
          },
          "provisioning_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job that provisions the new site."
          },
          "active_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job that runs the checks or the import now."
          },
          "test": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ready_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "site_id",
          "environment_id",
          "site_name",
          "status",
          "status_label",
          "source",
          "auto_import",
          "priority",
          "database_open",
          "queue_position",
          "assessment",
          "message",
          "error",
          "notes",
          "decline",
          "provisioning_job_id",
          "active_job_id",
          "test",
          "created_at",
          "updated_at",
          "started_at",
          "ready_at",
          "completed_at",
          "cancelled_at"
        ]
      },
      "MigrationList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Migration"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "MigrationOptions": {
        "type": "object",
        "properties": {
          "priority_fee_cents": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "currency": {
            "type": "string",
            "const": "usd"
          },
          "max_archive_bytes": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "link_kinds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "google_drive",
                "https"
              ]
            },
            "description": "The kinds of link WP Waterfall reads."
          },
          "assessment_available": {
            "type": "boolean",
            "description": "True when the AI assessment is switched on, so the form can say how fast a verdict arrives."
          },
          "expedited": {
            "type": "boolean",
            "description": "True when Expedited Migration is offered. False: the form hides the choice, and `priority: true` is refused with `expedited_migration_off`."
          },
          "priority_due_hours": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The hours an Expedited Migration promises from payment until the site is ready to review."
          }
        },
        "required": [
          "priority_fee_cents",
          "currency",
          "max_archive_bytes",
          "link_kinds",
          "assessment_available",
          "expedited",
          "priority_due_hours"
        ]
      },
      "MigrationCreated": {
        "type": "object",
        "properties": {
          "migration": {
            "$ref": "#/components/schemas/Migration"
          },
          "charged_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Cents charged for priority just now. Zero without priority."
          }
        },
        "required": [
          "migration",
          "charged_cents"
        ],
        "description": "Answered with the new migration and the job that provisions its site."
      },
      "CreateMigrationRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 60,
            "description": "The name of the new site."
          },
          "region": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "A region code from `GET /regions`. Defaults to the platform default region."
          },
          "php_version": {
            "type": "string",
            "enum": [
              "8.1",
              "8.2",
              "8.3",
              "8.4",
              "8.5"
            ],
            "default": "8.5"
          },
          "test": {
            "type": "boolean",
            "default": false,
            "description": "A simulated test migration on the demo node. Needs `test_sites` on `GET /platform`."
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            },
            "maxItems": 20,
            "default": []
          },
          "subscription_id": {
            "type": "string",
            "format": "uuid",
            "description": "The plan whose free slot the new site takes, as for a new site."
          },
          "source": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "link"
                  },
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048,
                    "description": "A Google Drive share link (set to Anyone with the link) or a direct https link to a.zip,.tar.gz, or.tgz archive. The link is stored for the migration only and never appears in a job, an event, or the audit log."
                  },
                  "site_url": {
                    "type": "string",
                    "maxLength": 2048,
                    "description": "The address of the old site, such as https://example.com. Optional: when it is left out, WP Waterfall reads it from the backup (the `siteurl` and `home` options of the database, then `wp-config.php`, the links in the posts, the file name, and `.htaccess`). It is never the download link: the link is `url`."
                  }
                },
                "required": [
                  "type",
                  "url"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "manual"
                  },
                  "current_host": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "The company the site is hosted with now, such as GoDaddy."
                  },
                  "site_url": {
                    "type": "string",
                    "maxLength": 2048,
                    "description": "The address of the old site. Optional: a person at WP Waterfall asks when it is missing."
                  }
                },
                "required": [
                  "type"
                ]
              }
            ],
            "discriminator": {
              "propertyName": "type"
            }
          },
          "auto_import": {
            "type": "boolean",
            "default": true,
            "description": "Start the import by itself when the checks find nothing risky. When false, a person at WP Waterfall approves every import."
          },
          "priority": {
            "type": "boolean",
            "default": false,
            "description": "Jump the queue now: charges the saved card the one-time fee (`MIGRATION_PRIORITY_FEE_CENTS`). Needs a payment method, and `confirm: true` from tools that spend money for a person."
          },
          "confirm": {
            "type": "boolean",
            "description": "Required (true) from an API key or a tool when `priority` is true, because that charges the saved card. A signed-in person confirms in the dashboard."
          },
          "note": {
            "type": "string",
            "maxLength": 4000,
            "description": "Anything WP Waterfall should know: plugins that must keep working, a deadline, a known problem."
          },
          "details": {
            "type": "object",
            "properties": {
              "timing": {
                "type": "string",
                "enum": [
                  "asap",
                  "scheduled",
                  "expedited"
                ],
                "default": "asap",
                "description": "When to start. `expedited` goes with `priority: true`; `scheduled` needs `scheduled_for`."
              },
              "scheduled_for": {
                "type": "string",
                "format": "date-time",
                "description": "The requested start for `scheduled`, as an instant. Staff confirm it."
              },
              "time_zone": {
                "type": "string",
                "maxLength": 64,
                "description": "The IANA time zone the person picked for `scheduled_for`, such as America/New_York."
              },
              "backup_type": {
                "type": "string",
                "enum": [
                  "duplicator",
                  "managewp",
                  "zip",
                  "cpanel"
                ]
              },
              "domains": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 253
                },
                "maxItems": 20,
                "default": [],
                "description": "The domain names of the site to move, one per entry."
              },
              "wildcard": {
                "type": "boolean",
                "default": false,
                "description": "Also move every subdomain of those domains."
              },
              "admin_url": {
                "type": "string",
                "maxLength": 2048,
                "description": "The WordPress admin address, such as https://example.com/wp-admin. No login goes with it."
              },
              "ecommerce": {
                "type": "boolean",
                "default": false,
                "description": "Orders, memberships, or content that visitors add. Staff plan a quiet time."
              },
              "multisite": {
                "type": "boolean",
                "default": false
              },
              "bedrock": {
                "type": "boolean",
                "default": false,
                "description": "A Bedrock or Trellis layout (WordPress in a `web/` folder)."
              },
              "https": {
                "type": "boolean",
                "default": true,
                "description": "The old site answers on https."
              }
            },
            "description": "What the customer says about the old site: its domains, WordPress admin address, whether it uses HTTPS, is ecommerce, is a multisite network, or uses a Bedrock or Trellis layout, the backup type, and when to start. WP Waterfall staff read it. Never include a password."
          }
        },
        "required": [
          "name",
          "source"
        ]
      },
      "PatchMigrationRequest": {
        "type": "object",
        "properties": {
          "auto_import": {
            "type": "boolean"
          }
        }
      },
      "PutMigrationSourceRequest": {
        "type": "object",
        "properties": {
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "link"
              },
              "url": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "description": "A Google Drive share link (set to Anyone with the link) or a direct https link to a.zip,.tar.gz, or.tgz archive. The link is stored for the migration only and never appears in a job, an event, or the audit log."
              },
              "site_url": {
                "type": "string",
                "maxLength": 2048,
                "description": "The address of the old site, such as https://example.com. Optional: when it is left out, WP Waterfall reads it from the backup (the `siteurl` and `home` options of the database, then `wp-config.php`, the links in the posts, the file name, and `.htaccess`). It is never the download link: the link is `url`."
              }
            },
            "required": [
              "type",
              "url"
            ]
          }
        },
        "required": [
          "source"
        ],
        "description": "Replaces the backup link and runs the checks again. A manual request has no source to replace: send a note instead."
      },
      "MigrationNoteRequest": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          }
        },
        "required": [
          "body"
        ]
      },
      "BuyMigrationPriorityRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "confirm"
        ]
      },
      "DeclineMigrationRequest": {
        "type": "object",
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "description": "The customer declines. Declining the result of a review says what is not right, and the API asks for that note there. Declining the clean of a flagged backup ends the migration and deletes the site that was set up for it, and the reason is optional."
      },
      "CleanMigrationRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "confirm"
        ],
        "description": "Pays WP Waterfall to clean a backup the malware check flagged. Charges the saved card."
      },
      "DisputeMigrationMalwareRequest": {
        "type": "object",
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "LicenseCatalog": {
        "type": "object",
        "properties": {
          "account_type": {
            "type": "string",
            "enum": [
              "individual",
              "agency",
              "enterprise"
            ],
            "description": "The account type whose list this is. The public list reads as `individual`."
          },
          "licenses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "size": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "The site credits: 1, 2, 5, 10, or 20 on sale, 40 to 150 through an account rep."
                },
                "slug": {
                  "type": "string",
                  "description": "`license_5`."
                },
                "name": {
                  "type": "string",
                  "description": "\"WP 5\"."
                },
                "first_month_free": {
                  "type": "boolean",
                  "description": "True when the license has a free first month on the annual and three year terms (the 1 site license)."
                },
                "prices": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "lookup_key": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 80,
                        "pattern": "^[a-z0-9_]+$"
                      },
                      "interval": {
                        "type": "string",
                        "enum": [
                          "monthly",
                          "annual",
                          "triennial"
                        ]
                      },
                      "amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "What the term charges at a renewal, and at the start when there is no free first month."
                      },
                      "first_term_amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "What the FIRST term charges when the customer has the free first month: 11 months on annual, 35 on three years, for service to the end of the term. Absent on monthly."
                      },
                      "currency": {
                        "type": "string",
                        "const": "usd"
                      }
                    },
                    "required": [
                      "lookup_key",
                      "interval",
                      "amount_cents",
                      "currency"
                    ]
                  }
                },
                "limits": {
                  "type": "object",
                  "properties": {
                    "sites": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "The license's site credits: how many real sites it holds."
                    },
                    "disk_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "bandwidth_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Included server bandwidth a month in bytes: what the site's server sends out."
                    },
                    "cdn_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "staging_per_site": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Staging and preview environments per site. Under pricing model V3 this is the included allowance (one staging plus the included previews), not a cap: a site may add additional preview environments beyond it, up to `max_additional_previews_per_site`."
                    },
                    "included_previews": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Branches included beside the staging environment (V3)."
                    },
                    "max_additional_previews_per_site": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Additional preview environments a site may add beyond the included ones (V3)."
                    },
                    "php_pool_mb": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "php_workers": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "backup_retention_days": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "apm_retention_days": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "dedicated_vcpus": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "vCPUs pinned to one site. 0 on every plan and tier since ADR 241: sites share cores."
                    }
                  },
                  "required": [
                    "sites",
                    "disk_bytes",
                    "bandwidth_bytes",
                    "cdn_bytes",
                    "staging_per_site",
                    "php_pool_mb",
                    "php_workers",
                    "backup_retention_days",
                    "apm_retention_days"
                  ],
                  "description": "The pool at the included tier. A tier upgrade adds to it (`tiers`)."
                },
                "draft": {
                  "type": "boolean",
                  "description": "True while the amounts are not signed off."
                },
                "available": {
                  "type": "boolean",
                  "description": "False while a platform change the license needs has not shipped (the launch gate)."
                },
                "hidden": {
                  "type": "boolean",
                  "description": "True for a size only an account rep applies. The customer's list never carries one."
                },
                "annual_discount_bps": {
                  "type": "integer",
                  "description": "The annual discount against twelve monthly payments, in basis points."
                },
                "triennial_discount_bps": {
                  "type": "integer",
                  "description": "The three year discount against 36 monthly payments, in basis points."
                }
              },
              "required": [
                "size",
                "slug",
                "name",
                "first_month_free",
                "prices",
                "limits",
                "draft",
                "available",
                "hidden",
                "annual_discount_bps",
                "triennial_discount_bps"
              ]
            },
            "maxItems": 20
          },
          "tiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tier": {
                  "type": "string",
                  "enum": [
                    "base",
                    "tier_40",
                    "tier_65",
                    "tier_125",
                    "tier_250"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "\"Plus\"."
                },
                "monthly_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "What the tier adds a month for one site. 0 for `base`."
                },
                "prices": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "lookup_key": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 80,
                        "pattern": "^[a-z0-9_]+$"
                      },
                      "interval": {
                        "type": "string",
                        "enum": [
                          "monthly",
                          "annual",
                          "triennial"
                        ]
                      },
                      "amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "What the term charges at a renewal, and at the start when there is no free first month."
                      },
                      "first_term_amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "What the FIRST term charges when the customer has the free first month: 11 months on annual, 35 on three years, for service to the end of the term. Absent on monthly."
                      },
                      "currency": {
                        "type": "string",
                        "const": "usd"
                      }
                    },
                    "required": [
                      "lookup_key",
                      "interval",
                      "amount_cents",
                      "currency"
                    ]
                  },
                  "description": "What the tier adds for one site on each term. Empty for `base`."
                },
                "limits": {
                  "type": "object",
                  "properties": {
                    "bandwidth_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Included server bandwidth a month in bytes: what the site's server sends out."
                    },
                    "disk_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "cdn_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "php_workers": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "backup_retention_days": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "dedicated_vcpus": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "vCPUs pinned to one site. 0 on every plan and tier since ADR 241: sites share cores."
                    }
                  },
                  "required": [
                    "bandwidth_bytes",
                    "disk_bytes",
                    "cdn_bytes",
                    "php_workers",
                    "backup_retention_days"
                  ],
                  "description": "The site's own limits at this tier, as on a 1 site license."
                },
                "available": {
                  "type": "boolean"
                }
              },
              "required": [
                "tier",
                "name",
                "monthly_cents",
                "prices",
                "limits",
                "available"
              ]
            }
          },
          "enterprise_levels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "level": {
                  "type": "string",
                  "enum": [
                    "silver",
                    "gold",
                    "platinum",
                    "diamond"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "from_sites": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "The licensed sites from which the level applies. A company under the Silver line has no level."
                },
                "discount_bps": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "The percent off licenses and site tiers, in basis points: 500 is 5%."
                },
                "benefits": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "text"
                    ]
                  }
                }
              },
              "required": [
                "level",
                "name",
                "from_sites",
                "discount_bps",
                "benefits"
              ]
            },
            "description": "The Enterprise levels, Silver, Gold, and Diamond, lowest first, as information: the licensed sites each starts at, the percent off licenses and site tiers, and the service. They apply only to a company staff set up as an Enterprise partner agency."
          },
          "annual_months_free": {
            "type": "integer",
            "description": "Annual has no discount, so 0. Its saving is the free first month."
          },
          "triennial_months_free": {
            "type": "integer",
            "description": "Rounded: three year is about 2 months free on the entry plans. Read `triennial_discount_bps`."
          },
          "annual_discount_bps": {
            "type": "integer",
            "description": "The annual discount, in basis points: 0. Each license carries its own."
          },
          "triennial_discount_bps": {
            "type": "integer",
            "description": "The three year discount of Single 20GB, in basis points. Each license carries its own."
          },
          "money_back_days": {
            "type": "integer",
            "description": "The money back guarantee covers monthly licenses only."
          }
        },
        "required": [
          "account_type",
          "licenses",
          "tiers",
          "enterprise_levels",
          "annual_months_free",
          "triennial_months_free",
          "annual_discount_bps",
          "triennial_discount_bps",
          "money_back_days"
        ],
        "description": "`GET /v1/billing/licenses` and the public `GET /v1/pricing`: every license an account may buy and every site tier, with their prices. Any self-serve account buys any size."
      },
      "BillingSummary": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "none",
              "trialing",
              "active",
              "past_due",
              "read_only",
              "suspended",
              "cancelled"
            ]
          },
          "license": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "size": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "The site credits: 1, 2, 5, 10, or 20 on sale, 40 to 150 through an account rep."
              },
              "slug": {
                "type": "string",
                "description": "`license_5`."
              },
              "name": {
                "type": "string",
                "description": "\"WP 5\"."
              },
              "first_month_free": {
                "type": "boolean",
                "description": "True when the license has a free first month on the annual and three year terms (the 1 site license)."
              },
              "prices": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "lookup_key": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 80,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "interval": {
                      "type": "string",
                      "enum": [
                        "monthly",
                        "annual",
                        "triennial"
                      ]
                    },
                    "amount_cents": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "What the term charges at a renewal, and at the start when there is no free first month."
                    },
                    "first_term_amount_cents": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "What the FIRST term charges when the customer has the free first month: 11 months on annual, 35 on three years, for service to the end of the term. Absent on monthly."
                    },
                    "currency": {
                      "type": "string",
                      "const": "usd"
                    }
                  },
                  "required": [
                    "lookup_key",
                    "interval",
                    "amount_cents",
                    "currency"
                  ]
                }
              },
              "limits": {
                "type": "object",
                "properties": {
                  "sites": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "The license's site credits: how many real sites it holds."
                  },
                  "disk_bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "bandwidth_bytes": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Included server bandwidth a month in bytes: what the site's server sends out."
                  },
                  "cdn_bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "staging_per_site": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Staging and preview environments per site. Under pricing model V3 this is the included allowance (one staging plus the included previews), not a cap: a site may add additional preview environments beyond it, up to `max_additional_previews_per_site`."
                  },
                  "included_previews": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Branches included beside the staging environment (V3)."
                  },
                  "max_additional_previews_per_site": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Additional preview environments a site may add beyond the included ones (V3)."
                  },
                  "php_pool_mb": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "php_workers": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "backup_retention_days": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "apm_retention_days": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "dedicated_vcpus": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "vCPUs pinned to one site. 0 on every plan and tier since ADR 241: sites share cores."
                  }
                },
                "required": [
                  "sites",
                  "disk_bytes",
                  "bandwidth_bytes",
                  "cdn_bytes",
                  "staging_per_site",
                  "php_pool_mb",
                  "php_workers",
                  "backup_retention_days",
                  "apm_retention_days"
                ],
                "description": "The pool at the included tier. A tier upgrade adds to it (`tiers`)."
              },
              "draft": {
                "type": "boolean",
                "description": "True while the amounts are not signed off."
              },
              "available": {
                "type": "boolean",
                "description": "False while a platform change the license needs has not shipped (the launch gate)."
              },
              "hidden": {
                "type": "boolean",
                "description": "True for a size only an account rep applies. The customer's list never carries one."
              },
              "annual_discount_bps": {
                "type": "integer",
                "description": "The annual discount against twelve monthly payments, in basis points."
              },
              "triennial_discount_bps": {
                "type": "integer",
                "description": "The three year discount against 36 monthly payments, in basis points."
              }
            },
            "required": [
              "size",
              "slug",
              "name",
              "first_month_free",
              "prices",
              "limits",
              "draft",
              "available",
              "hidden",
              "annual_discount_bps",
              "triennial_discount_bps"
            ]
          },
          "lookup_key": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 3,
            "maxLength": 80,
            "pattern": "^[a-z0-9_]+$"
          },
          "interval": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "monthly",
              "annual",
              "triennial"
            ]
          },
          "entitlements": {
            "type": "object",
            "properties": {
              "profile": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The resource profile the limits come from: a ladder row (`single_40`, `wp_5`) or a site profile (`wp_5+tier_40`). Placement and the PHP defaults read it. Null with no license."
              },
              "license": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The license the limits belong to (`license_5`), or null with no license."
              },
              "site_tier": {
                "type": "string",
                "enum": [
                  "base",
                  "tier_40",
                  "tier_65",
                  "tier_125",
                  "tier_250"
                ],
                "description": "One site's tier, on the limits of one site. Absent on the limits of a whole license."
              },
              "dedicated_vcpus": {
                "type": "integer",
                "minimum": 0,
                "description": "vCPUs pinned to one site. 0 on every plan and tier since ADR 241: sites share cores."
              },
              "metric": {
                "type": "string",
                "enum": [
                  "bandwidth"
                ]
              },
              "interval": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "monthly",
                  "annual",
                  "triennial"
                ]
              },
              "sites": {
                "type": "integer",
                "minimum": 0,
                "description": "The license's site credits: how many real sites it holds."
              },
              "disk_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "visits": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Included visits a month. Always null: no plan is priced by visits."
              },
              "bandwidth_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Included server bandwidth a month in bytes: what the site's server sends out."
              },
              "cdn_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "staging_per_site": {
                "type": "integer",
                "minimum": 0,
                "description": "Staging and preview environments per site. Under pricing model V3 this is the included allowance (one staging plus the included previews), not a cap: a site may add additional preview environments beyond it, up to `max_additional_previews_per_site`."
              },
              "included_previews": {
                "type": "integer",
                "minimum": 0,
                "description": "Branches included beside the staging environment (V3)."
              },
              "max_additional_previews_per_site": {
                "type": "integer",
                "minimum": 0,
                "description": "Additional preview environments a site may add beyond the included ones (V3)."
              },
              "max_additional_previews_per_company": {
                "type": "integer",
                "minimum": 0,
                "description": "Additional preview environments the whole company may have before staff approve more (V3). Staff raise it with an entitlement override and a reason."
              },
              "php_pool_mb": {
                "type": "integer",
                "minimum": 0
              },
              "php_workers": {
                "type": "integer",
                "minimum": 0
              },
              "dedicated_bandwidth_bytes": {
                "type": "integer",
                "minimum": 0,
                "description": "The bandwidth the company's dedicated servers include together, in bytes a month. Absent for a company with no dedicated server. The usage view adds a line for it."
              },
              "memory_budget_mb": {
                "type": "integer",
                "minimum": 0,
                "description": "The memory the plan may use as a whole, in MB: its PHP pool plus the database buffer plus 256 MB for each install. Absent on a plan without a cap (a retired plan, no plan)."
              },
              "memory_cap_mb": {
                "type": "integer",
                "minimum": 0,
                "description": "The most one container of the plan may use, in MB: pool + buffer + 256. Absent with the budget."
              },
              "backup_retention_days": {
                "type": "integer",
                "minimum": 0
              },
              "apm_retention_days": {
                "type": "integer",
                "minimum": 0
              },
              "features": {
                "type": "object",
                "properties": {
                  "redis": {
                    "type": "boolean"
                  },
                  "redis_mb": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Redis size in MB when `redis` is on."
                  },
                  "reverse_proxy": {
                    "type": "boolean"
                  },
                  "safe_updates": {
                    "type": "boolean"
                  },
                  "on_demand_regions": {
                    "type": "boolean"
                  },
                  "hourly_backups_h": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "exclusiveMinimum": 0,
                    "description": "The shortest hourly backup interval in hours the plan and its add-ons allow, or null for daily only."
                  },
                  "offsite_backups": {
                    "type": "boolean"
                  },
                  "white_label": {
                    "type": "boolean",
                    "description": "Reserved. No plan grants it and nothing is built behind it: we do not offer white label wp-admin."
                  }
                },
                "required": [
                  "redis",
                  "redis_mb",
                  "reverse_proxy",
                  "safe_updates",
                  "on_demand_regions",
                  "hourly_backups_h",
                  "offsite_backups",
                  "white_label"
                ]
              }
            },
            "required": [
              "profile",
              "license",
              "metric",
              "interval",
              "sites",
              "disk_bytes",
              "visits",
              "bandwidth_bytes",
              "cdn_bytes",
              "staging_per_site",
              "php_pool_mb",
              "php_workers",
              "backup_retention_days",
              "apm_retention_days",
              "features"
            ]
          },
          "addons": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "additional_disk",
                    "php_pool_512mb",
                    "redis_512mb",
                    "hourly_backups",
                    "offsite_backups",
                    "safe_updates",
                    "reverse_proxy",
                    "disaster_recovery",
                    "object_cache",
                    "custom_ssl",
                    "enterprise_support",
                    "disaster_recovery_dedicated"
                  ]
                },
                "lookup_key": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 80,
                  "pattern": "^[a-z0-9_]+$"
                },
                "environment_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "active",
                    "removed",
                    "voided"
                  ]
                },
                "unit_amount_cents": {
                  "type": "integer",
                  "minimum": 0
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "removed_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "type",
                "lookup_key",
                "environment_id",
                "quantity",
                "status",
                "unit_amount_cents",
                "created_at",
                "removed_at"
              ]
            }
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BillingUsage"
              },
              {
                "type": "null"
              }
            ]
          },
          "renews_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The next renewal, or null without a subscription."
          },
          "trial_ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean"
          },
          "next_invoice_estimate_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What the next invoice will come to, from the plan, add-ons, and overage so far. With several plans it is every plan invoiced on `next_invoice_on`, added up."
          },
          "next_invoice_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The day of the next invoice the estimate is for, or null without a live plan. Optional so an older API parses."
          },
          "dispute_open": {
            "type": "boolean",
            "description": "True while a dispute is open. New purchases are blocked."
          },
          "money_back_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "True inside the 30-day money-back window after the first payment. Monthly plans only."
          },
          "term_months": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "Months the current term covers: 1, 12, or 36. Null without a plan. Optional so an older API parses."
          },
          "non_refundable": {
            "type": "boolean",
            "description": "True for annual and three year plans: paid once and not refundable."
          },
          "renews_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The date the plan renews, or null when it will not (it is set to end, or has no plan)."
          },
          "access_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The date access ends when the plan is set to end at the term's end, else null."
          },
          "enterprise_level": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EnterpriseLevelView"
              },
              {
                "type": "null"
              }
            ],
            "description": "Enterprise only: the level in force with its discount, what it includes, and how many licensed sites reach the next level. Null for any other account."
          },
          "accessibility": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "lookup_key": {
                "type": "string"
              },
              "first_tier_sites": {
                "type": "integer"
              },
              "first_tier_cents": {
                "type": "integer"
              },
              "next_tier_cents": {
                "type": "integer"
              },
              "sites_on": {
                "type": "integer",
                "minimum": 0,
                "description": "Sites of this company that have it on."
              },
              "monthly_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "What the company pays a month now."
              },
              "next_site_cents": {
                "type": "integer",
                "description": "What turning it on for one more site adds a month."
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "lookup_key",
              "first_tier_sites",
              "first_tier_cents",
              "next_tier_cents",
              "sites_on",
              "monthly_cents",
              "next_site_cents",
              "text"
            ],
            "description": "The Accessibility add-on: the sites that have it on, the volume price ($10 for each of the first 2, $5 for each after), and what it costs a month now. Null when no site has it."
          }
        },
        "required": [
          "state",
          "license",
          "lookup_key",
          "interval",
          "entitlements",
          "addons",
          "usage",
          "renews_at",
          "trial_ends_at",
          "cancel_at_period_end",
          "next_invoice_estimate_cents",
          "dispute_open",
          "money_back_until"
        ],
        "description": "`GET /billing/summary`: the Billing page in one call, for the company's main license."
      },
      "ChangeLicenseRequest": {
        "type": "object",
        "properties": {
          "credits": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The new number of credits: a license size on sale."
          },
          "interval": {
            "type": "string",
            "enum": [
              "monthly",
              "annual",
              "triennial"
            ],
            "description": "The new term. Defaults to the license's own."
          },
          "acknowledge_non_refundable": {
            "type": "boolean",
            "description": "Required (true) when the new term is annual or three year: those terms are not refundable."
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "credits"
        ],
        "description": "`PUT /billing/subscriptions/{id}/license`: more or fewer site credits, or another term, on one license. Fewer credits than the sites in use is refused. A prepaid license moves up now and down when it renews."
      },
      "LicenseChangePreview": {
        "type": "object",
        "properties": {
          "subscription_id": {
            "type": "string",
            "format": "uuid"
          },
          "lookup_key": {
            "type": "string",
            "minLength": 3,
            "maxLength": 80,
            "pattern": "^[a-z0-9_]+$"
          },
          "license_name": {
            "type": "string"
          },
          "credits": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "interval": {
            "type": "string",
            "enum": [
              "monthly",
              "annual",
              "triennial"
            ]
          },
          "current_lookup_key": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 3,
            "maxLength": 80,
            "pattern": "^[a-z0-9_]+$"
          },
          "current_license_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_credits": {
            "type": "integer",
            "minimum": 0
          },
          "direction": {
            "type": "string",
            "enum": [
              "up",
              "down",
              "same"
            ],
            "description": "More credits or a longer term (up), fewer credits (down), or no change (same)."
          },
          "allowed": {
            "type": "boolean"
          },
          "refusals": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "same_license",
                    "not_sold",
                    "too_many_sites",
                    "too_many_environments",
                    "change_at_renewal",
                    "not_writable",
                    "dispute_open",
                    "billing_details_required"
                  ]
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ]
            }
          },
          "new_price_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The license's price for one billing period of its term. Site tiers are on top."
          },
          "adjustment_cents": {
            "type": "integer"
          },
          "billed": {
            "type": "string",
            "enum": [
              "next_invoice",
              "now"
            ],
            "description": "`now` for a larger plan or a new term; `next_invoice` for a smaller plan on the same term."
          },
          "billed_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "renews_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "term_months": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "non_refundable": {
            "type": "boolean"
          }
        },
        "required": [
          "subscription_id",
          "lookup_key",
          "license_name",
          "credits",
          "interval",
          "current_lookup_key",
          "current_license_name",
          "current_credits",
          "direction",
          "allowed",
          "refusals",
          "new_price_cents",
          "adjustment_cents",
          "billed",
          "billed_on",
          "renews_on",
          "term_months",
          "non_refundable"
        ],
        "description": "What changing a license would do, before anything changes. `adjustment_cents` is an estimate of the prorated amount for the rest of the period: positive is extra to pay, negative is credit."
      },
      "SetSiteTierRequest": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "base",
              "tier_40",
              "tier_65",
              "tier_125",
              "tier_250"
            ]
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "tier"
        ],
        "additionalProperties": false,
        "description": "`PUT /sites/{id}/tier`: move one site to another tier. The tier belongs to the site and applies to live only. Staging and preview environments always run the license's included profile."
      },
      "SiteTierPreview": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid"
          },
          "subscription_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "from": {
            "type": "string",
            "enum": [
              "base",
              "tier_40",
              "tier_65",
              "tier_125",
              "tier_250"
            ]
          },
          "to": {
            "type": "string",
            "enum": [
              "base",
              "tier_40",
              "tier_65",
              "tier_125",
              "tier_250"
            ]
          },
          "from_name": {
            "type": "string"
          },
          "to_name": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "up",
              "down",
              "same"
            ]
          },
          "allowed": {
            "type": "boolean"
          },
          "refusals": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "same_tier",
                    "not_sold",
                    "no_license",
                    "test_site",
                    "change_at_renewal",
                    "not_writable",
                    "dispute_open",
                    "billing_details_required"
                  ]
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ]
            }
          },
          "interval": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "monthly",
              "annual",
              "triennial"
            ]
          },
          "new_price_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The site's tier price for one billing period after the change."
          },
          "price_change_cents": {
            "type": "integer",
            "description": "The change to the license's price each period: positive costs more."
          },
          "adjustment_cents": {
            "type": "integer",
            "description": "The estimated amount of the change: positive is charged, negative is credit. For an upgrade billed now it is everything the change charges: the tier for the rest of the period plus `pending_lines`."
          },
          "tier_adjustment_cents": {
            "type": "integer",
            "description": "The tier's own prorated amount for the rest of the period, without `pending_lines`. Optional so an older API parses."
          },
          "pending_lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "description": "In plain words, such as \"Data center surcharge, Frankfurt, prorated\"."
                },
                "amount_cents": {
                  "type": "integer",
                  "description": "Positive is charged, negative is a credit."
                },
                "lookup_key": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The catalog key of the line's price, or null for a one time line."
                }
              },
              "required": [
                "description",
                "amount_cents",
                "lookup_key"
              ]
            },
            "description": "Lines already waiting on the subscription that an upgrade billed now charges with the tier, each on its own, such as the prorated surcharge of a site just placed in Frankfurt. Empty when nothing waits or nothing is billed now. Optional so an older API parses."
          },
          "billed": {
            "type": "string",
            "enum": [
              "now",
              "next_invoice"
            ]
          },
          "non_refundable": {
            "type": "boolean"
          },
          "limits": {
            "type": "object",
            "properties": {
              "bandwidth_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Included server bandwidth a month in bytes: what the site's server sends out."
              },
              "disk_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "cdn_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "php_workers": {
                "type": "integer",
                "minimum": 0
              },
              "backup_retention_days": {
                "type": "integer",
                "minimum": 0
              },
              "dedicated_vcpus": {
                "type": "integer",
                "minimum": 0,
                "description": "vCPUs pinned to one site. 0 on every plan and tier since ADR 241: sites share cores."
              }
            },
            "required": [
              "bandwidth_bytes",
              "disk_bytes",
              "cdn_bytes",
              "php_workers",
              "backup_retention_days"
            ],
            "description": "The site's limits at the new tier."
          },
          "regional_surcharge_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The regional surcharge the site pays for one billing period where its live environment runs now, in cents. A tier change does not change it. 0 in a base region, for a test site, and for a site with no license. Optional so an older API parses."
          },
          "regional_surcharge_location": {
            "type": [
              "string",
              "null"
            ],
            "description": "The city of that data center, such as \"Frankfurt\". Null when the site pays no surcharge."
          }
        },
        "required": [
          "site_id",
          "subscription_id",
          "from",
          "to",
          "from_name",
          "to_name",
          "direction",
          "allowed",
          "refusals",
          "interval",
          "new_price_cents",
          "price_change_cents",
          "adjustment_cents",
          "billed",
          "non_refundable",
          "limits"
        ],
        "description": "What moving one site to another tier would do. An upgrade is charged now for the rest of the period (`billed: now`). A downgrade credits the unused time on the next invoice of a monthly license, and waits for the renewal of a prepaid one (`change_at_renewal`)."
      },
      "SiteTierChange": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid"
          },
          "tier": {
            "type": "string",
            "enum": [
              "base",
              "tier_40",
              "tier_65",
              "tier_125",
              "tier_250"
            ]
          },
          "charged_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What was charged now, in cents. 0 for a downgrade."
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job that applies the new limits to the site's live environment, or null when it has none yet."
          }
        },
        "required": [
          "site_id",
          "tier",
          "charged_cents",
          "job_id"
        ],
        "description": "The answer to `PUT /sites/{id}/tier`."
      },
      "EnterpriseLevelView": {
        "type": "object",
        "properties": {
          "level": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "silver",
              "gold",
              "platinum",
              "diamond"
            ],
            "description": "Null while the company holds fewer licensed sites than the Silver line: it has no level."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "sites",
              "granted",
              "none"
            ],
            "description": "`sites`: the licensed sites earned it. `granted`: staff gave it, and it is higher. `none`: no level."
          },
          "sites": {
            "type": "integer",
            "minimum": 0,
            "description": "The sites of the company's active licenses."
          },
          "from_sites": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "discount_bps": {
            "type": "integer",
            "minimum": 0,
            "description": "The percent off licenses and site tiers now, in basis points. 0 with no level."
          },
          "support_included": {
            "type": "boolean",
            "description": "True at a level: Enterprise Support is included. With no level it is the $500 a month add-on."
          },
          "benefits": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "text"
              ]
            }
          },
          "next_level": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "level": {
                "type": "string",
                "enum": [
                  "silver",
                  "gold",
                  "platinum",
                  "diamond"
                ]
              },
              "name": {
                "type": "string"
              },
              "from_sites": {
                "type": "integer",
                "minimum": 0
              },
              "sites_to_go": {
                "type": "integer",
                "minimum": 0
              },
              "discount_bps": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "level",
              "name",
              "from_sites",
              "sites_to_go",
              "discount_bps"
            ],
            "description": "The level above, and how many more licensed sites reach it. Silver with no level. Null at Diamond."
          },
          "falls_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the level falls if the licensed sites stay under its line. Null while they are at the line."
          },
          "fall_months": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "Months under the line before a level falls: 2."
          }
        },
        "required": [
          "level",
          "name",
          "source",
          "sites",
          "from_sites",
          "discount_bps",
          "support_included",
          "benefits",
          "next_level",
          "falls_at",
          "fall_months"
        ],
        "description": "An Enterprise account's level in force: derived from its sites, or granted by staff. `GET /v1/billing/summary` returns it as `enterprise_level`, and staff read it on the Enterprise billing resource."
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "stripe_subscription_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null for a license that was backfilled from the old company columns and has no Stripe id."
          },
          "license": {
            "type": "string",
            "description": "`license_5`."
          },
          "license_name": {
            "type": "string",
            "description": "\"WP 5\"."
          },
          "display_name": {
            "type": "string",
            "description": "Which subscription this is, as every screen shows it: \"WP 20, 14 of 20 site licenses free, Purchase date: Oct 19, 2026\". A repeat in the list ends in \"(2)\"."
          },
          "lookup_key": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 3,
            "maxLength": 80,
            "pattern": "^[a-z0-9_]+$"
          },
          "interval": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "monthly",
              "annual",
              "triennial"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "incomplete",
              "incomplete_expired",
              "trialing",
              "active",
              "past_due",
              "unpaid",
              "canceled",
              "paused"
            ]
          },
          "credits": {
            "type": "integer",
            "minimum": 0,
            "description": "The site credits."
          },
          "credits_used": {
            "type": "integer",
            "minimum": 0,
            "description": "Real sites using a credit."
          },
          "credits_free": {
            "type": "integer",
            "minimum": 0,
            "description": "Credits no site uses."
          },
          "accepts_sites": {
            "type": "boolean",
            "description": "True when a new site may use this license now: a free credit and a status that takes sites."
          },
          "tiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tier": {
                  "type": "string",
                  "enum": [
                    "base",
                    "tier_40",
                    "tier_65",
                    "tier_125",
                    "tier_250"
                  ]
                },
                "sites": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "tier",
                "sites"
              ]
            },
            "description": "How many of the license's sites run at each tier above the included one."
          },
          "current_period_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean"
          },
          "term_months": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "Months the term covers: 1, 12, or 36."
          },
          "non_refundable": {
            "type": "boolean",
            "description": "True for annual and three year licenses: paid once and not refundable."
          },
          "renews_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The renewal date, or null when the license is set to end."
          },
          "access_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last day of access when the license is set to end, else null."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "canceled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "locked_amount_cents": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "The license's price per interval, without site tiers. It never goes up while it is active."
          }
        },
        "required": [
          "id",
          "stripe_subscription_id",
          "license",
          "license_name",
          "lookup_key",
          "interval",
          "status",
          "credits",
          "credits_used",
          "credits_free",
          "accepts_sites",
          "tiers",
          "current_period_end",
          "cancel_at_period_end",
          "created_at",
          "canceled_at"
        ],
        "description": "One license on the company, with its site credits and the tiers its sites run at."
      },
      "SubscriptionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Subscription"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "credits_free": {
            "type": "integer",
            "minimum": 0,
            "description": "Free credits across every license that takes sites."
          }
        },
        "required": [
          "data",
          "credits_free"
        ]
      },
      "CreateSubscriptionRequest": {
        "type": "object",
        "properties": {
          "lookup_key": {
            "type": "string",
            "minLength": 3,
            "maxLength": 80,
            "pattern": "^[a-z0-9_]+$"
          },
          "payment_method_id": {
            "type": "string",
            "minLength": 3,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9_]+$",
            "description": "A saved card. Defaults to the company's default card."
          },
          "promo_code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "A promo code. It replaces the free first month; the two never combine. An invalid code answers 422 `promo_code_invalid` with one generic sentence."
          },
          "acknowledge_non_refundable": {
            "type": "boolean",
            "description": "Required (true) when the plan is annual or three year: those terms are not refundable."
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "lookup_key"
        ],
        "description": "`POST /billing/subscriptions`: buys a license (`license_5_monthly`) with a saved card."
      },
      "SubscriptionStart": {
        "type": "object",
        "properties": {
          "stripe_subscription_id": {
            "type": "string",
            "minLength": 3,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9_]+$"
          },
          "status": {
            "type": "string",
            "enum": [
              "incomplete",
              "incomplete_expired",
              "trialing",
              "active",
              "past_due",
              "unpaid",
              "canceled",
              "paused"
            ]
          },
          "requires_action": {
            "type": "boolean"
          },
          "client_secret": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_intent_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "stripe_subscription_id",
          "status",
          "requires_action",
          "client_secret",
          "payment_intent_id"
        ],
        "description": "The answer to `POST /billing/subscriptions`. The plan shows in `GET /billing/subscriptions` once Stripe's webhook arrives. When the bank asks for 3D Secure, `requires_action` is true and the browser confirms the payment with `client_secret` (Stripe.js `confirmCardPayment`)."
      },
      "LicensePreview": {
        "type": "object",
        "properties": {
          "lookup_key": {
            "type": "string",
            "minLength": 3,
            "maxLength": 80,
            "pattern": "^[a-z0-9_]+$"
          },
          "license": {
            "type": "string"
          },
          "license_name": {
            "type": "string"
          },
          "interval": {
            "type": "string",
            "enum": [
              "monthly",
              "annual",
              "triennial"
            ]
          },
          "credits": {
            "type": "integer",
            "minimum": 0
          },
          "subtotal_cents": {
            "type": "integer",
            "minimum": 0
          },
          "tax_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What Stripe Tax returns, or 0 while automatic tax is off."
          },
          "total_cents": {
            "type": "integer",
            "minimum": 0
          },
          "automatic_tax": {
            "type": "boolean"
          },
          "trial_days": {
            "type": "integer",
            "minimum": 0,
            "description": "Days of the free first month, or 0."
          },
          "due_today_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What the card pays today: 0 during a free first month."
          },
          "first_term_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "With a free first month on a prepaid term: what the card pays when the free month ends, for the rest of the first term (11 or 35 months). Absent otherwise."
          },
          "term_months": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "Months the term covers: 1, 12, or 36. Optional so an older API parses."
          },
          "non_refundable": {
            "type": "boolean",
            "description": "True for annual and three year terms: billed once and not refundable."
          },
          "renews_on": {
            "type": "string",
            "format": "date-time",
            "description": "The date the term renews, ISO. Absent on a free first month."
          },
          "draft": {
            "type": "boolean"
          },
          "discount_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "With a promo code: the cents taken off the first charge. `subtotal_cents` stays the list price, `total_cents` is after the discount and tax, and `due_today_cents` follows it."
          },
          "recurring_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The price each period once any discount ends. Present when a code is applied."
          },
          "promo": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "The code in upper case."
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string",
                "description": "\"20% off for the first 3 months\"."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "percent",
                  "amount"
                ]
              },
              "percent_off": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "amount_off_cents": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "duration": {
                "type": "string",
                "enum": [
                  "once",
                  "repeating",
                  "forever"
                ]
              },
              "duration_months": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "discount_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "Taken off the first charge, before tax."
              },
              "first_charge_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "The first charge after the discount, before tax."
              },
              "recurring_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "The price each period once the discount is over. The full price."
              },
              "recurring_discounted_cents": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "The price each period while a repeating or forever discount lasts. Null for once."
              },
              "discount_ends_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When a repeating discount ends, counted from today. Null otherwise."
              },
              "free_month_replaced": {
                "type": "boolean",
                "description": "True when the plan has a free first month that the code replaces. A code and a free first month never combine: the customer pays the discounted price today instead."
              },
              "first_charge_only": {
                "type": "boolean",
                "description": "For add-ons: the discount applies to the first, prorated charge only."
              }
            },
            "required": [
              "code",
              "name",
              "description",
              "kind",
              "percent_off",
              "amount_off_cents",
              "duration",
              "duration_months",
              "discount_cents",
              "first_charge_cents",
              "recurring_cents",
              "recurring_discounted_cents",
              "discount_ends_at",
              "free_month_replaced",
              "first_charge_only"
            ],
            "description": "The applied code, or absent when none was sent or it could not be used."
          },
          "billing_details_complete": {
            "type": "boolean",
            "description": "True when the company's billing details have a name, an email for invoices, and a full address. A purchase without them answers 409 `billing_details_required`, so the Summary step asks for them first. Optional so an older API parses."
          },
          "regional_surcharge": {
            "type": "object",
            "properties": {
              "region": {
                "type": "string"
              },
              "location": {
                "type": "string",
                "description": "The city a person reads, such as \"Frankfurt\"."
              },
              "name": {
                "type": "string",
                "description": "\"Regional surcharge, Frankfurt\"."
              },
              "monthly_cents": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "One site a month, in cents."
              },
              "term_cents": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "One site for the license's term, in cents: the monthly amount times the months."
              }
            },
            "required": [
              "region",
              "location",
              "name",
              "monthly_cents",
              "term_cents"
            ],
            "description": "With a `region` that adds a regional surcharge: its own line, \"Regional surcharge, Frankfurt\", for each site whose live environment runs there, billed from the day the site is placed. Not in the totals above, which have no site yet. Absent for a base region."
          }
        },
        "required": [
          "lookup_key",
          "license",
          "license_name",
          "interval",
          "credits",
          "subtotal_cents",
          "tax_cents",
          "total_cents",
          "automatic_tax",
          "trial_days",
          "due_today_cents",
          "draft"
        ],
        "description": "The Summary step of checkout: the license, its price, the tax line, and the total."
      },
      "PaymentMethod": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 3,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9_]+$"
          },
          "brand": {
            "type": "string",
            "description": "`visa`, `mastercard`, `amex`, and so on, as Stripe names it."
          },
          "last4": {
            "type": "string",
            "pattern": "^\\d{4}$"
          },
          "exp_month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "exp_year": {
            "type": "integer"
          },
          "default": {
            "type": "boolean",
            "description": "True for the card that pays every plan and invoice."
          }
        },
        "required": [
          "id",
          "brand",
          "last4",
          "exp_month",
          "exp_year",
          "default"
        ],
        "description": "A saved card."
      },
      "PaymentMethodList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentMethod"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "CreateSetupIntentRequest": {
        "type": "object",
        "properties": {},
        "description": "`POST /billing/setup-intents`: starts adding a card. The body is empty."
      },
      "SetupIntent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 3,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9_]+$"
          },
          "client_secret": {
            "type": "string",
            "minLength": 10
          }
        },
        "required": [
          "id",
          "client_secret"
        ],
        "description": "Confirm it in the browser with Stripe.js (`confirmCardSetup`), then register the card."
      },
      "AddPaymentMethodRequest": {
        "type": "object",
        "properties": {
          "payment_method_id": {
            "type": "string",
            "minLength": 3,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9_]+$"
          },
          "set_default": {
            "type": "boolean",
            "default": false,
            "description": "Makes it the default card. The first card is always the default."
          }
        },
        "required": [
          "payment_method_id"
        ],
        "description": "`POST /billing/payment-methods`: registers a card the browser confirmed with a setup intent."
      },
      "InvoicePage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Our invoice id, the one in the page address."
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "paid",
              "void"
            ]
          },
          "invoice_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The invoice number, such as \"2VRBR54J-0002\", or null before Stripe numbers it."
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "tax_cents": {
            "type": "integer",
            "description": "The tax Stripe put on the invoice, inside `total_cents`. 0 or absent when there is none."
          },
          "total_cents": {
            "type": "integer"
          },
          "amount_due_cents": {
            "type": "integer",
            "description": "What is still owed. 0 once paid or voided."
          },
          "due_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "description": "The note staff wrote, or null."
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "maxLength": 300,
                  "description": "Our own words, such as \"Dedicated server, 4 vCPUs, 31 GB memory, month to month\"."
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1
                },
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "description",
                "quantity",
                "amount_cents"
              ]
            }
          },
          "billed_to": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The company the invoice is for: its billing name and address, as one line each."
          },
          "from": {
            "type": "string",
            "description": "Who sent it. Always WP Waterfall."
          },
          "client_secret": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pays the open invoice with Stripe.js. Null unless the invoice is open and the caller can pay."
          },
          "can_pay": {
            "type": "boolean",
            "description": "False for staff looking at the invoice as the customer: they read it and cannot pay it."
          },
          "auto_charge_consent": {
            "type": "boolean",
            "description": "True for the first invoice of a month to month server: paying it lets the card be charged monthly."
          },
          "pdf_available": {
            "type": "boolean",
            "description": "True when the invoice has a PDF at `GET /v1/billing/invoices/{id}/pdf`."
          },
          "publishable_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "A Stripe publishable key to use instead of the one the page was built with, or null. Only a staff test company on a live platform needs one, because it pays in Stripe test mode."
          }
        },
        "required": [
          "id",
          "state",
          "invoice_number",
          "currency",
          "total_cents",
          "amount_due_cents",
          "due_at",
          "paid_at",
          "memo",
          "lines",
          "billed_to",
          "from",
          "client_secret",
          "can_pay",
          "auto_charge_consent",
          "pdf_available",
          "publishable_key"
        ],
        "description": "What the invoice page shows. It carries no Stripe id, no machine type, and no Stripe text. The client secret is present only while the invoice is open and only for a person who can pay: it is what the Payment Element pays the invoice with."
      },
      "CancelSubscriptionRequest": {
        "type": "object",
        "properties": {
          "immediately": {
            "type": "boolean",
            "default": false,
            "description": "Ends now instead of at period end. Within 30 days of the first payment the refund is full."
          },
          "reason": {
            "type": "string",
            "maxLength": 500
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "Cancellation": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "none",
              "trialing",
              "active",
              "past_due",
              "read_only",
              "suspended",
              "cancelled"
            ]
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "refund_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Cents given back under the 30-day money-back guarantee (monthly plans only), or 0. It is the sum of `refund_to_card_cents` and `refund_to_credit_cents`."
          },
          "refund_to_card_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The part of the refund that went back to the card through Stripe."
          },
          "refund_to_credit_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The part of the refund that went back to the company's account credit, because account credit paid that part of the plan."
          },
          "non_refundable": {
            "type": "boolean",
            "description": "True when the plan is annual or three year: it runs to `ends_at`, renewal stops, and no refund or credit is given."
          },
          "credit_to_card_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Unused account credit from month to month payments that goes back to the card that paid it when the company's last plan ends. Present when the company holds account credit and this cancel ends its last plan. Payments are final: this is the only credit paid out."
          },
          "credit_kept_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Account credit that is never paid out: credit from an annual or 3 year term, a courtesy credit, a referral reward, or a promotion. It stays on the account and lapses with it."
          },
          "message": {
            "type": "string",
            "description": "One plain sentence about what happens next, such as the end date for a prepaid plan."
          }
        },
        "required": [
          "state",
          "ends_at",
          "refund_cents",
          "refund_to_card_cents",
          "refund_to_credit_cents"
        ]
      },
      "CancelPreview": {
        "type": "object",
        "properties": {
          "plan_name": {
            "type": "string"
          },
          "ends_now": {
            "type": "boolean",
            "description": "True when the plan ends right away: inside the money back window, or when asked to end now."
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the plan ends."
          },
          "refundable": {
            "type": "boolean",
            "description": "True when the cancel gives money back."
          },
          "refund_cents": {
            "type": "integer",
            "minimum": 0
          },
          "refund_to_card_cents": {
            "type": "integer",
            "minimum": 0
          },
          "refund_to_credit_cents": {
            "type": "integer",
            "minimum": 0
          },
          "non_refundable": {
            "type": "boolean",
            "description": "True for an annual or three year plan: it runs to `ends_at`, with no refund or credit."
          },
          "credit_to_card_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Unused account credit from month to month payments that would go back to the card when the plan ends. Present when the company holds account credit and this cancel ends its last plan. `message` says it in one sentence."
          },
          "credit_kept_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Account credit that is never paid out. It stays on the account and lapses with it."
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "plan_name",
          "ends_now",
          "ends_at",
          "refundable",
          "refund_cents",
          "refund_to_card_cents",
          "refund_to_credit_cents",
          "message"
        ],
        "description": "What a cancel would do, before the person confirms it. It changes nothing. The numbers are the ones the cancel would give, and `message` is the one plain sentence to show, so a person reads what is refunded, to where, or that nothing is, before anything happens."
      },
      "InvoiceList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "stripe_invoice_id": {
                  "type": "string"
                },
                "subscription_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The subscription the invoice bills, or null for a one-time charge or an unknown plan."
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "open",
                    "paid",
                    "uncollectible",
                    "void"
                  ]
                },
                "currency": {
                  "type": "string",
                  "const": "usd"
                },
                "subtotal_cents": {
                  "type": "integer"
                },
                "tax_cents": {
                  "type": "integer"
                },
                "total_cents": {
                  "type": "integer"
                },
                "amount_paid_cents": {
                  "type": "integer"
                },
                "period_start": {
                  "type": "string",
                  "format": "date-time"
                },
                "period_end": {
                  "type": "string",
                  "format": "date-time"
                },
                "lines": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string"
                      },
                      "lookup_key": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 3,
                        "maxLength": 80,
                        "pattern": "^[a-z0-9_]+$"
                      },
                      "quantity": {
                        "type": "number",
                        "minimum": 0
                      },
                      "amount_cents": {
                        "type": "integer"
                      },
                      "proration": {
                        "type": "boolean",
                        "description": "True for a prorated or credit line."
                      }
                    },
                    "required": [
                      "description",
                      "lookup_key",
                      "quantity",
                      "amount_cents",
                      "proration"
                    ]
                  }
                },
                "pdf_available": {
                  "type": "boolean",
                  "description": "True when the invoice has a PDF, which `GET /v1/billing/invoices/{id}/pdf` sends. False for drafts and for invoices Stripe has no PDF for yet. The invoice itself opens in the dashboard at `/settings/billing/invoices/<id>`; no Stripe address is ever shown."
                },
                "paid_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "stripe_invoice_id",
                "number",
                "status",
                "currency",
                "subtotal_cents",
                "tax_cents",
                "total_cents",
                "amount_paid_cents",
                "period_start",
                "period_end",
                "lines",
                "pdf_available",
                "paid_at",
                "created_at"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "BillingUsage": {
        "type": "object",
        "properties": {
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "metric": {
                  "type": "string",
                  "enum": [
                    "visits",
                    "bandwidth",
                    "disk",
                    "cdn",
                    "dedicated_bandwidth"
                  ]
                },
                "used": {
                  "type": "number",
                  "minimum": 0
                },
                "included": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                },
                "overage": {
                  "type": "number",
                  "minimum": 0
                },
                "overage_cents": {
                  "type": "integer",
                  "minimum": 0
                },
                "percent": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Used over included, as a percentage, or null when the metric has no limit."
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "ok",
                    "permission_needed",
                    "not_collected"
                  ],
                  "default": "ok",
                  "description": "`ok`: measured. `permission_needed`: Cloudflare refused the platform token, so this number is not known and `used` is not a real zero. `not_collected`: nothing has been measured yet."
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "Where the number came from, or why it is missing."
                },
                "source": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "`node_logs`, `cloudflare`, `heartbeat`, or null when nothing was measured."
                }
              },
              "required": [
                "metric",
                "used",
                "included",
                "overage",
                "overage_cents",
                "percent",
                "status",
                "note",
                "source"
              ]
            }
          },
          "overage_total_cents": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "The overage cents so far this period across all lines."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "default": null,
            "description": "When the newest figure was measured, or null when nothing was."
          },
          "previous_period": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "period_start": {
                "type": "string",
                "format": "date-time"
              },
              "period_end": {
                "type": "string",
                "format": "date-time"
              },
              "overage_cents": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "period_start",
              "period_end",
              "overage_cents"
            ],
            "default": null,
            "description": "The month before this one and the overage it put on the invoice, in cents: what Stripe was told for that month. Null before the plan's first full month, and null without a live plan."
          }
        },
        "required": [
          "period_start",
          "period_end",
          "lines",
          "overage_total_cents",
          "updated_at",
          "previous_period"
        ]
      },
      "BillingDetails": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The name on invoices: the buyer's own name."
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "An optional company name, printed on invoices with the name."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 254,
            "description": "The email invoices go to. Required to buy anything. It is null only for a company that has not saved one yet: every write needs a valid address, and a purchase asks for it first."
          },
          "address": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "line1": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "line2": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 200
              },
              "city": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "state": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100
              },
              "postal_code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 20
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "description": "ISO 3166-1 alpha-2."
              }
            },
            "required": [
              "line1",
              "line2",
              "city",
              "state",
              "postal_code",
              "country"
            ]
          },
          "tax_id": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "type": {
                "type": "string",
                "minLength": 2,
                "maxLength": 40,
                "description": "A Stripe tax id type such as `eu_vat` or `au_abn`."
              },
              "value": {
                "type": "string",
                "minLength": 2,
                "maxLength": 60
              }
            },
            "required": [
              "type",
              "value"
            ]
          },
          "has_payment_method": {
            "type": "boolean",
            "description": "True once a payment method is on file. The method itself stays in Stripe."
          }
        },
        "required": [
          "name",
          "email",
          "address",
          "tax_id",
          "has_payment_method"
        ],
        "description": "Billing details Stripe Tax uses. VAT and GST ids are validated by Stripe."
      },
      "PutBillingDetailsRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The name on invoices: the buyer's own name."
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "An optional company name, printed on invoices with the name."
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email"
          },
          "address": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "line1": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "line2": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 200
              },
              "city": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "state": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "postal_code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 20
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "description": "ISO 3166-1 alpha-2."
              }
            },
            "required": [
              "line1",
              "line2",
              "city",
              "state",
              "postal_code",
              "country"
            ]
          },
          "tax_id": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "type": {
                "type": "string",
                "minLength": 2,
                "maxLength": 40,
                "description": "A Stripe tax id type such as `eu_vat` or `au_abn`."
              },
              "value": {
                "type": "string",
                "minLength": 2,
                "maxLength": 60
              }
            },
            "required": [
              "type",
              "value"
            ]
          }
        },
        "description": "A write sends only what changes. An `email` that is sent must be a valid address: sending null or an empty string is refused with 422 and `BILLING_EMAIL_MESSAGE`, because the email is required."
      },
      "AddonCatalogList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "lookup_key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "route": {
                  "type": "string",
                  "enum": [
                    "addon",
                    "disaster_recovery"
                  ]
                },
                "scope": {
                  "type": "string",
                  "enum": [
                    "company",
                    "environment",
                    "site",
                    "zone",
                    "node"
                  ]
                },
                "unit": {
                  "type": "string"
                },
                "monthly_cents": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The monthly price of the smallest purchase: one unit, or `min_quantity` units when a purchase holds several (Standby Failover: 3 units of 100 USD, so 30000). Null when the add-on is not priced by the month (Custom SSL is yearly, see `unit_cents`) or is metered, quoted, or included."
                },
                "unit_cents": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The price of one unit for one `price_interval`. Null when metered, quoted, or included."
                },
                "price_interval": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "month",
                    "year"
                  ],
                  "description": "What `unit_cents` covers: a month or a year. Null when there is no flat price."
                },
                "min_quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "The fewest units one purchase holds."
                },
                "metered": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "per_event_cents": {
                      "type": "number"
                    },
                    "per_gb_cents": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "per_event_cents",
                    "per_gb_cents"
                  ]
                },
                "quote_from_cents": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "plan_keys": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  },
                  "description": "Plan lookup keys that may buy it. Null means every plan."
                },
                "max_quantity": {
                  "type": "integer"
                },
                "grants": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "entitlement": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "entitlement",
                      "amount"
                    ]
                  }
                },
                "features": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "key",
                "lookup_key",
                "name",
                "summary",
                "route",
                "scope",
                "unit",
                "monthly_cents",
                "unit_cents",
                "price_interval",
                "min_quantity",
                "metered",
                "quote_from_cents",
                "plan_keys",
                "max_quantity",
                "grants",
                "features"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "CompanyAddonList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "addon_key": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "environment_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "subscription_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The subscription whose Stripe item bills the add-on, or null when it bills on its own."
                },
                "site_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The site the add-on belongs to, when it names an environment. Null for a company wide add-on."
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "active",
                    "failed",
                    "removed"
                  ]
                },
                "proration_cents": {
                  "type": "integer"
                },
                "monthly_cents": {
                  "type": "integer"
                },
                "credit_cents": {
                  "type": "integer"
                },
                "job_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The node job that applies it, or null when there is no node work."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "removed_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "addon_key",
                "quantity",
                "environment_id",
                "status",
                "proration_cents",
                "monthly_cents",
                "credit_cents",
                "job_id",
                "created_at",
                "removed_at"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "entitlements": {
            "type": "object",
            "properties": {
              "sites": {
                "type": "number"
              },
              "disk_gb": {
                "type": "number"
              },
              "php_pool_mb": {
                "type": "number"
              },
              "redis_mb": {
                "type": "number"
              },
              "features": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "sites",
              "disk_gb",
              "php_pool_mb",
              "redis_mb",
              "features"
            ]
          }
        },
        "required": [
          "data",
          "entitlements"
        ]
      },
      "CompanyAddonSummary": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "`additional_disk`, `redis_512mb`, `tier_40`, `additional_previews`: the add-on key or tier."
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "addon",
                    "site_tier",
                    "preview_slots"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "summary": {
                  "type": "string",
                  "description": "One sentence about the add-on."
                },
                "term": {
                  "type": "string",
                  "enum": [
                    "monthly",
                    "annual",
                    "triennial",
                    "hourly",
                    "per_backup"
                  ]
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Units held: blocks, sites, slots."
                },
                "subscription_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The subscription the units bill on, when they all bill on one."
                },
                "uses": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "site_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "site_name": {
                        "type": "string"
                      },
                      "environment_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uuid"
                      },
                      "environment_name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "environment_kind": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "live",
                          "staging",
                          "preview"
                        ],
                        "description": "`live`, `staging`, or `preview`. Null when the use is the site as a whole."
                      },
                      "environment_status": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "running",
                          "sleeping",
                          "starting",
                          "stopped",
                          "failed"
                        ],
                        "description": "The environment's state in plain words: `running`, `sleeping` (idle, wakes on a visit), `starting` (being built), `stopped` (suspended or being deleted), or `failed`."
                      },
                      "quantity": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": [
                      "site_id",
                      "site_name",
                      "environment_id",
                      "environment_name",
                      "environment_kind",
                      "environment_status",
                      "quantity"
                    ]
                  },
                  "maxItems": 100,
                  "description": "The places that use it, by site name, at most `COMPANY_ADDON_USES_LIMIT`."
                },
                "uses_total": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "key",
                "kind",
                "name",
                "summary",
                "term",
                "quantity",
                "subscription_id",
                "uses",
                "uses_total"
              ]
            },
            "maxItems": 60
          }
        },
        "required": [
          "items"
        ],
        "description": "`GET /v1/companies/me/add-ons/summary`: the add-ons the company holds, grouped, with where each is used."
      },
      "PricingBreakdown": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "const": "usd"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "plan",
                    "site_tier",
                    "regional_surcharge",
                    "addon",
                    "dedicated_server",
                    "platform_fee"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "\"WP 5\", \"Plus site tier\", \"Additional Disk Space\"."
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0
                },
                "term": {
                  "type": "string",
                  "enum": [
                    "monthly",
                    "annual",
                    "triennial",
                    "hourly"
                  ]
                },
                "amount_cents": {
                  "type": "integer",
                  "description": "The charge for the whole line for one `term`, in cents, before any discount. For an hourly line it is what the hours used so far this period cost."
                },
                "subscription_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The subscription the line bills on, or null for an add-on or server on its own subscription."
                },
                "addon_key": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The add-on key of an add-on line, such as `additional_disk`."
                },
                "renews_on": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "The next charge date, or null when the line will not renew or has no date."
                },
                "ends_on": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "The last day of a line that is set to end. Such a line is not counted in the totals."
                },
                "counted": {
                  "type": "boolean",
                  "description": "True when the line is in the totals: it renews and is not billed by use. A usage billed line shows what it cost so far and is added to the next invoice."
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "quantity",
                "term",
                "amount_cents",
                "subscription_id",
                "addon_key",
                "renews_on",
                "ends_on",
                "counted"
              ]
            },
            "maxItems": 1000
          },
          "discounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The coupon's name as the invoice prints it, such as \"Spring sale\"."
                },
                "term": {
                  "type": "string",
                  "enum": [
                    "monthly",
                    "annual",
                    "triennial",
                    "hourly"
                  ]
                },
                "amount_cents": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "Cents taken off. Positive."
                },
                "subscription_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                }
              },
              "required": [
                "name",
                "term",
                "amount_cents",
                "subscription_id"
              ]
            },
            "maxItems": 100
          },
          "totals": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "term": {
                  "type": "string",
                  "enum": [
                    "monthly",
                    "annual",
                    "triennial",
                    "hourly"
                  ]
                },
                "subtotal_cents": {
                  "type": "integer"
                },
                "discount_cents": {
                  "type": "integer",
                  "minimum": 0
                },
                "tax_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Tax Stripe adds, in cents. Zero while tax collection is off."
                },
                "total_cents": {
                  "type": "integer",
                  "description": "What the term charges: subtotal, less discounts, plus tax."
                },
                "monthly_equivalent_cents": {
                  "type": "integer",
                  "description": "The total spread over the months of the term, rounded to the cent."
                }
              },
              "required": [
                "term",
                "subtotal_cents",
                "discount_cents",
                "tax_cents",
                "total_cents",
                "monthly_equivalent_cents"
              ]
            },
            "maxItems": 4,
            "description": "One total for each term that has a counted line, in the order monthly, annual, triennial."
          },
          "estimated": {
            "type": "boolean",
            "description": "True when Stripe could not be read for at least one subscription and its lines come from the plan's saved prices instead. The figures are then an estimate."
          }
        },
        "required": [
          "currency",
          "lines",
          "discounts",
          "totals",
          "estimated"
        ],
        "description": "`GET /billing/pricing-breakdown`: what the company pays on each recurring line, from the lines of Stripe's upcoming invoice for each subscription, so the figures are the ones Stripe will charge. An add-on or a server on its own subscription is priced from the amount charged when it was bought. Overage is not here: it is on the Usage page."
      },
      "AddCompanyAddonRequest": {
        "type": "object",
        "properties": {
          "addon_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "pattern": "^[a-z0-9_]+$"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "promo_code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "A promo code. It takes effect on the first, prorated charge only."
          }
        },
        "required": [
          "addon_key"
        ]
      },
      "CompanyAddonAdded": {
        "type": "object",
        "properties": {
          "addon": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "addon_key": {
                "type": "string"
              },
              "quantity": {
                "type": "integer"
              },
              "environment_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "subscription_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The subscription whose Stripe item bills the add-on, or null when it bills on its own."
              },
              "site_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The site the add-on belongs to, when it names an environment. Null for a company wide add-on."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "active",
                  "failed",
                  "removed"
                ]
              },
              "proration_cents": {
                "type": "integer"
              },
              "monthly_cents": {
                "type": "integer"
              },
              "credit_cents": {
                "type": "integer"
              },
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The node job that applies it, or null when there is no node work."
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "removed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "addon_key",
              "quantity",
              "environment_id",
              "status",
              "proration_cents",
              "monthly_cents",
              "credit_cents",
              "job_id",
              "created_at",
              "removed_at"
            ]
          },
          "proration_cents": {
            "type": "integer",
            "description": "The prorated charge for the rest of the current period, after any promo discount."
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "discount_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Cents a promo code took off the charge. Absent when no code was sent."
          }
        },
        "required": [
          "addon",
          "proration_cents",
          "job_id"
        ]
      },
      "CompanyAddonRemoved": {
        "type": "object",
        "properties": {
          "addon": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "addon_key": {
                "type": "string"
              },
              "quantity": {
                "type": "integer"
              },
              "environment_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "subscription_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The subscription whose Stripe item bills the add-on, or null when it bills on its own."
              },
              "site_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The site the add-on belongs to, when it names an environment. Null for a company wide add-on."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "active",
                  "failed",
                  "removed"
                ]
              },
              "proration_cents": {
                "type": "integer"
              },
              "monthly_cents": {
                "type": "integer"
              },
              "credit_cents": {
                "type": "integer"
              },
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The node job that applies it, or null when there is no node work."
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "removed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "addon_key",
              "quantity",
              "environment_id",
              "status",
              "proration_cents",
              "monthly_cents",
              "credit_cents",
              "job_id",
              "created_at",
              "removed_at"
            ]
          },
          "credit_cents": {
            "type": "integer",
            "description": "The credit for the unused part of the period."
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "required": [
          "addon",
          "credit_cents",
          "job_id"
        ]
      },
      "DedicatedServerResponse": {
        "type": "object",
        "properties": {
          "server": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The invoice record id."
              },
              "name": {
                "type": "string",
                "description": "The server name staff and the customer both read, such as `ded-4f2a91c7`."
              },
              "region": {
                "type": "string"
              },
              "region_name": {
                "type": "string"
              },
              "tier": {
                "type": "string"
              },
              "vcpu": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "memory_mb": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "disk_gb": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "included_bandwidth_gb": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Bandwidth included each month in GB."
              },
              "bandwidth_used_gb": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "description": "Bandwidth used this month in GB. Null until metering reports it: the hook is `dedicatedBandwidthUsedGb` in the API."
              },
              "term": {
                "type": "string",
                "enum": [
                  "monthly",
                  "annual",
                  "three_year"
                ]
              },
              "monthly_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "The monthly price, or the monthly equivalent of the term."
              },
              "total_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "The one charge of the term in cents. Not refundable."
              },
              "status": {
                "type": "string",
                "description": "The record status: `open` (waiting for payment), `paid`, `provisioning`, `ready`, `active`, `cancelling`, and so on."
              },
              "next_invoice_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the next term invoice is written: the end of the paid term. Null before payment or after a cancel."
              },
              "service_ends_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When a cancelled server's paid term ends."
              },
              "cancelled_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "latest_invoice": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "open",
                      "paid",
                      "past_due",
                      "void"
                    ]
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "total_cents": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "due_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "paid_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "hosted_invoice_url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Always null for a customer: the invoice is read and paid on the Billing pages. Staff views carry the Stripe copy."
                  }
                },
                "required": [
                  "status",
                  "number",
                  "total_cents",
                  "due_at",
                  "paid_at",
                  "hosted_invoice_url"
                ]
              },
              "sites": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "site_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "site_id",
                    "name"
                  ]
                }
              },
              "environments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "environment_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "site_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "site_name": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "live",
                        "staging",
                        "preview"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "running",
                        "starting",
                        "stopped",
                        "failed"
                      ],
                      "description": "`running`, `starting` (being built), `stopped` (being deleted), or `failed`."
                    }
                  },
                  "required": [
                    "environment_id",
                    "site_id",
                    "site_name",
                    "kind",
                    "status"
                  ]
                },
                "maxItems": 500,
                "description": "The environments on the server, with their state. Optional so an older API parses."
              },
              "lifecycle": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "cancel",
                      "move_back",
                      "resize"
                    ]
                  },
                  "step": {
                    "type": "string",
                    "enum": [
                      "awaiting_payment",
                      "building",
                      "moving",
                      "billing",
                      "snapshots",
                      "draining",
                      "deleting",
                      "failed"
                    ]
                  },
                  "requested_by": {
                    "type": "string"
                  },
                  "requested_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "target_tier": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The size a resize goes to."
                  },
                  "sites_left": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "sites_done": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "job_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The jobs of the steps so far, for the job drawer."
                  },
                  "proration_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "What an upsize owes for the rest of the term, in cents. Zero for a downsize."
                  },
                  "proration_invoice_url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "failure": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Plain words when the step is `failed`."
                  }
                },
                "required": [
                  "kind",
                  "step",
                  "requested_by",
                  "requested_at",
                  "target_tier",
                  "sites_left",
                  "sites_done",
                  "job_ids",
                  "proration_cents",
                  "proration_invoice_url",
                  "failure"
                ]
              },
              "actions": {
                "type": "object",
                "properties": {
                  "resize": {
                    "type": "object",
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "allowed",
                      "reason"
                    ]
                  },
                  "move_back": {
                    "type": "object",
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "allowed",
                      "reason"
                    ]
                  },
                  "cancel": {
                    "type": "object",
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "allowed",
                      "reason"
                    ]
                  }
                },
                "required": [
                  "resize",
                  "move_back",
                  "cancel"
                ]
              },
              "payment_notice": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "One sentence when a payment for the server failed or the saved card cannot pay the next renewal, the same as the email says. Null when nothing is wrong."
              }
            },
            "required": [
              "id",
              "name",
              "region",
              "region_name",
              "tier",
              "vcpu",
              "memory_mb",
              "disk_gb",
              "included_bandwidth_gb",
              "bandwidth_used_gb",
              "term",
              "monthly_cents",
              "total_cents",
              "status",
              "next_invoice_at",
              "service_ends_at",
              "cancelled_at",
              "latest_invoice",
              "sites",
              "lifecycle",
              "actions"
            ],
            "description": "Null when the company has no live dedicated server."
          },
          "open_request": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "created_at",
              "note"
            ]
          }
        },
        "required": [
          "server",
          "open_request"
        ]
      },
      "DedicatedServerQuote": {
        "type": "object",
        "properties": {
          "region": {
            "type": "string"
          },
          "region_name": {
            "type": "string"
          },
          "stale": {
            "type": "boolean",
            "description": "True when Google's price for the region was read a while ago."
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The key to send when creating an invoice, such as `c4d-8`."
                },
                "vcpu": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "memory_mb": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "disk_gb": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "The data disk in GB: 500, and 1,000 on the 32 vCPU tier."
                },
                "included_bandwidth_gb": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "Bandwidth included each month in GB. Shown only: metering is not built."
                },
                "term_prices": {
                  "type": "object",
                  "properties": {
                    "monthly": {
                      "type": "object",
                      "properties": {
                        "monthly_equivalent_cents": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "description": "The monthly equivalent in cents, from the owner's pricing sheet. Never typed by staff."
                        },
                        "months": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "description": "Months one charge covers: 12 for annual, 36 for three year."
                        },
                        "total_cents": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "description": "The one up front charge in cents. Not refundable."
                        }
                      },
                      "required": [
                        "monthly_equivalent_cents",
                        "months",
                        "total_cents"
                      ]
                    },
                    "annual": {
                      "type": "object",
                      "properties": {
                        "monthly_equivalent_cents": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "description": "The monthly equivalent in cents, from the owner's pricing sheet. Never typed by staff."
                        },
                        "months": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "description": "Months one charge covers: 12 for annual, 36 for three year."
                        },
                        "total_cents": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "description": "The one up front charge in cents. Not refundable."
                        }
                      },
                      "required": [
                        "monthly_equivalent_cents",
                        "months",
                        "total_cents"
                      ]
                    },
                    "three_year": {
                      "type": "object",
                      "properties": {
                        "monthly_equivalent_cents": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "description": "The monthly equivalent in cents, from the owner's pricing sheet. Never typed by staff."
                        },
                        "months": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "description": "Months one charge covers: 12 for annual, 36 for three year."
                        },
                        "total_cents": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "description": "The one up front charge in cents. Not refundable."
                        }
                      },
                      "required": [
                        "monthly_equivalent_cents",
                        "months",
                        "total_cents"
                      ]
                    }
                  },
                  "required": [
                    "monthly",
                    "annual",
                    "three_year"
                  ],
                  "description": "The price by term. A prepaid term is paid once and is not refundable. `monthly` is one month at a time with no commitment, and its `total_cents` is that month."
                }
              },
              "required": [
                "key",
                "vcpu",
                "memory_mb",
                "disk_gb",
                "included_bandwidth_gb",
                "term_prices"
              ]
            },
            "maxItems": 50,
            "description": "Sizes by vCPUs and memory. The key is `dedicated-<vCPUs>`, and no machine type is sent."
          }
        },
        "required": [
          "region",
          "region_name",
          "stale",
          "data"
        ],
        "description": "The sizes and term prices in one region, for the customer: the staff tier list without the machine type."
      },
      "DedicatedResizeRequest": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "The size the customer would like. Staff check it and run the change."
          },
          "note": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "tier"
        ]
      },
      "DedicatedMoveBackRequest": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "One site to move back. Leave it out to move every site on the server."
          },
          "confirm": {
            "type": "boolean",
            "description": "Moving a live site is a real change."
          }
        }
      },
      "DedicatedCancelRequest": {
        "type": "object",
        "properties": {
          "move_sites_to_shared": {
            "type": "boolean",
            "description": "The customer's choice for the sites still on the server. True moves each one to shared hosting first. Without it, a server with sites on it is refused with a plain reason."
          },
          "reason": {
            "type": "string",
            "maxLength": 500
          },
          "confirm": {
            "type": "boolean",
            "description": "Cancelling ends the server and is not refunded."
          }
        }
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "company_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "minLength": 16,
              "maxLength": 36
            },
            "description": "The companies the endpoint reaches. Null means every company the person belongs to, now and later. The endpoint belongs to the person, whatever workspace is selected."
          },
          "format": {
            "type": "string",
            "enum": [
              "json",
              "slack",
              "discord",
              "teams"
            ],
            "description": "How the message is written. `json` is signed. The chat formats are not."
          },
          "description": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Event types from the catalog, or `[\"*\"]`. Read as strings so an endpoint that still names an event retired later does not break the list."
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why WP Waterfall turned the endpoint off, or null."
          },
          "last_delivery_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "consecutive_failures": {
            "type": "integer",
            "minimum": 0,
            "description": "Dead deliveries in a row. WP Waterfall disables the endpoint after five."
          },
          "previous_secret_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "True while a rotated secret still verifies."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "url",
          "company_ids",
          "format",
          "description",
          "events",
          "status",
          "disabled_reason",
          "last_delivery_at",
          "last_success_at",
          "consecutive_failures",
          "previous_secret_expires_at",
          "created_at",
          "updated_at"
        ]
      },
      "WebhookEndpointList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CreatedWebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "company_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "minLength": 16,
              "maxLength": 36
            },
            "description": "The companies the endpoint reaches. Null means every company the person belongs to, now and later. The endpoint belongs to the person, whatever workspace is selected."
          },
          "format": {
            "type": "string",
            "enum": [
              "json",
              "slack",
              "discord",
              "teams"
            ],
            "description": "How the message is written. `json` is signed. The chat formats are not."
          },
          "description": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Event types from the catalog, or `[\"*\"]`. Read as strings so an endpoint that still names an event retired later does not break the list."
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why WP Waterfall turned the endpoint off, or null."
          },
          "last_delivery_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "consecutive_failures": {
            "type": "integer",
            "minimum": 0,
            "description": "Dead deliveries in a row. WP Waterfall disables the endpoint after five."
          },
          "previous_secret_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "True while a rotated secret still verifies."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "secret": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "company_ids",
          "format",
          "description",
          "events",
          "status",
          "disabled_reason",
          "last_delivery_at",
          "last_success_at",
          "consecutive_failures",
          "previous_secret_expires_at",
          "created_at",
          "updated_at",
          "secret"
        ],
        "description": "The create and rotate answers carry the signing secret, shown once."
      },
      "CreateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "company_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 16,
              "maxLength": 36
            },
            "minItems": 1,
            "maxItems": 100,
            "description": "The companies the endpoint reaches. Left out, it reaches every company the person belongs to, now and later. Each id must be a company the person belongs to. At most 100."
          },
          "format": {
            "type": "string",
            "enum": [
              "json",
              "slack",
              "discord",
              "teams"
            ],
            "default": "json",
            "description": "Where the messages go: `json` (default, signed), `slack`, `discord`, or `teams`."
          },
          "description": {
            "type": "string",
            "maxLength": 200,
            "default": ""
          },
          "events": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "job.succeeded",
                    "job.failed",
                    "job.cancelled",
                    "site.created",
                    "site.updated",
                    "site.deleted",
                    "site.status_changed",
                    "environment.created",
                    "environment.provisioned",
                    "environment.deleted",
                    "environment.cloned",
                    "environment.pushed",
                    "environment.promoted",
                    "git.push_received",
                    "build.succeeded",
                    "build.failed",
                    "deployment.succeeded",
                    "deployment.failed",
                    "backup.completed",
                    "backup.failed",
                    "backup.restored",
                    "domain.added",
                    "domain.attached",
                    "domain.error",
                    "domain.removed",
                    "domain.primary_changed",
                    "ssl.issued",
                    "ssl.failed",
                    "ssl.expiring",
                    "dns.zone.created",
                    "dns.zone.active",
                    "dns.zone.deleted",
                    "dns.records.changed",
                    "php.version_changed",
                    "plugin.updated",
                    "theme.updated",
                    "security.bot_protection_changed",
                    "security.ip_rules_changed",
                    "security.sftp_user_changed",
                    "security.ssh_changed",
                    "security.two_factor_changed",
                    "subscription.created",
                    "subscription.updated",
                    "subscription.cancelled",
                    "invoice.paid",
                    "invoice.payment_failed",
                    "billing.state_changed",
                    "usage.threshold",
                    "addon.enabled",
                    "addon.disabled",
                    "auto_update.completed",
                    "auto_update.failed",
                    "auto_update.run.started",
                    "auto_update.run.completed",
                    "auto_update.run.failed",
                    "auto_update.run.needs_confirmation",
                    "auto_update.run.approved",
                    "auto_update.run.rejected",
                    "auto_update.run.expired",
                    "migration.status_changed",
                    "integrity.issue_found",
                    "integrity.clean",
                    "site.down",
                    "site.up",
                    "node.created",
                    "node.deleted",
                    "webhook.test"
                  ]
                },
                {
                  "type": "string",
                  "const": "*"
                }
              ]
            },
            "minItems": 1,
            "maxItems": 68,
            "default": [
              "*"
            ]
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "url"
        ]
      },
      "PatchWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "company_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "minLength": 16,
              "maxLength": 36
            },
            "minItems": 1,
            "maxItems": 100,
            "description": "Replaces the companies the endpoint reaches. Each must be a company the person belongs to. Null reaches every company the person belongs to, now and later."
          },
          "format": {
            "type": "string",
            "enum": [
              "json",
              "slack",
              "discord",
              "teams"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 200
          },
          "events": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "job.succeeded",
                    "job.failed",
                    "job.cancelled",
                    "site.created",
                    "site.updated",
                    "site.deleted",
                    "site.status_changed",
                    "environment.created",
                    "environment.provisioned",
                    "environment.deleted",
                    "environment.cloned",
                    "environment.pushed",
                    "environment.promoted",
                    "git.push_received",
                    "build.succeeded",
                    "build.failed",
                    "deployment.succeeded",
                    "deployment.failed",
                    "backup.completed",
                    "backup.failed",
                    "backup.restored",
                    "domain.added",
                    "domain.attached",
                    "domain.error",
                    "domain.removed",
                    "domain.primary_changed",
                    "ssl.issued",
                    "ssl.failed",
                    "ssl.expiring",
                    "dns.zone.created",
                    "dns.zone.active",
                    "dns.zone.deleted",
                    "dns.records.changed",
                    "php.version_changed",
                    "plugin.updated",
                    "theme.updated",
                    "security.bot_protection_changed",
                    "security.ip_rules_changed",
                    "security.sftp_user_changed",
                    "security.ssh_changed",
                    "security.two_factor_changed",
                    "subscription.created",
                    "subscription.updated",
                    "subscription.cancelled",
                    "invoice.paid",
                    "invoice.payment_failed",
                    "billing.state_changed",
                    "usage.threshold",
                    "addon.enabled",
                    "addon.disabled",
                    "auto_update.completed",
                    "auto_update.failed",
                    "auto_update.run.started",
                    "auto_update.run.completed",
                    "auto_update.run.failed",
                    "auto_update.run.needs_confirmation",
                    "auto_update.run.approved",
                    "auto_update.run.rejected",
                    "auto_update.run.expired",
                    "migration.status_changed",
                    "integrity.issue_found",
                    "integrity.clean",
                    "site.down",
                    "site.up",
                    "node.created",
                    "node.deleted",
                    "webhook.test"
                  ]
                },
                {
                  "type": "string",
                  "const": "*"
                }
              ]
            },
            "minItems": 1,
            "maxItems": 68
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "SendTestWebhookRequest": {
        "type": "object",
        "properties": {
          "event_type": {
            "type": "string",
            "enum": [
              "job.succeeded",
              "job.failed",
              "job.cancelled",
              "site.created",
              "site.updated",
              "site.deleted",
              "site.status_changed",
              "environment.created",
              "environment.provisioned",
              "environment.deleted",
              "environment.cloned",
              "environment.pushed",
              "environment.promoted",
              "git.push_received",
              "build.succeeded",
              "build.failed",
              "deployment.succeeded",
              "deployment.failed",
              "backup.completed",
              "backup.failed",
              "backup.restored",
              "domain.added",
              "domain.attached",
              "domain.error",
              "domain.removed",
              "domain.primary_changed",
              "ssl.issued",
              "ssl.failed",
              "ssl.expiring",
              "dns.zone.created",
              "dns.zone.active",
              "dns.zone.deleted",
              "dns.records.changed",
              "php.version_changed",
              "plugin.updated",
              "theme.updated",
              "security.bot_protection_changed",
              "security.ip_rules_changed",
              "security.sftp_user_changed",
              "security.ssh_changed",
              "security.two_factor_changed",
              "subscription.created",
              "subscription.updated",
              "subscription.cancelled",
              "invoice.paid",
              "invoice.payment_failed",
              "billing.state_changed",
              "usage.threshold",
              "addon.enabled",
              "addon.disabled",
              "auto_update.completed",
              "auto_update.failed",
              "auto_update.run.started",
              "auto_update.run.completed",
              "auto_update.run.failed",
              "auto_update.run.needs_confirmation",
              "auto_update.run.approved",
              "auto_update.run.rejected",
              "auto_update.run.expired",
              "migration.status_changed",
              "integrity.issue_found",
              "integrity.clean",
              "site.down",
              "site.up",
              "node.created",
              "node.deleted",
              "webhook.test"
            ],
            "default": "webhook.test",
            "description": "Defaults to `webhook.test`. Any catalog event sends its sample payload."
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "endpoint_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "event_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "event_type": {
            "type": "string",
            "description": "An event type from the catalog. A string, so a retired event still shows in the log."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivering",
              "succeeded",
              "failed",
              "dead"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "last_status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "test": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "last_status_code",
          "next_attempt_at",
          "test",
          "created_at",
          "updated_at"
        ]
      },
      "WebhookDeliveryList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "WebhookDeliveryDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "endpoint_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "event_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "event_type": {
            "type": "string",
            "description": "An event type from the catalog. A string, so a retired event still shows in the log."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivering",
              "succeeded",
              "failed",
              "dead"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "last_status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "test": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "event": {
            "$ref": "#/components/schemas/WebhookEnvelope"
          },
          "attempts_log": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "1 for the first try. Redeliveries keep counting."
                },
                "manual": {
                  "type": "boolean",
                  "description": "True when a person asked for this attempt."
                },
                "status_code": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "request": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "body_bytes": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "url",
                    "headers",
                    "body_bytes"
                  ],
                  "description": "The request headers WP Waterfall sent, with the body length. The body is the event envelope. `url` holds the host the request went to, such as `hooks.slack.com`, and never the rest of the address: the path of a chat webhook is a credential."
                },
                "response": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "body": {
                      "type": "string"
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "headers",
                    "body",
                    "truncated"
                  ],
                  "description": "Response headers and the first 4 KiB of the body, or null when nothing came back."
                },
                "error": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "A plain sentence when the attempt never got an HTTP answer."
                },
                "duration_ms": {
                  "type": "integer",
                  "minimum": 0
                },
                "ts": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "number",
                "manual",
                "status_code",
                "request",
                "response",
                "error",
                "duration_ms",
                "ts"
              ]
            }
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "last_status_code",
          "next_attempt_at",
          "test",
          "created_at",
          "updated_at",
          "event",
          "attempts_log"
        ],
        "description": "A delivery with its event body and every attempt, oldest first."
      },
      "WebhookEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The event id. The same id arrives on every retry and redelivery of the event."
          },
          "type": {
            "type": "string",
            "description": "An event type from the catalog. Read as a string so an event retired later still parses."
          },
          "version": {
            "type": "number",
            "const": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "company_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "company_id",
          "data"
        ],
        "description": "The body of every delivery."
      },
      "WebhookEventCatalog": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "job.succeeded",
                    "job.failed",
                    "job.cancelled",
                    "site.created",
                    "site.updated",
                    "site.deleted",
                    "site.status_changed",
                    "environment.created",
                    "environment.provisioned",
                    "environment.deleted",
                    "environment.cloned",
                    "environment.pushed",
                    "environment.promoted",
                    "git.push_received",
                    "build.succeeded",
                    "build.failed",
                    "deployment.succeeded",
                    "deployment.failed",
                    "backup.completed",
                    "backup.failed",
                    "backup.restored",
                    "domain.added",
                    "domain.attached",
                    "domain.error",
                    "domain.removed",
                    "domain.primary_changed",
                    "ssl.issued",
                    "ssl.failed",
                    "ssl.expiring",
                    "dns.zone.created",
                    "dns.zone.active",
                    "dns.zone.deleted",
                    "dns.records.changed",
                    "php.version_changed",
                    "plugin.updated",
                    "theme.updated",
                    "security.bot_protection_changed",
                    "security.ip_rules_changed",
                    "security.sftp_user_changed",
                    "security.ssh_changed",
                    "security.two_factor_changed",
                    "subscription.created",
                    "subscription.updated",
                    "subscription.cancelled",
                    "invoice.paid",
                    "invoice.payment_failed",
                    "billing.state_changed",
                    "usage.threshold",
                    "addon.enabled",
                    "addon.disabled",
                    "auto_update.completed",
                    "auto_update.failed",
                    "auto_update.run.started",
                    "auto_update.run.completed",
                    "auto_update.run.failed",
                    "auto_update.run.needs_confirmation",
                    "auto_update.run.approved",
                    "auto_update.run.rejected",
                    "auto_update.run.expired",
                    "migration.status_changed",
                    "integrity.issue_found",
                    "integrity.clean",
                    "site.down",
                    "site.up",
                    "node.created",
                    "node.deleted",
                    "webhook.test"
                  ]
                },
                "group": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "failure",
                    "success",
                    "info"
                  ],
                  "description": "`failure` is something that went wrong or needs attention. The dashboard's \"Failures only\" ticks these."
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                }
              },
              "required": [
                "type",
                "group",
                "description",
                "kind",
                "version"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "SiteMoveNotice": {
        "type": "object",
        "properties": {
          "strategy": {
            "type": "string",
            "enum": [
              "live",
              "offline"
            ]
          },
          "message": {
            "type": "string",
            "description": "The line to show, such as \"Moving to a server with more room. Your site stays online.\""
          },
          "progress_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "strategy",
          "message",
          "progress_percent",
          "started_at"
        ],
        "description": "What the customer sees on their site while it moves: one plain line and a progress number. The Site response carries it as `move` while a move is open, and `null` otherwise."
      },
      "PromoRedemptionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "promo_code_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "company_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "code": {
                  "type": "string"
                },
                "target": {
                  "type": "string",
                  "enum": [
                    "plan",
                    "addon"
                  ]
                },
                "target_key": {
                  "type": "string",
                  "description": "The plan lookup key or the add-on key."
                },
                "stripe_subscription_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "addon_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "discount_cents": {
                  "type": "integer",
                  "description": "Taken off the first charge, in cents."
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "reserved",
                    "applied",
                    "released"
                  ]
                },
                "discount_ends_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When a repeating discount ends. Null for once and forever."
                },
                "description": {
                  "type": "string",
                  "description": "The code's plain description, for the customer's view."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "applied_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "promo_code_id",
                "company_id",
                "code",
                "target",
                "target_key",
                "stripe_subscription_id",
                "addon_id",
                "discount_cents",
                "status",
                "discount_ends_at",
                "description",
                "created_at",
                "applied_at"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "ValidatePromoCodeRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "target": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "plan"
                  },
                  "lookup_key": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 80,
                    "pattern": "^[a-z0-9_]+$"
                  }
                },
                "required": [
                  "kind",
                  "lookup_key"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "addon"
                  },
                  "addon_key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60,
                    "pattern": "^[a-z0-9_]+$"
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50
                  }
                },
                "required": [
                  "kind",
                  "addon_key"
                ]
              }
            ],
            "discriminator": {
              "propertyName": "kind"
            }
          }
        },
        "required": [
          "code",
          "target"
        ],
        "description": "`POST /billing/promo-codes/validate`. Rate limited per account and per address."
      },
      "PromoValidation": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "valid": {
                "type": "boolean",
                "const": true
              },
              "promo": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "The code in upper case."
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string",
                    "description": "\"20% off for the first 3 months\"."
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "percent",
                      "amount"
                    ]
                  },
                  "percent_off": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "amount_off_cents": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "duration": {
                    "type": "string",
                    "enum": [
                      "once",
                      "repeating",
                      "forever"
                    ]
                  },
                  "duration_months": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "discount_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Taken off the first charge, before tax."
                  },
                  "first_charge_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "The first charge after the discount, before tax."
                  },
                  "recurring_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "The price each period once the discount is over. The full price."
                  },
                  "recurring_discounted_cents": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "The price each period while a repeating or forever discount lasts. Null for once."
                  },
                  "discount_ends_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When a repeating discount ends, counted from today. Null otherwise."
                  },
                  "free_month_replaced": {
                    "type": "boolean",
                    "description": "True when the plan has a free first month that the code replaces. A code and a free first month never combine: the customer pays the discounted price today instead."
                  },
                  "first_charge_only": {
                    "type": "boolean",
                    "description": "For add-ons: the discount applies to the first, prorated charge only."
                  }
                },
                "required": [
                  "code",
                  "name",
                  "description",
                  "kind",
                  "percent_off",
                  "amount_off_cents",
                  "duration",
                  "duration_months",
                  "discount_cents",
                  "first_charge_cents",
                  "recurring_cents",
                  "recurring_discounted_cents",
                  "discount_ends_at",
                  "free_month_replaced",
                  "first_charge_only"
                ]
              }
            },
            "required": [
              "valid",
              "promo"
            ]
          },
          {
            "type": "object",
            "properties": {
              "valid": {
                "type": "boolean",
                "const": false
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "valid",
              "message"
            ]
          }
        ],
        "discriminator": {
          "propertyName": "valid"
        }
      },
      "ReferralLink": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The link to share, for example https://wpwaterfall.com/r/k7m2x9ab."
          },
          "program": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string"
              },
              "referrer_percent": {
                "type": "number",
                "description": "What the person who shares earns, as a share of the friend's first paid month."
              },
              "referrer_min_cents": {
                "type": "integer",
                "minimum": 0
              },
              "referrer_max_cents": {
                "type": "integer",
                "minimum": 0
              },
              "referee_credit_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "What the new customer gets once, as account credit."
              },
              "hold_days": {
                "type": "integer",
                "minimum": 0,
                "description": "Days after the friend's first payment before the reward is paid."
              },
              "annual_cap_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "The most one company earns in any 12 months."
              },
              "cookie_days": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "currency",
              "referrer_percent",
              "referrer_min_cents",
              "referrer_max_cents",
              "referee_credit_cents",
              "hold_days",
              "annual_cap_cents",
              "cookie_days"
            ]
          }
        },
        "required": [
          "code",
          "url",
          "program"
        ],
        "description": "`GET /referrals/link`."
      },
      "ReferralStats": {
        "type": "object",
        "properties": {
          "signups": {
            "type": "integer",
            "minimum": 0
          },
          "paying_customers": {
            "type": "integer",
            "minimum": 0
          },
          "rewarded": {
            "type": "integer",
            "minimum": 0
          },
          "currency": {
            "type": "string"
          },
          "credit_earned_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Credit already added to the account balance."
          },
          "credit_pending_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Credit waiting for the hold to end."
          }
        },
        "required": [
          "signups",
          "paying_customers",
          "rewarded",
          "currency",
          "credit_earned_cents",
          "credit_pending_cents"
        ],
        "description": "`GET /referrals/stats`."
      },
      "ReferralList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "signed_up",
                    "converted",
                    "rewarded",
                    "expired",
                    "rejected"
                  ]
                },
                "who": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "For example a***@gmail.com."
                },
                "date": {
                  "type": "string",
                  "format": "date-time",
                  "description": "When the friend signed up."
                },
                "reward_cents": {
                  "type": "integer",
                  "minimum": 0
                },
                "currency": {
                  "type": "string"
                },
                "reward_eligible_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When a converted referral's reward is paid."
                },
                "rejected_reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "same_email",
                    "same_card",
                    "same_network",
                    "same_account",
                    "too_many_signups",
                    "refunded",
                    "chargeback",
                    "annual_cap",
                    "voided_by_staff",
                    "partner_customer"
                  ]
                }
              },
              "required": [
                "id",
                "status",
                "who",
                "date",
                "reward_cents",
                "currency",
                "reward_eligible_at",
                "rejected_reason"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "ReferralInvite": {
        "type": "object",
        "properties": {
          "inviter": {
            "type": "string",
            "description": "The first name of the person who shared the link, or the company name."
          },
          "currency": {
            "type": "string"
          },
          "credit_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What the new customer gets after their first payment."
          }
        },
        "required": [
          "inviter",
          "currency",
          "credit_cents"
        ],
        "description": "`GET /referrals/invite/{code}`. Public. Feeds the banner on the sign-up page."
      },
      "ReferralClaimRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[a-hj-km-np-z2-9]{8}$"
          },
          "visited_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the visit happened, from the browser. Never later than now."
          }
        },
        "required": [
          "code"
        ],
        "description": "`POST /referrals/claim`. A signed-in new account claims a code it saved in the browser when the cookie did not arrive. Only an account made in the last 7 days after the visit can claim."
      },
      "ReferralClaimResult": {
        "type": "object",
        "properties": {
          "claimed": {
            "type": "boolean"
          }
        },
        "required": [
          "claimed"
        ]
      },
      "PartnerCommissions": {
        "type": "object",
        "properties": {
          "partner": {
            "type": "boolean",
            "description": "False when the company is not a partner or an approved affiliate. The rest is then empty."
          },
          "kind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "agency",
              "affiliate"
            ],
            "description": "Agency or affiliate. Null when not a partner."
          },
          "customers": {
            "type": "integer",
            "minimum": 0,
            "description": "Customers who signed up through the partner's link after it joined."
          },
          "currency": {
            "type": "string",
            "description": "The currency of every amount here, as a lower case ISO code: usd."
          },
          "commission_percent": {
            "type": "number",
            "description": "The commission share, in percent: 10."
          },
          "hold_days": {
            "type": "integer",
            "minimum": 0,
            "description": "Days an entry waits for refunds before it is earned."
          },
          "payout": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "credit",
              "manual"
            ],
            "description": "How earned commission is paid: account credit, or by hand as arranged. Null when not a partner."
          },
          "totals": {
            "type": "object",
            "properties": {
              "pending_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "Still inside the hold that waits for refunds."
              },
              "earned_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "Past the hold and not paid yet."
              },
              "paid_cents": {
                "type": "integer",
                "minimum": 0,
                "description": "Paid, as account credit or by hand."
              }
            },
            "required": [
              "pending_cents",
              "earned_cents",
              "paid_cents"
            ],
            "description": "The commission so far, by state, in cents."
          },
          "months": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "month": {
                  "type": "string",
                  "description": "The month the referred customers paid, as `2026-11`."
                },
                "customers": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "How many referred customers paid in that month, for this state."
                },
                "commission_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "The commission of that month and state, in cents."
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "earned",
                    "paid",
                    "void"
                  ],
                  "description": "Pending (inside the hold), earned, paid, or void (the invoice was refunded)."
                }
              },
              "required": [
                "month",
                "customers",
                "commission_cents",
                "status"
              ]
            },
            "description": "One row per month and state, the newest month first."
          }
        },
        "required": [
          "partner",
          "kind",
          "customers",
          "currency",
          "commission_percent",
          "hold_days",
          "payout",
          "totals",
          "months"
        ],
        "description": "`GET /partner/commissions`: the partner's own commission, by month."
      },
      "AffiliateApplication": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "none",
              "applied",
              "approved",
              "declined",
              "ended"
            ],
            "description": "None, applied (waiting for staff), approved, declined, or ended."
          },
          "agency_partner": {
            "type": "boolean",
            "description": "True when the company is in the Agency Partner Program: it earns the same commission already and does not apply."
          },
          "website_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The website or channel the application named. Null before an application."
          },
          "promotion": {
            "type": [
              "string",
              "null"
            ],
            "description": "How the applicant said it will promote WP Waterfall. Null before an application."
          },
          "applied_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the latest application was sent."
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When staff approved or declined it. Null while it waits."
          },
          "decline_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why staff declined it. Null unless declined."
          },
          "terms_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The terms version accepted. Null before an application."
          },
          "terms_accepted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the applicant accepted the terms. Null before an application."
          },
          "current_terms_version": {
            "type": "string",
            "description": "The version an application accepts today."
          },
          "commission_percent": {
            "type": "number",
            "description": "The commission share, in percent of the profit: 10."
          },
          "hold_days": {
            "type": "integer",
            "minimum": 0,
            "description": "Days an entry waits for refunds before it is earned."
          },
          "min_transfer_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The least a bank transfer pays, in cents."
          }
        },
        "required": [
          "state",
          "agency_partner",
          "website_url",
          "promotion",
          "applied_at",
          "decided_at",
          "decline_reason",
          "terms_version",
          "terms_accepted_at",
          "current_terms_version",
          "commission_percent",
          "hold_days",
          "min_transfer_cents"
        ],
        "description": "`GET /affiliate/application`: the company's own application and the program's numbers."
      },
      "AffiliateApplyRequest": {
        "type": "object",
        "properties": {
          "website_url": {
            "type": "string",
            "maxLength": 500,
            "format": "uri",
            "description": "The website or channel where you will share your link."
          },
          "promotion": {
            "type": "string",
            "minLength": 20,
            "maxLength": 2000,
            "description": "How you will promote WP Waterfall, in a few sentences."
          },
          "accept_terms": {
            "type": "boolean",
            "const": true,
            "description": "True: you accept the Affiliate Program Terms."
          },
          "terms_version": {
            "type": "string",
            "const": "2026-11-19",
            "description": "The terms version the page showed. It must be the current one."
          }
        },
        "required": [
          "website_url",
          "promotion",
          "accept_terms",
          "terms_version"
        ],
        "description": "`POST /affiliate/application`: apply to the Affiliate Program."
      },
      "McpConnection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "client": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "publisher": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "logo_uri": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "publisher",
              "logo_uri"
            ]
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "email",
              "name"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "access": {
            "type": "string",
            "enum": [
              "full",
              "limited"
            ]
          },
          "role_at_consent": {
            "type": [
              "string",
              "null"
            ]
          },
          "company_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The companies the connection may act in. null: every company the person belongs to."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked",
              "expired"
            ]
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "client",
          "user",
          "scopes",
          "access",
          "role_at_consent",
          "company_ids",
          "status",
          "last_used_at",
          "created_at",
          "expires_at",
          "revoked_at"
        ]
      },
      "McpConnectionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpConnection"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "ConsentRequest": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "The pending request id, or the id of an existing connection the person reconnects."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "reconnect": {
            "type": "boolean",
            "description": "True when the page reconnects a limited connection in place instead of starting a new one."
          },
          "client": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "publisher": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "logo_uri": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "redirect_host": {
                "type": "string"
              },
              "registered_via": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "publisher",
              "logo_uri",
              "redirect_host",
              "registered_via"
            ]
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "email",
              "name"
            ]
          },
          "two_factor_enabled": {
            "type": "boolean",
            "description": "Whether the person has two-factor on. With it on, Approve needs a recent sign-in."
          },
          "companies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "role"
              ]
            }
          },
          "home_company_id": {
            "type": "string",
            "description": "Reconnect only: the company the connection was made in, and the companies it reaches now."
          },
          "company_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "request_id",
          "expires_at",
          "reconnect",
          "client",
          "user",
          "two_factor_enabled",
          "companies"
        ]
      },
      "ConsentDecision": {
        "type": "object",
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "deny"
            ]
          },
          "company_id": {
            "type": "string",
            "minLength": 1
          },
          "access": {
            "type": "string",
            "enum": [
              "full",
              "read_only",
              "toolsets"
            ],
            "description": "What the connection may do. Left out means full access. The server keeps it on the grant."
          },
          "toolsets": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "maxItems": 40,
            "description": "The tool sets a `toolsets` connection may use."
          },
          "reach": {
            "type": "string",
            "enum": [
              "all",
              "selected"
            ],
            "description": "Which companies the connection may act in: every company the person belongs to, now and later, or the ids in `company_ids`. Left out, a new connection reaches only `company_id` and a reconnect keeps its list."
          },
          "company_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "maxItems": 100
          }
        },
        "required": [
          "decision"
        ],
        "description": "The body the consent screen posts. The grant is the whole role ceiling: nothing to pick."
      },
      "ConsentResult": {
        "type": "object",
        "properties": {
          "redirect_to": {
            "type": "string"
          },
          "granted_scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sites:read",
                "sites:write",
                "backups:write",
                "backups:restore_live",
                "users:read",
                "users:write",
                "activity:read",
                "billing:read",
                "billing:write",
                "domains:read",
                "dns:write",
                "danger:destroy",
                "webhooks:read",
                "webhooks:write",
                "keys:read",
                "keys:write",
                "ssh-keys:read",
                "ssh-keys:write"
              ]
            }
          },
          "reconnected": {
            "type": "boolean",
            "description": "True when an existing connection was reconnected in place: nothing to hand back to a client."
          }
        },
        "required": [
          "redirect_to"
        ],
        "description": "Where the browser goes next: the client's redirect with a code, or with `error=access_denied`."
      },
      "AnnounceConnection": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string",
            "enum": [
              "connected",
              "reconnected"
            ]
          }
        },
        "required": [
          "event"
        ],
        "description": "The body of `POST /connections/{id}/announce`. The hosted MCP server sends it with the person's session after Approve, so the API can write the bell notice and send the security email. The words come from the stored connection, never from the caller."
      },
      "AssistantConnection": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean",
            "description": "False when the server has no model key, the assistant is switched off for everyone, or the company has no paid plan and no site on one."
          },
          "status": {
            "type": "string",
            "enum": [
              "none",
              "active",
              "revoked"
            ]
          },
          "approved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "role_at_approval": {
            "type": [
              "string",
              "null"
            ],
            "description": "The role the person had when they approved. The role now is what limits every call."
          },
          "paused": {
            "type": "boolean",
            "default": false,
            "description": "True while staff have paused Nami for everyone. The screen shows one sentence in place of the message box, and every message route refuses with `assistant_paused`."
          }
        },
        "required": [
          "available",
          "status",
          "approved_at",
          "role_at_approval",
          "paused"
        ],
        "description": "The person's approval for Nami to act as them. `none` until the first Approve, then `active` until they turn it off or revoke it on the Connections page."
      },
      "ApproveAssistantConnection": {
        "type": "object",
        "properties": {
          "accept": {
            "type": "boolean",
            "const": true,
            "description": "Must be true: the screen has one Approve button."
          }
        },
        "required": [
          "accept"
        ]
      },
      "AssistantConversation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "title",
          "created_at",
          "updated_at"
        ]
      },
      "AssistantConversationList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssistantConversation"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "AssistantConversationDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "user",
                    "assistant"
                  ]
                },
                "blocks": {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "text"
                          },
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "text"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "sites"
                          },
                          "title": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string"
                                },
                                "primary_domain": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "status",
                                "primary_domain"
                              ]
                            },
                            "maxItems": 50
                          }
                        },
                        "required": [
                          "type",
                          "title",
                          "total",
                          "items"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "stats"
                          },
                          "title": {
                            "type": "string"
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                },
                                "hint": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "label",
                                "value"
                              ]
                            }
                          }
                        },
                        "required": [
                          "type",
                          "title",
                          "items"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "chart"
                          },
                          "title": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "line",
                              "bar"
                            ]
                          },
                          "unit": {
                            "type": "string",
                            "description": "Shown after the value, such as `visits` or `GB`."
                          },
                          "points": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "label",
                                "value"
                              ]
                            },
                            "maxItems": 120
                          },
                          "caption": {
                            "type": "string",
                            "maxLength": 200,
                            "description": "One short line under the title, built by the server from the data: the total or the average, such as `825 visits in total`. Absent when there is nothing to add."
                          }
                        },
                        "required": [
                          "type",
                          "title",
                          "kind",
                          "unit",
                          "points"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "table"
                          },
                          "title": {
                            "type": "string"
                          },
                          "columns": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "maxItems": 8
                          },
                          "rows": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "maxItems": 100
                          },
                          "row_links": {
                            "type": "array",
                            "items": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "maxItems": 100,
                            "description": "Where each row leads, parallel to `rows`: a dashboard path such as `/sites/abc/backups`, or null for a row with no page. Built by the server from the ids in the tool result, never from model text. Absent when no row leads anywhere."
                          }
                        },
                        "required": [
                          "type",
                          "title",
                          "columns",
                          "rows"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "job"
                          },
                          "job_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "label": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "description": "The job's own status, updated by `block_update` events until it ends."
                          }
                        },
                        "required": [
                          "type",
                          "job_id",
                          "label",
                          "status"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "confirm"
                          },
                          "action_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "change",
                              "spend",
                              "delete"
                            ]
                          },
                          "title": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "details": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "label",
                                "value"
                              ]
                            },
                            "maxItems": 12,
                            "description": "Label and value rows the server read from the tool's first step, such as Plan and Price."
                          },
                          "cost": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "amount_cents": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "currency": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 3
                              },
                              "interval": {
                                "type": "string",
                                "enum": [
                                  "month",
                                  "year",
                                  "once"
                                ]
                              }
                            },
                            "required": [
                              "amount_cents",
                              "currency",
                              "interval"
                            ],
                            "description": "The exact price when money is spent, from the preview tool and never from model text."
                          },
                          "typed_name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The name the person must type to enable the button, or null when a click is enough."
                          },
                          "expires_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "confirmed",
                              "cancelled",
                              "expired",
                              "failed"
                            ]
                          },
                          "result": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The outcome sentence once the state is no longer pending."
                          }
                        },
                        "required": [
                          "type",
                          "action_id",
                          "kind",
                          "title",
                          "summary",
                          "details",
                          "cost",
                          "typed_name",
                          "expires_at",
                          "state",
                          "result"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "secret"
                          },
                          "label": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "note": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "label",
                          "value",
                          "note"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "payment_method_needed"
                          },
                          "reason": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "reason"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "links"
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "href": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "label",
                                "href"
                              ]
                            },
                            "maxItems": 8
                          }
                        },
                        "required": [
                          "type",
                          "items"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "notice"
                          },
                          "tone": {
                            "type": "string",
                            "enum": [
                              "info",
                              "problem"
                            ]
                          },
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "tone",
                          "text"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "support"
                          },
                          "question": {
                            "type": "string",
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "type",
                          "question"
                        ]
                      }
                    ],
                    "discriminator": {
                      "propertyName": "type"
                    }
                  }
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "role",
                "blocks",
                "created_at"
              ]
            }
          }
        },
        "required": [
          "id",
          "title",
          "created_at",
          "updated_at",
          "messages"
        ]
      },
      "PatchAssistantConversation": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          }
        },
        "required": [
          "title"
        ]
      },
      "SendAssistantMessage": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "page": {
            "type": "string",
            "maxLength": 300,
            "description": "The dashboard path the person came from, such as `/sites/abc`, so \"this site\" means something."
          }
        },
        "required": [
          "text"
        ]
      },
      "DecideAssistantAction": {
        "type": "object",
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "confirm",
              "cancel"
            ]
          },
          "typed_name": {
            "type": "string",
            "maxLength": 200,
            "description": "The name the person typed, for a confirmation that sets `typed_name`."
          }
        },
        "required": [
          "decision"
        ]
      },
      "AssistantStreamEvent": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "const": "message_start"
              },
              "message_id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "event",
              "message_id"
            ]
          },
          {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "const": "text_delta"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "event",
              "text"
            ]
          },
          {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "const": "status"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "event",
              "text"
            ]
          },
          {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "const": "block"
              },
              "block": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "text"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "text"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "sites"
                      },
                      "title": {
                        "type": "string"
                      },
                      "total": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "name": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "primary_domain": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "status",
                            "primary_domain"
                          ]
                        },
                        "maxItems": 50
                      }
                    },
                    "required": [
                      "type",
                      "title",
                      "total",
                      "items"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "stats"
                      },
                      "title": {
                        "type": "string"
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            },
                            "hint": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ]
                        }
                      }
                    },
                    "required": [
                      "type",
                      "title",
                      "items"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "chart"
                      },
                      "title": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "line",
                          "bar"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "description": "Shown after the value, such as `visits` or `GB`."
                      },
                      "points": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ]
                        },
                        "maxItems": 120
                      },
                      "caption": {
                        "type": "string",
                        "maxLength": 200,
                        "description": "One short line under the title, built by the server from the data: the total or the average, such as `825 visits in total`. Absent when there is nothing to add."
                      }
                    },
                    "required": [
                      "type",
                      "title",
                      "kind",
                      "unit",
                      "points"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "table"
                      },
                      "title": {
                        "type": "string"
                      },
                      "columns": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 8
                      },
                      "rows": {
                        "type": "array",
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "maxItems": 100
                      },
                      "row_links": {
                        "type": "array",
                        "items": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "maxItems": 100,
                        "description": "Where each row leads, parallel to `rows`: a dashboard path such as `/sites/abc/backups`, or null for a row with no page. Built by the server from the ids in the tool result, never from model text. Absent when no row leads anywhere."
                      }
                    },
                    "required": [
                      "type",
                      "title",
                      "columns",
                      "rows"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "job"
                      },
                      "job_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "label": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "description": "The job's own status, updated by `block_update` events until it ends."
                      }
                    },
                    "required": [
                      "type",
                      "job_id",
                      "label",
                      "status"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "confirm"
                      },
                      "action_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "change",
                          "spend",
                          "delete"
                        ]
                      },
                      "title": {
                        "type": "string"
                      },
                      "summary": {
                        "type": "string"
                      },
                      "details": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ]
                        },
                        "maxItems": 12,
                        "description": "Label and value rows the server read from the tool's first step, such as Plan and Price."
                      },
                      "cost": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "amount_cents": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "currency": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 3
                          },
                          "interval": {
                            "type": "string",
                            "enum": [
                              "month",
                              "year",
                              "once"
                            ]
                          }
                        },
                        "required": [
                          "amount_cents",
                          "currency",
                          "interval"
                        ],
                        "description": "The exact price when money is spent, from the preview tool and never from model text."
                      },
                      "typed_name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "The name the person must type to enable the button, or null when a click is enough."
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "confirmed",
                          "cancelled",
                          "expired",
                          "failed"
                        ]
                      },
                      "result": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "The outcome sentence once the state is no longer pending."
                      }
                    },
                    "required": [
                      "type",
                      "action_id",
                      "kind",
                      "title",
                      "summary",
                      "details",
                      "cost",
                      "typed_name",
                      "expires_at",
                      "state",
                      "result"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "secret"
                      },
                      "label": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      },
                      "note": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "label",
                      "value",
                      "note"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "payment_method_needed"
                      },
                      "reason": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "reason"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "links"
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "href": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "href"
                          ]
                        },
                        "maxItems": 8
                      }
                    },
                    "required": [
                      "type",
                      "items"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "notice"
                      },
                      "tone": {
                        "type": "string",
                        "enum": [
                          "info",
                          "problem"
                        ]
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "tone",
                      "text"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "support"
                      },
                      "question": {
                        "type": "string",
                        "maxLength": 2000
                      }
                    },
                    "required": [
                      "type",
                      "question"
                    ]
                  }
                ],
                "discriminator": {
                  "propertyName": "type"
                }
              }
            },
            "required": [
              "event",
              "block"
            ]
          },
          {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "const": "block_update"
              },
              "match": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "job",
                      "confirm"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "type",
                  "id"
                ]
              },
              "block": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "text"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "text"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "sites"
                      },
                      "title": {
                        "type": "string"
                      },
                      "total": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "name": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "primary_domain": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "status",
                            "primary_domain"
                          ]
                        },
                        "maxItems": 50
                      }
                    },
                    "required": [
                      "type",
                      "title",
                      "total",
                      "items"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "stats"
                      },
                      "title": {
                        "type": "string"
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            },
                            "hint": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ]
                        }
                      }
                    },
                    "required": [
                      "type",
                      "title",
                      "items"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "chart"
                      },
                      "title": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "line",
                          "bar"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "description": "Shown after the value, such as `visits` or `GB`."
                      },
                      "points": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ]
                        },
                        "maxItems": 120
                      },
                      "caption": {
                        "type": "string",
                        "maxLength": 200,
                        "description": "One short line under the title, built by the server from the data: the total or the average, such as `825 visits in total`. Absent when there is nothing to add."
                      }
                    },
                    "required": [
                      "type",
                      "title",
                      "kind",
                      "unit",
                      "points"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "table"
                      },
                      "title": {
                        "type": "string"
                      },
                      "columns": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 8
                      },
                      "rows": {
                        "type": "array",
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "maxItems": 100
                      },
                      "row_links": {
                        "type": "array",
                        "items": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "maxItems": 100,
                        "description": "Where each row leads, parallel to `rows`: a dashboard path such as `/sites/abc/backups`, or null for a row with no page. Built by the server from the ids in the tool result, never from model text. Absent when no row leads anywhere."
                      }
                    },
                    "required": [
                      "type",
                      "title",
                      "columns",
                      "rows"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "job"
                      },
                      "job_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "label": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "description": "The job's own status, updated by `block_update` events until it ends."
                      }
                    },
                    "required": [
                      "type",
                      "job_id",
                      "label",
                      "status"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "confirm"
                      },
                      "action_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "change",
                          "spend",
                          "delete"
                        ]
                      },
                      "title": {
                        "type": "string"
                      },
                      "summary": {
                        "type": "string"
                      },
                      "details": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "value"
                          ]
                        },
                        "maxItems": 12,
                        "description": "Label and value rows the server read from the tool's first step, such as Plan and Price."
                      },
                      "cost": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "amount_cents": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "currency": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 3
                          },
                          "interval": {
                            "type": "string",
                            "enum": [
                              "month",
                              "year",
                              "once"
                            ]
                          }
                        },
                        "required": [
                          "amount_cents",
                          "currency",
                          "interval"
                        ],
                        "description": "The exact price when money is spent, from the preview tool and never from model text."
                      },
                      "typed_name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "The name the person must type to enable the button, or null when a click is enough."
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "confirmed",
                          "cancelled",
                          "expired",
                          "failed"
                        ]
                      },
                      "result": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "The outcome sentence once the state is no longer pending."
                      }
                    },
                    "required": [
                      "type",
                      "action_id",
                      "kind",
                      "title",
                      "summary",
                      "details",
                      "cost",
                      "typed_name",
                      "expires_at",
                      "state",
                      "result"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "secret"
                      },
                      "label": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      },
                      "note": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "label",
                      "value",
                      "note"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "payment_method_needed"
                      },
                      "reason": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "reason"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "links"
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "href": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label",
                            "href"
                          ]
                        },
                        "maxItems": 8
                      }
                    },
                    "required": [
                      "type",
                      "items"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "notice"
                      },
                      "tone": {
                        "type": "string",
                        "enum": [
                          "info",
                          "problem"
                        ]
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "tone",
                      "text"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "support"
                      },
                      "question": {
                        "type": "string",
                        "maxLength": 2000
                      }
                    },
                    "required": [
                      "type",
                      "question"
                    ]
                  }
                ],
                "discriminator": {
                  "propertyName": "type"
                }
              }
            },
            "required": [
              "event",
              "match",
              "block"
            ]
          },
          {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "const": "title"
              },
              "title": {
                "type": "string"
              }
            },
            "required": [
              "event",
              "title"
            ]
          },
          {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "const": "message_end"
              }
            },
            "required": [
              "event"
            ]
          },
          {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "const": "error"
              },
              "code": {
                "type": "string",
                "enum": [
                  "assistant_unavailable",
                  "not_approved",
                  "rate_limited",
                  "budget_exceeded",
                  "failed"
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "event",
              "code",
              "message"
            ]
          }
        ],
        "discriminator": {
          "propertyName": "event"
        },
        "description": "The answer to a message or a decision is a Server-Sent Events stream of these events, one JSON object per `data:` line. A message is complete at `message_end`. A closed connection before it leaves the stored message as it was; the dashboard reloads the conversation."
      },
      "OnboardingState": {
        "type": "object",
        "properties": {
          "step": {
            "type": "string",
            "enum": [
              "welcome",
              "plan",
              "site",
              "domain",
              "done"
            ],
            "description": "The step the account is on, from the plan, the sites, and the domains."
          },
          "has_plan": {
            "type": "boolean",
            "description": "A live plan pays for sites."
          },
          "has_site": {
            "type": "boolean",
            "description": "A real site exists. An Enterprise sandbox counts, a platform test site does not."
          },
          "site_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The newest real site, or null."
          },
          "domain_done": {
            "type": "boolean",
            "description": "A custom domain is on one of the company's sites."
          },
          "enterprise": {
            "type": "boolean",
            "description": "An Enterprise company: support sets its plans, so the plan step is skipped."
          },
          "can_buy": {
            "type": "boolean",
            "description": "The person may buy a plan (billing.write). Others are told to ask an owner."
          },
          "dismissed": {
            "type": "boolean",
            "description": "The person chose Skip to the dashboard."
          },
          "guided": {
            "type": "boolean",
            "description": "The dashboard opens the guided start. True while the account has no plan or no site, the person did not skip, and no staff member is acting as the customer."
          },
          "resumable": {
            "type": "boolean",
            "description": "The guided start applies to this person and could be opened again, whether or not they skipped it: the same rule as `guided` without the Skip. The star in the top bar uses it to put a person back into the setup. False for a member limited to some sites, for staff acting as the customer, and once the account has a plan, a site, and nothing running."
          },
          "work": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "install",
                  "migration"
                ]
              },
              "site_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "UUIDv7"
              },
              "site_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "job_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "UUIDv7"
              },
              "migration_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "UUIDv7"
              }
            },
            "required": [
              "kind",
              "site_id",
              "site_name",
              "job_id",
              "migration_id"
            ],
            "description": "A site install or migration in flight, or null. While it runs the chat stays open on it."
          },
          "assistant": {
            "type": "boolean",
            "description": "Nami AI runs on this platform. False when the server has no model key or the assistant is switched off for everyone: a new account then starts in the classic Welcome, not the guided start, because the chat could not answer what the person types."
          }
        },
        "required": [
          "step",
          "has_plan",
          "has_site",
          "site_id",
          "domain_done",
          "enterprise",
          "can_buy",
          "dismissed",
          "guided",
          "resumable",
          "work",
          "assistant"
        ]
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "type": {
            "type": "string",
            "enum": [
              "provision_environment",
              "delete_environment",
              "set_php_version",
              "set_php_performance",
              "set_php_settings",
              "restart_php",
              "clear_server_cache",
              "search_replace",
              "run_wp_cli",
              "rotate_credentials",
              "apply_nginx_settings",
              "db_import",
              "cron_sync",
              "build_release",
              "activate_release",
              "create_repository",
              "create_node",
              "drain_node",
              "delete_node",
              "purchase_cud",
              "files_write",
              "files_delete",
              "files_rename",
              "phpmyadmin_session",
              "db_check",
              "db_rows_write",
              "db_sql_execute",
              "ssh_update",
              "sftp_account_change",
              "tool_setting",
              "wp_user_create",
              "set_code_mode",
              "env_var_set",
              "env_var_delete",
              "reset_site",
              "set_webroot",
              "set_wp_secrets_key",
              "wp_admin_login_token",
              "wp_login_user_ensure",
              "wp_login_users_remove",
              "repo_commit_read",
              "create_preview_environment",
              "clone_content",
              "merge_branch",
              "create_snapshot",
              "restore_snapshot",
              "set_apm",
              "push_content",
              "commit_branch",
              "sync_working_tree",
              "issue_certificate",
              "register_hostname",
              "unregister_hostname",
              "object_cache_set",
              "patchstack_credentials_write",
              "patchstack_credentials_remove",
              "patchstack_kill_switch",
              "set_disk_quota",
              "prepare_standby",
              "start_replication",
              "verify_replica",
              "fence_site",
              "resync_replica",
              "set_site_suspension",
              "clear_log",
              "promote_environment",
              "copy_into_live",
              "auto_update_run",
              "delete_snapshot",
              "prune_snapshots",
              "backup_download",
              "configure_git_remote",
              "import_git_push",
              "pull_external_git",
              "offsite_backup_test",
              "offsite_backup_run",
              "offsite_backup_list",
              "offsite_backup_restore",
              "restart_service",
              "container_exec",
              "set_network_domain",
              "map_subsite_domain",
              "reap_orphan_containers",
              "migrate_container",
              "migrate_control",
              "migrate_export",
              "migrate_import",
              "migrate_precopy",
              "migrate_delta",
              "migrate_freeze",
              "migrate_thaw",
              "update_mu_plugin",
              "import_site_files",
              "wake_environment",
              "set_sleep_policy",
              "integrity_check",
              "malware_scan",
              "malware_restore",
              "container_images",
              "rebuild_container",
              "update_runtime_image",
              "node_reboot_status",
              "schedule_node_reboot",
              "reboot_node",
              "core_update_commit",
              "core_update_advance",
              "core_update_run",
              "takedown_environment",
              "release_takedown",
              "set_egress",
              "set_standby_hold",
              "copy_evidence",
              "drop_evidence",
              "transfer_site",
              "relabel_environment",
              "record_site_facts",
              "attach_domain",
              "remove_domain",
              "set_primary_domain",
              "apply_redirects",
              "apply_ip_rules",
              "apply_bot_protection",
              "purge_cache",
              "apply_edge_settings",
              "provision_dns_zone",
              "refresh_ssl",
              "set_edge_certificate",
              "remove_edge_certificate",
              "rename_site",
              "rename_temp_hostname",
              "network_sync",
              "migration_fetch",
              "migration_inspect",
              "migration_triage",
              "migration_import",
              "migration_move",
              "export_company_data",
              "export_user_data",
              "export_audit_log",
              "purge_company",
              "reseal_secrets",
              "run_pagespeed",
              "patchstack_provision",
              "patchstack_deprovision",
              "patchstack_reconcile",
              "wp_login_member_users_remove",
              "provision_standby",
              "failover_site",
              "failback_site",
              "accessibility_scan"
            ],
            "description": "A node job type or an edge job type."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "dispatched",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "node_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean",
                "default": false
              }
            },
            "required": [
              "code",
              "message",
              "retryable"
            ]
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {}
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the job does, in one plain sentence, such as \"Turn on the server cron on site Elric (staging)\". It names the action and the place and never holds a secret, a value, or site content: a WP-CLI command shows its command words and the names that are safe to show, and a placeholder such as \"(value hidden)\" for the rest. Null on old servers."
          },
          "site_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the site the job belongs to, when it has one."
          },
          "environment_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the environment the job runs on, such as `live` or `staging`."
          },
          "quiet": {
            "type": "boolean",
            "description": "True for background work and reads, such as a cron sync or a login link lookup. A customer screen leaves a quiet job out of its bell, its lists, and its toasts. Quiet jobs are still stored, audited, and retried. Absent on old servers, where nothing is quiet."
          },
          "parent_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job this one works for: the job that ran it as a step, or that queued it as a follow-up. That job reads as done only once its follow-ups ended: it stays `running` until then, and its log names any follow-up that failed. Null for a job nobody started on another's behalf. Absent on old servers."
          },
          "requested_by": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user",
                  "api_key",
                  "mcp_agent",
                  "system"
                ]
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null
              },
              "client_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "MCP client name and version from the handshake, for `mcp_agent` requests."
              },
              "client_version": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "id",
              "label"
            ]
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "environment_id",
          "site_id",
          "node_id",
          "group_id",
          "progress",
          "attempts",
          "error",
          "result",
          "requested_by",
          "idempotency_key",
          "created_at",
          "started_at",
          "finished_at",
          "updated_at"
        ],
        "description": "A job. Node-changing writes return this object with HTTP 202. The `result` has secrets redacted; credentials come from the reveal endpoints."
      },
      "JobList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Job"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "JobEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "job_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "ts": {
            "type": "string",
            "format": "date-time"
          },
          "level": {
            "type": "string",
            "enum": [
              "info",
              "warn",
              "error"
            ]
          },
          "message": {
            "type": "string"
          },
          "progress": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "queued",
              "dispatched",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ],
            "description": "Set on status transitions."
          },
          "data": {
            "type": "object",
            "additionalProperties": {},
            "default": {}
          }
        },
        "required": [
          "id",
          "job_id",
          "ts",
          "level",
          "message",
          "progress",
          "status",
          "data"
        ],
        "description": "One row of a job's history. Also the data of each server-sent event on the events stream."
      },
      "JobGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "action": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "succeeded",
              "partial",
              "failed",
              "cancelled"
            ]
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "succeeded": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "requested_by": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user",
                  "api_key",
                  "mcp_agent",
                  "system"
                ]
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null
              },
              "client_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "MCP client name and version from the handshake, for `mcp_agent` requests."
              },
              "client_version": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "id",
              "label"
            ]
          },
          "jobs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "job_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "environment_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "site_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "site_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "dispatched",
                    "running",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "error": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean",
                      "default": false
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "retryable"
                  ]
                }
              },
              "required": [
                "job_id",
                "environment_id",
                "site_id",
                "site_name",
                "status",
                "error"
              ]
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "action",
          "status",
          "total",
          "succeeded",
          "failed",
          "progress",
          "requested_by",
          "jobs",
          "created_at",
          "finished_at"
        ],
        "description": "One parent, one child per environment, one progress bar, per-site results."
      },
      "Region": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "city": {
            "type": "string"
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 2,
            "maxLength": 2,
            "description": "The ISO 3166 country code of the data center, such as `US`."
          },
          "label": {
            "type": "string",
            "description": "The city a person reads, such as \"Ashburn, Virginia\". It never shows the country. Show this, never `code`."
          },
          "provider": {
            "type": "string",
            "const": "gcp"
          },
          "has_data_center": {
            "type": "boolean",
            "description": "True when a shared node already runs here. False means no data center exists in this region yet: the first site opens one, which takes a few minutes and costs nothing extra. Optional so an older API still parses."
          },
          "machine_family": {
            "type": "string",
            "enum": [
              "C4D"
            ]
          },
          "default_machine_type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "warm",
              "on_demand",
              "closed",
              "unavailable"
            ]
          },
          "unavailable_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why a region is `unavailable` right now, in plain words. Null otherwise."
          },
          "first_site_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "Typical seconds from request to a live site. Null until measured on a real node."
          },
          "is_default": {
            "type": "boolean"
          },
          "closed_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why a closed region takes no sites, in plain words. Null for an open region."
          },
          "site_surcharge_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "The regional surcharge of one site a month here, in cents: 0 where Google prices the data center like us-east4, else a whole dollar amount each site whose live environment runs here adds to the plan. The plan price is the same everywhere. Optional so an older API parses."
          },
          "popular": {
            "type": "boolean",
            "description": "True for one of the most popular data centers, at most five at a time. With 20 or more live sites on the platform these are the five regions with the most live sites; below that, the regions WordPress sites most commonly use. Only a region a customer can pick is popular. Optional so an older API still parses."
          }
        },
        "required": [
          "code",
          "city",
          "provider",
          "machine_family",
          "default_machine_type",
          "status",
          "first_site_seconds",
          "is_default"
        ]
      },
      "RegionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Region"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "Platform": {
        "type": "object",
        "properties": {
          "test_sites": {
            "type": "boolean",
            "description": "True when `WPWATERFALL_TEST_SITES=enabled`."
          },
          "provisioning": {
            "type": "string",
            "enum": [
              "enabled",
              "payment_required",
              "disabled"
            ]
          },
          "default_region": {
            "type": "string"
          },
          "open_regions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Regions open for new sites and plans: every region where Google lists the node shape, less any held back by `WPWATERFALL_OPEN_REGIONS`. A region with no data center yet is open. Optional so an older API still parses."
          },
          "wordpress_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The WordPress version new sites get: the newest version WP Waterfall's nodes reported installing. Null when no site was installed yet. Optional so an older API still parses."
          },
          "price_refresh": {
            "type": "object",
            "properties": {
              "last_success_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the last refresh succeeded. Null when prices were never read."
              },
              "age_hours": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Whole hours since then. Null when prices were never read."
              },
              "stale": {
                "type": "boolean",
                "description": "True when the last refresh failed and the prices are the last good ones."
              },
              "warn_after_hours": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "48: two missed daily refreshes."
              }
            },
            "required": [
              "last_success_at",
              "age_hours",
              "stale",
              "warn_after_hours"
            ],
            "description": "How old Google's list prices are. Dedicated server prices come from them, so prices older than `warn_after_hours` show a staff warning."
          },
          "ingress": {
            "type": "object",
            "properties": {
              "a": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "aaaa": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "a",
              "aaaa"
            ],
            "description": "The addresses a domain's A and AAAA records point at to reach WP Waterfall sites: the published edge addresses of ADR 233, the same set as `dns_addresses` on an environment. Optional so an older API still parses."
          },
          "php_removal_dates": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "The day each PHP version leaves WP Waterfall, by version, as `YYYY-MM-DD` (from 00:00 UTC). The dates are in `php-eol.ts`. The PHP engine card reads it for its banner. Optional so an older API still parses."
          }
        },
        "required": [
          "test_sites",
          "provisioning",
          "default_region"
        ],
        "description": "`GET /v1/platform`: what this deployment lets the signed-in company do."
      },
      "Roadmap": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{2,47}$",
                  "description": "A stable snake case key. Never reused."
                },
                "title": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 60
                },
                "summary": {
                  "type": "string",
                  "minLength": 10,
                  "maxLength": 160
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "in_progress",
                    "planned",
                    "considering"
                  ]
                },
                "ask_us": {
                  "type": "boolean",
                  "description": "Whether the page offers \"Ask us\", which opens a support request about the item."
                }
              },
              "required": [
                "id",
                "title",
                "summary",
                "status",
                "ask_us"
              ],
              "additionalProperties": false
            },
            "maxItems": 50
          }
        },
        "required": [
          "data"
        ]
      },
      "Node": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "company_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null for the shared fleet. Dedicated nodes carry the owning company."
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string",
            "enum": [
              "gcp",
              "aws_ec2",
              "aws",
              "other",
              "demo"
            ]
          },
          "region": {
            "type": "string"
          },
          "public_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "outbound_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "agent_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "online",
              "degraded",
              "offline",
              "draining",
              "deleting"
            ]
          },
          "capacity": {
            "type": "object",
            "properties": {
              "environments": {
                "type": "integer",
                "minimum": 0
              },
              "cpu": {
                "type": "integer",
                "minimum": 0
              },
              "memory_mb": {
                "type": "integer",
                "minimum": 0
              },
              "disk_gb": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "environments",
              "cpu",
              "memory_mb",
              "disk_gb"
            ]
          },
          "allocated": {
            "type": "object",
            "properties": {
              "environments": {
                "type": "integer",
                "minimum": 0
              },
              "cpu": {
                "type": "integer",
                "minimum": 0
              },
              "memory_mb": {
                "type": "integer",
                "minimum": 0
              },
              "disk_gb": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "environments",
              "cpu",
              "memory_mb",
              "disk_gb"
            ]
          },
          "labels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "last_heartbeat_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "empty_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the node first held no environment. Null while it holds one."
          },
          "auto_delete_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the empty node cleanup deletes this node if it stays empty. Null for a node the cleanup never deletes (dedicated, kept, demo) or one that holds an environment."
          },
          "keep": {
            "type": "boolean",
            "description": "Staff override: true keeps the node running when it is empty."
          },
          "cleanup_blocked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the empty node cleanup left this node alone on its last look, for example a container that is still present. Null when nothing blocks it. Staff read this instead of a failed job."
          },
          "cleanup_next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The cleanup does not look at this node again before this time. Null when it is not waiting."
          },
          "provider_missing_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the provider reconcile first found the cloud instance missing. Null while the instance exists. A second check at least 5 minutes later marks the node deleted. The reconcile checks only the shared fleet, so a server a company owns reads null."
          },
          "removed_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why WP Waterfall marked the node deleted on its own, for example \"instance removed outside WP Waterfall\". Null for every other node. A company never lists a deleted node, so it reads null here."
          },
          "cpu_pressure_avg10": {
            "type": [
              "number",
              "null"
            ],
            "description": "CPU pressure of the node from its newest heartbeat (Linux PSI, percent of time some task waited for a CPU) over 10 and 60 seconds. Null until the agent has reported. Staff read it on the Servers page."
          },
          "cpu_pressure_avg60": {
            "type": [
              "number",
              "null"
            ]
          },
          "cpu_pressure": {
            "type": "string",
            "enum": [
              "ok",
              "high"
            ],
            "description": "The CPU valve: `high` when the 60 second average passed 60 percent. A node with `high` takes no new environment until it falls under 45 percent. Sites already on it keep running."
          },
          "disk_used_ratio": {
            "type": [
              "number",
              "null"
            ],
            "description": "How full the node's ZFS pool is, 0 to 1, from the newest heartbeat. Null until the agent has reported a pool size. Staff read it on the Servers page."
          },
          "disk_sampled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When `disk_used_ratio` was last read. A reading older than 5 minutes does not close the valve."
          },
          "disk_pressure": {
            "type": "string",
            "enum": [
              "ok",
              "high"
            ],
            "description": "The disk valve: `high` when the pool passed 75 percent. A node with `high` takes no NEW site until it falls under 70 percent. Sites already on it, and new environments of those sites, are unaffected."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "company_id",
          "name",
          "provider",
          "region",
          "public_ip",
          "outbound_ip",
          "agent_version",
          "status",
          "capacity",
          "allocated",
          "labels",
          "last_heartbeat_at",
          "empty_since",
          "auto_delete_at",
          "keep",
          "cleanup_blocked_reason",
          "cleanup_next_attempt_at",
          "created_at"
        ]
      },
      "NodeList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Node"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "NodeCapacity": {
        "type": "object",
        "properties": {
          "node_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "capacity": {
            "type": "object",
            "properties": {
              "environments": {
                "type": "integer",
                "minimum": 0
              },
              "cpu": {
                "type": "integer",
                "minimum": 0
              },
              "memory_mb": {
                "type": "integer",
                "minimum": 0
              },
              "disk_gb": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "environments",
              "cpu",
              "memory_mb",
              "disk_gb"
            ]
          },
          "allocated": {
            "type": "object",
            "properties": {
              "environments": {
                "type": "integer",
                "minimum": 0
              },
              "cpu": {
                "type": "integer",
                "minimum": 0
              },
              "memory_mb": {
                "type": "integer",
                "minimum": 0
              },
              "disk_gb": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "environments",
              "cpu",
              "memory_mb",
              "disk_gb"
            ]
          },
          "available": {
            "type": "object",
            "properties": {
              "environments": {
                "type": "integer",
                "minimum": 0
              },
              "cpu": {
                "type": "integer",
                "minimum": 0
              },
              "memory_mb": {
                "type": "integer",
                "minimum": 0
              },
              "disk_gb": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "environments",
              "cpu",
              "memory_mb",
              "disk_gb"
            ],
            "description": "Capacity minus allocation minus the 20 percent headroom. Never below zero."
          },
          "headroom_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "accepting_sites": {
            "type": "boolean"
          }
        },
        "required": [
          "node_id",
          "capacity",
          "allocated",
          "available",
          "headroom_percent",
          "accepting_sites"
        ]
      },
      "Site": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 63,
            "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$"
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "active",
              "failed",
              "deleting"
            ]
          },
          "test": {
            "type": "boolean",
            "description": "True for a simulated test site that runs on the demo node at no cost."
          },
          "template": {
            "type": "string",
            "enum": [
              "fresh_wordpress",
              "woocommerce",
              "multisite",
              "empty"
            ]
          },
          "multisite_mode": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "subdirectory",
              "subdomain"
            ],
            "description": "The network mode of a multisite site, null for every other template. A network counts as one site against the plan."
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                }
              },
              "required": [
                "id",
                "name",
                "color"
              ]
            }
          },
          "live_environment": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "node_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "node_name": {
                "type": "string"
              },
              "region": {
                "type": "string"
              },
              "php_version": {
                "type": "string",
                "enum": [
                  "8.1",
                  "8.2",
                  "8.3",
                  "8.4",
                  "8.5"
                ]
              },
              "wordpress_version": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "wordpress": {
                "type": "string",
                "enum": [
                  "installed",
                  "not_installed",
                  "unknown"
                ],
                "description": "ADR 172: `installed`, `not_installed`, or `unknown`. Every response sets it."
              },
              "temp_hostname": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "disk_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "health": {
                "type": "string",
                "enum": [
                  "healthy",
                  "degraded",
                  "down",
                  "unknown"
                ]
              },
              "health_note": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why `health` is not healthy, in one plain sentence, when a single-site read found out (the WP Waterfall plugin is not loaded on the server). Null or absent otherwise."
              },
              "updates": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "plugins": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "themes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "plugin_updates": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "theme_updates": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "checked_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "plugins",
                  "themes",
                  "plugin_updates",
                  "theme_updates",
                  "checked_at"
                ],
                "description": "Plugin and theme counts. Null: not read yet. Absent on an answer that does not carry them."
              },
              "vulnerabilities": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "How many known vulnerabilities the environment's WordPress, plugins, and themes have. Null: no vulnerability source is set up or it was not matched yet. Absent on an answer that does not carry it. Zero is a real answer: it was matched and nothing is known."
              }
            },
            "required": [
              "id",
              "node_id",
              "node_name",
              "region",
              "php_version",
              "wordpress_version",
              "temp_hostname",
              "status",
              "disk_bytes",
              "health"
            ],
            "description": "The live environment. Null until the owner launches live."
          },
          "staging_environment": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "node_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "node_name": {
                "type": "string"
              },
              "region": {
                "type": "string"
              },
              "php_version": {
                "type": "string",
                "enum": [
                  "8.1",
                  "8.2",
                  "8.3",
                  "8.4",
                  "8.5"
                ]
              },
              "wordpress_version": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "wordpress": {
                "type": "string",
                "enum": [
                  "installed",
                  "not_installed",
                  "unknown"
                ],
                "description": "ADR 172: `installed`, `not_installed`, or `unknown`. Every response sets it."
              },
              "temp_hostname": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "disk_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "health": {
                "type": "string",
                "enum": [
                  "healthy",
                  "degraded",
                  "down",
                  "unknown"
                ]
              },
              "health_note": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why `health` is not healthy, in one plain sentence, when a single-site read found out (the WP Waterfall plugin is not loaded on the server). Null or absent otherwise."
              },
              "updates": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "plugins": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "themes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "plugin_updates": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "theme_updates": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "checked_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "plugins",
                  "themes",
                  "plugin_updates",
                  "theme_updates",
                  "checked_at"
                ],
                "description": "Plugin and theme counts. Null: not read yet. Absent on an answer that does not carry them."
              },
              "vulnerabilities": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "How many known vulnerabilities the environment's WordPress, plugins, and themes have. Null: no vulnerability source is set up or it was not matched yet. Absent on an answer that does not carry it. Zero is a real answer: it was matched and nothing is known."
              }
            },
            "required": [
              "id",
              "node_id",
              "node_name",
              "region",
              "php_version",
              "wordpress_version",
              "temp_hostname",
              "status",
              "disk_bytes",
              "health"
            ],
            "description": "The staging environment every site starts with. Every response sets it."
          },
          "primary_environment": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "node_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "node_name": {
                "type": "string"
              },
              "region": {
                "type": "string"
              },
              "php_version": {
                "type": "string",
                "enum": [
                  "8.1",
                  "8.2",
                  "8.3",
                  "8.4",
                  "8.5"
                ]
              },
              "wordpress_version": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "wordpress": {
                "type": "string",
                "enum": [
                  "installed",
                  "not_installed",
                  "unknown"
                ],
                "description": "ADR 172: `installed`, `not_installed`, or `unknown`. Every response sets it."
              },
              "temp_hostname": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "disk_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "health": {
                "type": "string",
                "enum": [
                  "healthy",
                  "degraded",
                  "down",
                  "unknown"
                ]
              },
              "health_note": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why `health` is not healthy, in one plain sentence, when a single-site read found out (the WP Waterfall plugin is not loaded on the server). Null or absent otherwise."
              },
              "updates": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "plugins": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "themes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "plugin_updates": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "theme_updates": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "checked_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "plugins",
                  "themes",
                  "plugin_updates",
                  "theme_updates",
                  "checked_at"
                ],
                "description": "Plugin and theme counts. Null: not read yet. Absent on an answer that does not carry them."
              },
              "vulnerabilities": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "How many known vulnerabilities the environment's WordPress, plugins, and themes have. Null: no vulnerability source is set up or it was not matched yet. Absent on an answer that does not carry it. Zero is a real answer: it was matched and nothing is known."
              }
            },
            "required": [
              "id",
              "node_id",
              "node_name",
              "region",
              "php_version",
              "wordpress_version",
              "temp_hostname",
              "status",
              "disk_bytes",
              "health"
            ],
            "description": "Live once launched, otherwise staging: the environment to show first."
          },
          "launch_state": {
            "type": "string",
            "enum": [
              "staging_only",
              "launching",
              "launched",
              "launch_failed"
            ],
            "description": "Where the site is on the staging first path. Every response sets it."
          },
          "provisioning_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job that is provisioning the site, while it runs."
          },
          "move": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SiteMoveNotice"
              },
              {
                "type": "null"
              }
            ],
            "description": "While WP Waterfall moves the site to a server with more room, one plain line and a progress number. Set on a single site read, and absent or null otherwise."
          },
          "address_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The `rename_site` job that is moving the temporary addresses of the site's environments to the new name, while it runs. Set on a single site read and on the answer to a rename, and absent or null otherwise."
          },
          "subscription_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The license the site uses a credit of. Null for test sites."
          },
          "tier": {
            "type": "string",
            "enum": [
              "base",
              "tier_40",
              "tier_65",
              "tier_125",
              "tier_250"
            ],
            "description": "The site's performance tier. `base` is what its license includes."
          },
          "sandbox": {
            "type": "object",
            "properties": {
              "is_sandbox": {
                "type": "boolean",
                "const": true,
                "description": "True while the site has no live environment and holds no site license."
              },
              "included_previews": {
                "type": "integer",
                "minimum": 0,
                "description": "The preview environments the sandbox includes beside staging."
              },
              "disk_gb": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "The disk one environment may hold, in GB."
              },
              "awake_hours_monthly": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "The awake hours an environment has in a calendar month."
              },
              "backup_days": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "The days its backups are kept."
              },
              "awake_seconds_left": {
                "type": "integer",
                "minimum": 0,
                "description": "Environment only: the awake seconds left this month."
              },
              "hours_reset_at": {
                "type": "string",
                "format": "date-time",
                "description": "Environment only: when the awake hours come back, the first of the next month (UTC)."
              }
            },
            "required": [
              "is_sandbox",
              "included_previews",
              "disk_gb",
              "awake_hours_monthly",
              "backup_days"
            ],
            "description": "Set while the site is a sandbox: a free site with staging only, no live environment, and no site license. Its disk, awake hours, and backup days are in the object. Absent on every other site."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "test",
          "template",
          "labels",
          "live_environment",
          "provisioning_job_id",
          "created_at",
          "updated_at"
        ]
      },
      "SiteList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "name": {
                  "type": "string"
                },
                "slug": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 63,
                  "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "provisioning",
                    "active",
                    "failed",
                    "deleting"
                  ]
                },
                "test": {
                  "type": "boolean",
                  "description": "True for a simulated test site that runs on the demo node at no cost."
                },
                "template": {
                  "type": "string",
                  "enum": [
                    "fresh_wordpress",
                    "woocommerce",
                    "multisite",
                    "empty"
                  ]
                },
                "multisite_mode": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "subdirectory",
                    "subdomain"
                  ],
                  "description": "The network mode of a multisite site, null for every other template. A network counts as one site against the plan."
                },
                "labels": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "UUIDv7"
                      },
                      "name": {
                        "type": "string"
                      },
                      "color": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "color"
                    ]
                  }
                },
                "live_environment": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUIDv7"
                    },
                    "node_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUIDv7"
                    },
                    "node_name": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "php_version": {
                      "type": "string",
                      "enum": [
                        "8.1",
                        "8.2",
                        "8.3",
                        "8.4",
                        "8.5"
                      ]
                    },
                    "wordpress_version": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "wordpress": {
                      "type": "string",
                      "enum": [
                        "installed",
                        "not_installed",
                        "unknown"
                      ],
                      "description": "ADR 172: `installed`, `not_installed`, or `unknown`. Every response sets it."
                    },
                    "temp_hostname": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "disk_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0
                    },
                    "health": {
                      "type": "string",
                      "enum": [
                        "healthy",
                        "degraded",
                        "down",
                        "unknown"
                      ]
                    },
                    "health_note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why `health` is not healthy, in one plain sentence, when a single-site read found out (the WP Waterfall plugin is not loaded on the server). Null or absent otherwise."
                    },
                    "updates": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "plugins": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "themes": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "plugin_updates": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "theme_updates": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "checked_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "plugins",
                        "themes",
                        "plugin_updates",
                        "theme_updates",
                        "checked_at"
                      ],
                      "description": "Plugin and theme counts. Null: not read yet. Absent on an answer that does not carry them."
                    },
                    "vulnerabilities": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "How many known vulnerabilities the environment's WordPress, plugins, and themes have. Null: no vulnerability source is set up or it was not matched yet. Absent on an answer that does not carry it. Zero is a real answer: it was matched and nothing is known."
                    }
                  },
                  "required": [
                    "id",
                    "node_id",
                    "node_name",
                    "region",
                    "php_version",
                    "wordpress_version",
                    "temp_hostname",
                    "status",
                    "disk_bytes",
                    "health"
                  ],
                  "description": "The live environment. Null until the owner launches live."
                },
                "staging_environment": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUIDv7"
                    },
                    "node_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUIDv7"
                    },
                    "node_name": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "php_version": {
                      "type": "string",
                      "enum": [
                        "8.1",
                        "8.2",
                        "8.3",
                        "8.4",
                        "8.5"
                      ]
                    },
                    "wordpress_version": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "wordpress": {
                      "type": "string",
                      "enum": [
                        "installed",
                        "not_installed",
                        "unknown"
                      ],
                      "description": "ADR 172: `installed`, `not_installed`, or `unknown`. Every response sets it."
                    },
                    "temp_hostname": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "disk_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0
                    },
                    "health": {
                      "type": "string",
                      "enum": [
                        "healthy",
                        "degraded",
                        "down",
                        "unknown"
                      ]
                    },
                    "health_note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why `health` is not healthy, in one plain sentence, when a single-site read found out (the WP Waterfall plugin is not loaded on the server). Null or absent otherwise."
                    },
                    "updates": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "plugins": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "themes": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "plugin_updates": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "theme_updates": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "checked_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "plugins",
                        "themes",
                        "plugin_updates",
                        "theme_updates",
                        "checked_at"
                      ],
                      "description": "Plugin and theme counts. Null: not read yet. Absent on an answer that does not carry them."
                    },
                    "vulnerabilities": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "How many known vulnerabilities the environment's WordPress, plugins, and themes have. Null: no vulnerability source is set up or it was not matched yet. Absent on an answer that does not carry it. Zero is a real answer: it was matched and nothing is known."
                    }
                  },
                  "required": [
                    "id",
                    "node_id",
                    "node_name",
                    "region",
                    "php_version",
                    "wordpress_version",
                    "temp_hostname",
                    "status",
                    "disk_bytes",
                    "health"
                  ],
                  "description": "The staging environment every site starts with. Every response sets it."
                },
                "primary_environment": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUIDv7"
                    },
                    "node_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUIDv7"
                    },
                    "node_name": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "php_version": {
                      "type": "string",
                      "enum": [
                        "8.1",
                        "8.2",
                        "8.3",
                        "8.4",
                        "8.5"
                      ]
                    },
                    "wordpress_version": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "wordpress": {
                      "type": "string",
                      "enum": [
                        "installed",
                        "not_installed",
                        "unknown"
                      ],
                      "description": "ADR 172: `installed`, `not_installed`, or `unknown`. Every response sets it."
                    },
                    "temp_hostname": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "disk_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0
                    },
                    "health": {
                      "type": "string",
                      "enum": [
                        "healthy",
                        "degraded",
                        "down",
                        "unknown"
                      ]
                    },
                    "health_note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Why `health` is not healthy, in one plain sentence, when a single-site read found out (the WP Waterfall plugin is not loaded on the server). Null or absent otherwise."
                    },
                    "updates": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "plugins": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "themes": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "plugin_updates": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "theme_updates": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "checked_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "plugins",
                        "themes",
                        "plugin_updates",
                        "theme_updates",
                        "checked_at"
                      ],
                      "description": "Plugin and theme counts. Null: not read yet. Absent on an answer that does not carry them."
                    },
                    "vulnerabilities": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "How many known vulnerabilities the environment's WordPress, plugins, and themes have. Null: no vulnerability source is set up or it was not matched yet. Absent on an answer that does not carry it. Zero is a real answer: it was matched and nothing is known."
                    }
                  },
                  "required": [
                    "id",
                    "node_id",
                    "node_name",
                    "region",
                    "php_version",
                    "wordpress_version",
                    "temp_hostname",
                    "status",
                    "disk_bytes",
                    "health"
                  ],
                  "description": "Live once launched, otherwise staging: the environment to show first."
                },
                "launch_state": {
                  "type": "string",
                  "enum": [
                    "staging_only",
                    "launching",
                    "launched",
                    "launch_failed"
                  ],
                  "description": "Where the site is on the staging first path. Every response sets it."
                },
                "provisioning_job_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The job that is provisioning the site, while it runs."
                },
                "move": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SiteMoveNotice"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "While WP Waterfall moves the site to a server with more room, one plain line and a progress number. Set on a single site read, and absent or null otherwise."
                },
                "address_job_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The `rename_site` job that is moving the temporary addresses of the site's environments to the new name, while it runs. Set on a single site read and on the answer to a rename, and absent or null otherwise."
                },
                "subscription_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The license the site uses a credit of. Null for test sites."
                },
                "tier": {
                  "type": "string",
                  "enum": [
                    "base",
                    "tier_40",
                    "tier_65",
                    "tier_125",
                    "tier_250"
                  ],
                  "description": "The site's performance tier. `base` is what its license includes."
                },
                "sandbox": {
                  "type": "object",
                  "properties": {
                    "is_sandbox": {
                      "type": "boolean",
                      "const": true,
                      "description": "True while the site has no live environment and holds no site license."
                    },
                    "included_previews": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "The preview environments the sandbox includes beside staging."
                    },
                    "disk_gb": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "description": "The disk one environment may hold, in GB."
                    },
                    "awake_hours_monthly": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "description": "The awake hours an environment has in a calendar month."
                    },
                    "backup_days": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "description": "The days its backups are kept."
                    },
                    "awake_seconds_left": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Environment only: the awake seconds left this month."
                    },
                    "hours_reset_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Environment only: when the awake hours come back, the first of the next month (UTC)."
                    }
                  },
                  "required": [
                    "is_sandbox",
                    "included_previews",
                    "disk_gb",
                    "awake_hours_monthly",
                    "backup_days"
                  ],
                  "description": "Set while the site is a sandbox: a free site with staging only, no live environment, and no site license. Its disk, awake hours, and backup days are in the object. Absent on every other site."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "environments": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "UUIDv7"
                      },
                      "node_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "UUIDv7"
                      },
                      "node_name": {
                        "type": "string"
                      },
                      "region": {
                        "type": "string"
                      },
                      "php_version": {
                        "type": "string",
                        "enum": [
                          "8.1",
                          "8.2",
                          "8.3",
                          "8.4",
                          "8.5"
                        ]
                      },
                      "wordpress_version": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "wordpress": {
                        "type": "string",
                        "enum": [
                          "installed",
                          "not_installed",
                          "unknown"
                        ],
                        "description": "ADR 172: `installed`, `not_installed`, or `unknown`. Every response sets it."
                      },
                      "temp_hostname": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "disk_bytes": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 0
                      },
                      "health": {
                        "type": "string",
                        "enum": [
                          "healthy",
                          "degraded",
                          "down",
                          "unknown"
                        ]
                      },
                      "health_note": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Why `health` is not healthy, in one plain sentence, when a single-site read found out (the WP Waterfall plugin is not loaded on the server). Null or absent otherwise."
                      },
                      "updates": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "plugins": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "themes": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "plugin_updates": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "theme_updates": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "checked_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "plugins",
                          "themes",
                          "plugin_updates",
                          "theme_updates",
                          "checked_at"
                        ],
                        "description": "Plugin and theme counts. Null: not read yet. Absent on an answer that does not carry them."
                      },
                      "vulnerabilities": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 0,
                        "description": "How many known vulnerabilities the environment's WordPress, plugins, and themes have. Null: no vulnerability source is set up or it was not matched yet. Absent on an answer that does not carry it. Zero is a real answer: it was matched and nothing is known."
                      },
                      "name": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "live",
                          "staging",
                          "preview"
                        ]
                      },
                      "role": {
                        "type": "string",
                        "enum": [
                          "staging",
                          "live",
                          "preview"
                        ],
                        "description": "What the product calls the environment: `staging` (the site's one staging environment), `live`, or `preview`. Name an environment by its role, not its kind: a preview made in the dashboard is stored with the kind `staging` and its own name."
                      }
                    },
                    "required": [
                      "id",
                      "node_id",
                      "node_name",
                      "region",
                      "php_version",
                      "wordpress_version",
                      "temp_hostname",
                      "status",
                      "disk_bytes",
                      "health",
                      "name",
                      "kind"
                    ]
                  }
                }
              },
              "required": [
                "id",
                "name",
                "slug",
                "status",
                "test",
                "template",
                "labels",
                "live_environment",
                "provisioning_job_id",
                "created_at",
                "updated_at"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "SiteNameAvailability": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "taken",
              "reserved",
              "invalid"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "available",
          "label",
          "reason",
          "message"
        ],
        "description": "What `GET /sites/name-available` answers. `available` is true when the name can be used for a new site, or by the site that asks for it. `label` is the label the name gives (null when the name has no letter or digit). `reason` says why not, and never says who holds a taken name."
      },
      "SiteRenameImpact": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "The label the new name gives."
          },
          "custom_domains": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "domain_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "hostname": {
                  "type": "string"
                },
                "environment_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "environment_name": {
                  "type": "string"
                },
                "update": {
                  "type": "string",
                  "enum": [
                    "automatic",
                    "manual"
                  ]
                },
                "record_type": {
                  "type": "string",
                  "const": "CNAME",
                  "description": "The record that stops working: the customer's older CNAME."
                },
                "new_target": {
                  "type": "string",
                  "description": "The name the CNAME points at after the change: the fallback origin."
                }
              },
              "required": [
                "domain_id",
                "hostname",
                "environment_id",
                "environment_name",
                "update",
                "record_type",
                "new_target"
              ]
            }
          }
        },
        "required": [
          "label",
          "custom_domains"
        ]
      },
      "CreateSiteRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 60
          },
          "template": {
            "type": "string",
            "enum": [
              "fresh_wordpress",
              "woocommerce",
              "multisite",
              "empty"
            ],
            "default": "fresh_wordpress"
          },
          "multisite_mode": {
            "type": "string",
            "enum": [
              "subdirectory",
              "subdomain"
            ],
            "description": "Only with the `multisite` template: `subdirectory` (the default, `host/blog/`, works on the temporary hostname) or `subdomain` (`blog.host`; each subsite host needs its own attached domain, because the temporary hostname has no wildcard). Any other template refuses it (422)."
          },
          "region": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "A region code from `GET /regions`. Defaults to the platform default region."
          },
          "php_version": {
            "type": "string",
            "enum": [
              "8.1",
              "8.2",
              "8.3",
              "8.4",
              "8.5"
            ],
            "default": "8.5"
          },
          "table_prefix": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_]{1,40}$",
            "description": "The database table prefix (`$table_prefix` in wp-config.php), an advanced option. 1 to 40 letters, digits, or underscores, such as `site_`. Left out, the prefix is `wp_`. A multisite network keeps it for every subsite table (`site_2_posts`)."
          },
          "test": {
            "type": "boolean",
            "default": false,
            "description": "Creates a simulated test site. Needs `test_sites` on `GET /platform`."
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            },
            "maxItems": 20,
            "default": []
          },
          "site_title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The WordPress site title. Defaults to the site name."
          },
          "admin_email": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "The first WordPress administrator. Defaults to the requester's email."
          },
          "admin_username": {
            "type": "string",
            "pattern": "^[a-z0-9_.-]{3,60}$",
            "description": "The first administrator's username. Defaults to `wpwaterfall-admin`. `admin`, `administrator`, and `root` are refused because bots try them first."
          },
          "admin_password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 128,
            "description": "The first administrator's password: 12 to 128 characters with a letter and a number. Secret: never stored in the job, its events, or logs, and deleted once provisioning ends. Left out, the node sets a random password nobody sees, and people sign in with one-click login."
          },
          "locale": {
            "type": "string",
            "enum": [
              "en_US",
              "en_GB",
              "en_CA",
              "en_AU",
              "es_ES",
              "es_MX",
              "fr_FR",
              "fr_CA",
              "de_DE",
              "it_IT",
              "pt_BR",
              "pt_PT",
              "nl_NL",
              "sv_SE",
              "da_DK",
              "nb_NO",
              "fi",
              "pl_PL",
              "tr_TR",
              "ja",
              "zh_CN",
              "ko_KR"
            ],
            "description": "The WordPress language. Defaults to `en_US`. Others are downloaded from WordPress.org."
          },
          "subscription_id": {
            "type": "string",
            "format": "uuid",
            "description": "The plan whose free slot the site takes, from `GET /billing/subscriptions`. Optional: when it is left out and exactly one plan has a free slot, that plan is used. Test sites ignore it. An Enterprise company sends none: its new site is a sandbox until it goes live, and the request answers 422 `sandbox_no_plan_at_create` when it names one."
          }
        },
        "required": [
          "name"
        ]
      },
      "PatchSiteRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 60
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            },
            "maxItems": 20,
            "description": "Replaces the full set of labels on the site."
          },
          "subscription_id": {
            "type": "string",
            "format": "uuid",
            "description": "Moves the site to another plan with a free slot. Needs billing.write as well."
          }
        }
      },
      "ResetSiteRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          },
          "confirm_name": {
            "type": "string",
            "minLength": 1
          },
          "template": {
            "type": "string",
            "enum": [
              "fresh_wordpress",
              "woocommerce",
              "multisite",
              "empty"
            ],
            "default": "fresh_wordpress"
          },
          "multisite_mode": {
            "type": "string",
            "enum": [
              "subdirectory",
              "subdomain"
            ],
            "description": "The network mode for the multisite template. Left out, the environment keeps its own."
          },
          "php_version": {
            "type": "string",
            "enum": [
              "8.1",
              "8.2",
              "8.3",
              "8.4",
              "8.5"
            ]
          },
          "environment": {
            "type": "string",
            "enum": [
              "staging",
              "live"
            ],
            "default": "staging",
            "description": "The environment to reset. Staging is the only one that can be reset."
          }
        },
        "required": [
          "confirm",
          "confirm_name"
        ],
        "description": "Resets a site. The caller types the site name to confirm. Before launch it wipes staging and installs WordPress again from the template. Once live runs it resets staging only: staging gets live's code, database, and uploads again, after a restore point of staging. Live itself is never reset, so `environment: \"live\"` is refused."
      },
      "Environment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "kind": {
            "type": "string",
            "enum": [
              "live",
              "staging",
              "preview"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "staging",
              "live",
              "preview"
            ],
            "description": "`staging`, `live`, or `preview`. Every response sets it."
          },
          "is_live": {
            "type": "boolean",
            "description": "True for the live environment. Every response sets it."
          },
          "release_sha": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{40}$",
            "description": "The commit the environment's active release runs. Null before the first release."
          },
          "last_deployed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the active release went live on this environment."
          },
          "last_deployed_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who made the active release go live, such as a person's name or `system`."
          },
          "allowance": {
            "type": "string",
            "enum": [
              "included",
              "additional"
            ],
            "description": "`included` for the staging environment and the previews a plan includes, `additional` for a preview environment the customer pays for. Live is `included`. Every response sets it."
          },
          "price_waived": {
            "type": "boolean",
            "description": "True when staff turned the charge of an additional preview off (complimentary)."
          },
          "sandbox": {
            "type": "object",
            "properties": {
              "is_sandbox": {
                "type": "boolean",
                "const": true,
                "description": "True while the site has no live environment and holds no site license."
              },
              "included_previews": {
                "type": "integer",
                "minimum": 0,
                "description": "The preview environments the sandbox includes beside staging."
              },
              "disk_gb": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "The disk one environment may hold, in GB."
              },
              "awake_hours_monthly": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "The awake hours an environment has in a calendar month."
              },
              "backup_days": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "The days its backups are kept."
              },
              "awake_seconds_left": {
                "type": "integer",
                "minimum": 0,
                "description": "Environment only: the awake seconds left this month."
              },
              "hours_reset_at": {
                "type": "string",
                "format": "date-time",
                "description": "Environment only: when the awake hours come back, the first of the next month (UTC)."
              }
            },
            "required": [
              "is_sandbox",
              "included_previews",
              "disk_gb",
              "awake_hours_monthly",
              "backup_days"
            ],
            "description": "Set when the environment belongs to a sandbox site: the site has no live environment and no site license, and is free. It carries the awake seconds left this month and when they come back. Absent otherwise."
          },
          "sleep_when_idle": {
            "type": "boolean",
            "description": "The Sleep when idle setting: true for a non live environment that stops after 30 minutes without use and starts again on the first visit. Always false for live. Every response sets it."
          },
          "sleeping_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the environment went to sleep or began to wake. Null while it is awake."
          },
          "name": {
            "type": "string",
            "description": "`live`, `staging`, or the name an agency gave a preview environment."
          },
          "branch": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
            "description": "The Git branch this environment runs. Live runs the default branch."
          },
          "source_env_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The environment this one was cloned from. Null for live."
          },
          "code_immutable": {
            "type": "boolean",
            "description": "True when code on this environment is a read-only release. Live is always immutable; staging and previews are immutable only in the legacy Git mode."
          },
          "code_writable": {
            "type": "boolean",
            "description": "True when code may change in place: plugin and theme installs and updates, SFTP, SSH, wp-admin, and WP-CLI. Staging and previews with a working tree; never live. Every response sets it."
          },
          "connection_mode": {
            "type": "string",
            "enum": [
              "sftp",
              "git"
            ],
            "description": "ADR 032: `sftp` (a writable working tree) or `git` (code changes only by Git). Live is always `git`. Derived from `code_mode`. Every response sets it."
          },
          "content_store": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "dataset": {
                "type": "string"
              },
              "mount_path": {
                "type": "string"
              },
              "size_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "cloned_from_store_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "UUIDv7"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "dataset",
              "mount_path",
              "size_bytes",
              "cloned_from_store_id",
              "created_at"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "live",
              "failed",
              "resetting",
              "deleting",
              "sleeping",
              "waking",
              "suspended_abuse"
            ]
          },
          "abuse_case_reference": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^AB-\\d{4}-\\d{4,6}$",
            "description": "The case reference while the environment is `suspended_abuse`, such as `AB-2026-0017`. The dashboard shows it with one sentence and a button that opens Nami chat. Null otherwise. The reason and the staff note are never sent."
          },
          "node_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "node_name": {
            "type": "string"
          },
          "node_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "The status of the node the environment runs on (`online`, `provisioning`, `failed`, and so on), so a caller can see why an environment is stuck. Null when it has no node."
          },
          "region": {
            "type": "string"
          },
          "container_name": {
            "type": "string"
          },
          "php_version": {
            "type": "string",
            "enum": [
              "8.1",
              "8.2",
              "8.3",
              "8.4",
              "8.5"
            ]
          },
          "wordpress_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "wordpress": {
            "type": "string",
            "enum": [
              "installed",
              "not_installed",
              "unknown"
            ],
            "description": "Whether WordPress is installed, as the node last said: `installed`, `not_installed`, or `unknown` (never checked, or the check could not tell). Without WordPress the WordPress tools are hidden and their routes answer 409 `wordpress_not_installed`. `unknown` counts as installed. Every response sets it."
          },
          "wordpress_multisite": {
            "type": "boolean",
            "description": "True when WordPress runs as a Multisite network. Every response sets it."
          },
          "wordpress_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the node last said whether WordPress is installed. Null before the first check."
          },
          "wordpress_update": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "version": {
                "type": "string",
                "maxLength": 16,
                "pattern": "^\\d{1,3}\\.\\d{1,3}(\\.\\d{1,3})?$",
                "description": "The release that is out, such as `6.8.3`."
              },
              "security": {
                "type": "boolean",
                "description": "True when wordpress.org marks the version this environment runs insecure, so the release carries a security fix for it. WP Waterfall installs a security release at any hour, not only in the update window, when the site's live environment (or staging, before a launch) runs an insecure version. Every response sets it."
              },
              "installs_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When WP Waterfall starts to install it by itself. When the site's live environment (or staging, before a launch) runs a version wordpress.org marks insecure, it is the next run of the update task, at most 10 minutes ahead. Otherwise it is the start of the next update window, or of the window that is open now, so it can lie in the past. Sites start a few at a time from then on, security releases first. Null when WP Waterfall does not install this release on this environment by itself as things stand: automatic WordPress updates are off, the site's code lives in a connected repository, the environment is a preview or in SFTP mode, its server cannot take the update now, the site tried this release a short while ago, or the rollout is stopped."
              }
            },
            "required": [
              "version",
              "installs_at"
            ],
            "description": "The newer WordPress release that is out for this environment, and when WP Waterfall installs it. The platform reads the releases from wordpress.org every hour. Null when the environment runs the newest release of its major version, has no WordPress, or is a test site on the simulated server. Every response sets it."
          },
          "php_pool_mb": {
            "type": "integer"
          },
          "php_threads": {
            "type": "integer"
          },
          "profile": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "cpu": {
                "type": "integer",
                "minimum": 1,
                "maximum": 64
              },
              "memory_mb": {
                "type": "integer",
                "minimum": 256
              },
              "disk_gb": {
                "type": "integer",
                "minimum": 1
              },
              "max_processes": {
                "type": "integer",
                "minimum": 16,
                "default": 512
              }
            },
            "required": [
              "name",
              "cpu",
              "memory_mb",
              "disk_gb",
              "max_processes"
            ]
          },
          "temp_hostname": {
            "type": "string"
          },
          "site_path": {
            "type": "string"
          },
          "outbound_ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "The address other servers see when this site connects out, such as to a payment processor (the \"external IP\" of MyKinsta). Give it to a service that allowlists by address. It comes from the node record and is null until the site has a node. It can change when the site moves to another node."
          },
          "dns_target": {
            "type": "string",
            "description": "The name a CNAME record points at to connect a domain: the fallback origin, the same for every environment. A name on Cloudflare DNS uses it; so does any name while `dns_addresses` is empty. It never names the environment, so a DNS checker shows no site."
          },
          "dns_addresses": {
            "type": "object",
            "properties": {
              "a": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "ipv4"
                }
              },
              "aaaa": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "ipv6"
                }
              }
            },
            "required": [
              "a",
              "aaaa"
            ],
            "description": "The fixed addresses a custom domain's A and AAAA records point at: the MyKinsta \"site IP\" of WP Waterfall. The same set for every environment. Empty until staff set the addresses Cloudflare ties to the account; then a name at a DNS host other than Cloudflare uses them. They can change, and a change is announced."
          },
          "ssh_port": {
            "type": [
              "integer",
              "null"
            ]
          },
          "code_mode": {
            "type": "string",
            "enum": [
              "git",
              "classic"
            ]
          },
          "webroot_subfolder": {
            "type": "string"
          },
          "tool_settings": {
            "$ref": "#/components/schemas/ToolSettings"
          },
          "sftp": {
            "type": "object",
            "properties": {
              "host": {
                "type": "string"
              },
              "port": {
                "type": "integer"
              },
              "username": {
                "type": "string"
              },
              "password": {
                "type": "string",
                "const": "********"
              }
            },
            "required": [
              "host",
              "port",
              "username",
              "password"
            ]
          },
          "database": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "user": {
                "type": "string"
              },
              "host": {
                "type": "string"
              },
              "port": {
                "type": "integer"
              },
              "password": {
                "type": "string",
                "const": "********"
              },
              "table_prefix": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_]{1,40}$",
                "description": "The table prefix of the WordPress database. Every response sets it. Older callers may see it missing."
              }
            },
            "required": [
              "name",
              "user",
              "host",
              "port",
              "password"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "site_id",
          "kind",
          "name",
          "branch",
          "source_env_id",
          "code_immutable",
          "content_store",
          "status",
          "node_id",
          "node_name",
          "region",
          "container_name",
          "php_version",
          "wordpress_version",
          "php_pool_mb",
          "php_threads",
          "profile",
          "temp_hostname",
          "site_path",
          "outbound_ip",
          "dns_target",
          "dns_addresses",
          "ssh_port",
          "code_mode",
          "webroot_subfolder",
          "tool_settings",
          "sftp",
          "database",
          "created_at",
          "updated_at"
        ]
      },
      "EnvironmentList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Environment"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "PatchEnvironmentRequest": {
        "type": "object",
        "properties": {
          "php_version": {
            "type": "string",
            "enum": [
              "8.1",
              "8.2",
              "8.3",
              "8.4",
              "8.5"
            ]
          }
        },
        "description": "Changes PHP with automatic rollback on a 5xx from the homepage."
      },
      "PhpPerformance": {
        "type": "object",
        "properties": {
          "php_threads": {
            "type": "integer",
            "minimum": 1,
            "maximum": 256
          },
          "php_pool_mb": {
            "type": "integer",
            "minimum": 64
          }
        },
        "required": [
          "php_threads",
          "php_pool_mb"
        ],
        "description": "The PHP performance pool: PHP threads (max_children) and memory per thread come from it. Staff set the pool. Customers rebalance threads and memory inside it."
      },
      "RotateCredentialsRequest": {
        "type": "object",
        "properties": {
          "targets": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sftp",
                "database"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          }
        },
        "required": [
          "targets"
        ]
      },
      "SftpCredentialsReveal": {
        "type": "object",
        "properties": {
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "username": {
                  "type": "string"
                },
                "password": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "username",
                "password"
              ]
            }
          },
          "revealed_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "host",
          "port",
          "username",
          "password",
          "accounts",
          "revealed_at"
        ],
        "description": "The only response that shows SFTP secrets. It needs a recent sign-in and is audited."
      },
      "DatabaseCredentialsReveal": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "user": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "password": {
            "type": "string"
          },
          "revealed_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "user",
          "host",
          "port",
          "password",
          "revealed_at"
        ],
        "description": "The only response that shows the database password. It needs a recent sign-in."
      },
      "SshKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "name": {
            "type": "string"
          },
          "fingerprint": {
            "type": "string"
          },
          "public_key": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "environment_id",
          "user_id",
          "name",
          "fingerprint",
          "public_key",
          "created_at"
        ]
      },
      "CreateSshKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "public_key": {
            "type": "string",
            "maxLength": 8192,
            "pattern": "^(ssh-ed25519|ssh-rsa|ecdsa-sha2-nistp(256|384|521)|sk-ssh-ed25519@openssh\\.com) [A-Za-z0-9+/=]+( .*)?$"
          }
        },
        "required": [
          "name",
          "public_key"
        ]
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sites:read",
                "sites:write",
                "backups:write",
                "backups:restore_live",
                "users:read",
                "users:write",
                "activity:read",
                "billing:read",
                "billing:write",
                "domains:read",
                "dns:write",
                "danger:destroy",
                "webhooks:read",
                "webhooks:write",
                "keys:read",
                "keys:write",
                "ssh-keys:read",
                "ssh-keys:write"
              ]
            }
          },
          "company_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "minLength": 16,
              "maxLength": 36
            },
            "description": "The companies the key reaches. Null means every company the person belongs to, now and later. A call names its company in the X-Company-Id header."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ip_allowlist": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "age_days": {
            "type": "integer",
            "minimum": 0,
            "description": "Whole days since the key was made."
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set once the key is revoked. A revoked key stays in the list so activity can still name it."
          },
          "revoked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why a key stopped: \"creator left\" when the person who made it was removed from the company or their account was deleted, \"role changed\" when a lower role left it with no scope it may hold. Null for a key a person revoked themselves."
          },
          "effective_scopes": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "enum": [
                "sites:read",
                "sites:write",
                "backups:write",
                "backups:restore_live",
                "users:read",
                "users:write",
                "activity:read",
                "billing:read",
                "billing:write",
                "domains:read",
                "dns:write",
                "danger:destroy",
                "webhooks:read",
                "webhooks:write",
                "keys:read",
                "keys:write",
                "ssh-keys:read",
                "ssh-keys:write"
              ]
            },
            "description": "The scopes the key can use now. A key never does more than the person who made it, so a downgrade of that person's role takes scopes away. Null when the key works as it was made."
          },
          "current": {
            "type": "boolean",
            "description": "Only for a caller that is an AI assistant connection. `current` is true for the key that connection acts with, and `assistant_connection` is true for any key that backs an AI assistant connection. Both are left out for a signed-in person."
          },
          "assistant_connection": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "scopes",
          "company_ids",
          "expires_at",
          "ip_allowlist",
          "last_used_at",
          "created_at"
        ]
      },
      "ApiKeyList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKey"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CreatedApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sites:read",
                "sites:write",
                "backups:write",
                "backups:restore_live",
                "users:read",
                "users:write",
                "activity:read",
                "billing:read",
                "billing:write",
                "domains:read",
                "dns:write",
                "danger:destroy",
                "webhooks:read",
                "webhooks:write",
                "keys:read",
                "keys:write",
                "ssh-keys:read",
                "ssh-keys:write"
              ]
            }
          },
          "company_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "minLength": 16,
              "maxLength": 36
            },
            "description": "The companies the key reaches. Null means every company the person belongs to, now and later. A call names its company in the X-Company-Id header."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ip_allowlist": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "age_days": {
            "type": "integer",
            "minimum": 0,
            "description": "Whole days since the key was made."
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set once the key is revoked. A revoked key stays in the list so activity can still name it."
          },
          "revoked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why a key stopped: \"creator left\" when the person who made it was removed from the company or their account was deleted, \"role changed\" when a lower role left it with no scope it may hold. Null for a key a person revoked themselves."
          },
          "effective_scopes": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "enum": [
                "sites:read",
                "sites:write",
                "backups:write",
                "backups:restore_live",
                "users:read",
                "users:write",
                "activity:read",
                "billing:read",
                "billing:write",
                "domains:read",
                "dns:write",
                "danger:destroy",
                "webhooks:read",
                "webhooks:write",
                "keys:read",
                "keys:write",
                "ssh-keys:read",
                "ssh-keys:write"
              ]
            },
            "description": "The scopes the key can use now. A key never does more than the person who made it, so a downgrade of that person's role takes scopes away. Null when the key works as it was made."
          },
          "current": {
            "type": "boolean",
            "description": "Only for a caller that is an AI assistant connection. `current` is true for the key that connection acts with, and `assistant_connection` is true for any key that backs an AI assistant connection. Both are left out for a signed-in person."
          },
          "assistant_connection": {
            "type": "boolean"
          },
          "secret": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "scopes",
          "company_ids",
          "expires_at",
          "ip_allowlist",
          "last_used_at",
          "created_at",
          "secret"
        ]
      },
      "CreateApiKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 80
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sites:read",
                "sites:write",
                "backups:write",
                "backups:restore_live",
                "users:read",
                "users:write",
                "activity:read",
                "billing:read",
                "billing:write",
                "domains:read",
                "dns:write",
                "danger:destroy",
                "webhooks:read",
                "webhooks:write",
                "keys:read",
                "keys:write",
                "ssh-keys:read",
                "ssh-keys:write"
              ]
            },
            "minItems": 1,
            "maxItems": 100
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "ip_allowlist": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "maxItems": 100
          },
          "company_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 16,
              "maxLength": 36
            },
            "minItems": 1,
            "maxItems": 100,
            "description": "The companies the key reaches. Left out, it reaches every company the person belongs to, now and later. Each id must be a company the person belongs to. At most 100."
          },
          "confirm": {
            "type": "boolean",
            "description": "A key lasts one year when `expires_at` is left out. An `expires_at` more than a year away needs `confirm: true`. For an AI assistant connection only: the person's yes. The server refuses a key made through a connection without it. A signed-in person leaves it out."
          }
        },
        "required": [
          "name",
          "scopes"
        ]
      },
      "AccountSshKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "name": {
            "type": "string"
          },
          "fingerprint": {
            "type": "string"
          },
          "public_key": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Reserved. WP Waterfall does not read node logs yet, so this is null."
          }
        },
        "required": [
          "id",
          "name",
          "fingerprint",
          "public_key",
          "created_at",
          "last_used_at"
        ],
        "description": "SSH keys that belong to a person. A key works for Git over SSH on every staging and preview environment the person may push code to, in each company they belong to. Session only: an API key cannot add or remove one, because a key is a standing way in. ADR 105 lets the live connection of an AI assistant do it, with the ssh-keys:write scope and the person's yes."
      },
      "AccountSshKeyList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountSshKey"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "CreateAccountSshKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "public_key": {
            "type": "string",
            "maxLength": 8192,
            "pattern": "^(ssh-ed25519|ssh-rsa|ecdsa-sha2-nistp(256|384|521)|sk-ssh-ed25519@openssh\\.com) [A-Za-z0-9+/=]+( .*)?$"
          },
          "confirm": {
            "type": "boolean",
            "description": "For an AI assistant connection only: the person's yes. A signed-in person leaves it out."
          }
        },
        "required": [
          "name",
          "public_key"
        ]
      },
      "PutWebrootRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          },
          "subfolder": {
            "type": "string",
            "maxLength": 200,
            "pattern": "^([A-Za-z0-9._-]+(\\/[A-Za-z0-9._-]+)*)?$"
          }
        },
        "required": [
          "confirm",
          "subfolder"
        ]
      },
      "ClearCacheRequest": {
        "type": "object",
        "properties": {
          "paths": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "maxItems": 100,
            "description": "Purge only these paths. Omit to clear everything."
          }
        },
        "description": "Clears the server cache."
      },
      "RestartPhpRequest": {
        "type": "object",
        "properties": {}
      },
      "PhpSettingsRequest": {
        "type": "object",
        "properties": {
          "php_version": {
            "type": "string",
            "enum": [
              "8.1",
              "8.2",
              "8.3",
              "8.4",
              "8.5"
            ]
          },
          "auto_eol_upgrade": {
            "type": "boolean",
            "description": "Move to the next supported version before a version reaches end of life."
          },
          "ini": {
            "type": "object",
            "properties": {
              "memory_limit": {
                "type": "string",
                "pattern": "^\\d+[MG]$"
              },
              "max_execution_time": {
                "type": "integer",
                "minimum": 1,
                "maximum": 600
              },
              "max_input_vars": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 100000
              },
              "upload_max_filesize": {
                "type": "string",
                "pattern": "^\\d+[MG]$"
              },
              "post_max_size": {
                "type": "string",
                "pattern": "^\\d+[MG]$"
              },
              "display_errors": {
                "type": "boolean"
              }
            }
          }
        },
        "description": "PHP version and ini values. A version change rolls back on a 5xx from the homepage."
      },
      "SearchReplaceRequest": {
        "type": "object",
        "properties": {
          "search": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "replace": {
            "type": "string",
            "maxLength": 2000
          },
          "dry_run": {
            "type": "boolean",
            "default": true
          },
          "confirm": {
            "type": "boolean",
            "default": false
          },
          "tables": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_]+$"
            },
            "maxItems": 500
          },
          "case_sensitive": {
            "type": "boolean",
            "default": true
          },
          "regex": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "search",
          "replace"
        ],
        "description": "Search and replace. `dry_run` defaults to true and returns per-table counts. A real run needs `dry_run: false` and `confirm: true`."
      },
      "ToolSettings": {
        "type": "object",
        "properties": {
          "wp_debug": {
            "type": "boolean"
          },
          "password_protection": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "username": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "enabled",
              "username"
            ]
          },
          "strip_set_cookie": {
            "type": "boolean"
          },
          "mobile_cache": {
            "type": "boolean",
            "description": "Mobile cache: separate page caches for mobile and desktop. Every response sets it."
          },
          "redirects_enabled": {
            "type": "boolean",
            "description": "False when every redirect rule is switched off (the rules stay saved). A new environment starts with it off. Every response sets it."
          },
          "ip_deny_enabled": {
            "type": "boolean",
            "description": "False when every IP deny rule is switched off (the rules stay saved). A new environment starts with it off. Every response sets it."
          },
          "apm_enabled": {
            "type": "boolean",
            "description": "True while the APM tool is on in Tools. It only shows the APM tab: the dashboard hides the APM sidebar item while it is false. Whether APM is collecting is `enabled` of the APM status. Every response sets it."
          },
          "auto_login_enabled": {
            "type": "boolean",
            "description": "False when one click login (Log in to WP Admin) is off for this environment. A new environment starts with it off. The plain WordPress login page works either way. Every response sets it."
          },
          "block_xmlrpc": {
            "type": "boolean",
            "description": "False when the owner let /xmlrpc.php through for Jetpack, a mobile app, or another client. On by default for every site, so a missing value counts as on. Every response sets it."
          },
          "server_cron_enabled": {
            "type": "boolean",
            "description": "True while the Server cron tool runs WordPress's scheduled events from a server schedule. Off by default: WP Waterfall's standard schedule applies. Every response sets it."
          },
          "uptime_enabled": {
            "type": "boolean",
            "description": "False when the Monitor tool is off: nothing probes the live site and the Monitor tab says so. On by default, so a missing value counts as on. Every response sets it."
          },
          "speed": {
            "type": "object",
            "properties": {
              "remove_jquery_migrate": {
                "type": "boolean"
              },
              "preload": {
                "type": "boolean"
              },
              "defer": {
                "type": "boolean"
              }
            },
            "required": [
              "remove_jquery_migrate",
              "preload",
              "defer"
            ],
            "description": "Speed optimizations (Tools): jQuery Migrate removed from the front end, preload headers for the files in the head, and defer for scripts. A site created after the feature shipped starts with the first two on; an older site and the new site of a migration start with all off. Every response sets it."
          },
          "suspension_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "billing_overdue",
              "billing_restored",
              "php_version_removed",
              "owner_requested",
              "sandbox_hours_used"
            ],
            "description": "Why the platform paused this site, while it is paused: `php_version_removed` means the site ran a PHP version WP Waterfall removed, the move to a newer one rolled back, and the next version change lifts the pause. A billing pause carries its billing reason; the Billing page says more. Null while the site serves as usual. Every response sets it."
          }
        },
        "required": [
          "wp_debug",
          "password_protection",
          "strip_set_cookie"
        ]
      },
      "ToolSettingsPatchRequest": {
        "type": "object",
        "properties": {
          "wp_debug": {
            "type": "boolean"
          },
          "password_protection": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "username": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.-]{1,64}$"
              },
              "password": {
                "type": "string",
                "minLength": 12,
                "maxLength": 128,
                "description": "Plain text in the request only. The API hashes it and never stores or returns it."
              }
            },
            "required": [
              "enabled"
            ]
          },
          "strip_set_cookie": {
            "type": "boolean"
          }
        }
      },
      "WpCliRequest": {
        "type": "object",
        "properties": {
          "command": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000,
            "description": "The command without the leading `wp`. The allowlist applies at the API and the agent."
          }
        },
        "required": [
          "command"
        ]
      },
      "FilesGetResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "directory"
              },
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "entries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "file",
                        "directory",
                        "symlink"
                      ]
                    },
                    "size_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "modified_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "mode": {
                      "type": "string",
                      "pattern": "^[0-7]{3,4}$"
                    },
                    "editable": {
                      "type": "boolean",
                      "description": "True for text files under 1 MB that the editor can open."
                    },
                    "read_only": {
                      "type": "boolean",
                      "description": "True when the path cannot be changed, such as code folders on live in Git mode."
                    }
                  },
                  "required": [
                    "name",
                    "path",
                    "type",
                    "size_bytes",
                    "modified_at",
                    "mode",
                    "editable",
                    "read_only"
                  ]
                }
              }
            },
            "required": [
              "kind",
              "path",
              "entries"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "file"
              },
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "content": {
                "type": "string"
              },
              "size_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "sha256": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              "editable": {
                "type": "boolean"
              },
              "read_only": {
                "type": "boolean"
              }
            },
            "required": [
              "kind",
              "path",
              "content",
              "size_bytes",
              "sha256",
              "editable",
              "read_only"
            ]
          }
        ],
        "discriminator": {
          "propertyName": "kind"
        },
        "description": "A directory listing, or one text file when `path` points at a file."
      },
      "FilesUsage": {
        "type": "object",
        "properties": {
          "total_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "limit_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "The quota of this environment's container, from the plan entitlement."
          },
          "breakdown": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "enum": [
                    "wordpress_core",
                    "plugins",
                    "themes",
                    "uploads",
                    "database",
                    "logs",
                    "other"
                  ]
                },
                "bytes": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "category",
                "bytes"
              ]
            }
          },
          "largest_folders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                },
                "size_bytes": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "path",
                "size_bytes"
              ]
            }
          },
          "largest_files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                },
                "size_bytes": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "path",
                "size_bytes"
              ]
            }
          },
          "account_limit_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "The whole account allowance that bounds every container together. Null without a plan."
          },
          "warning": {
            "type": "string",
            "enum": [
              "none",
              "warn",
              "full"
            ],
            "description": "`warn` from 90 percent of the quota, `full` at 100 percent."
          },
          "overage": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "environment_id": {
                "type": "string",
                "format": "uuid"
              },
              "environment_name": {
                "type": "string",
                "minLength": 1
              },
              "used_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "allowance_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "state": {
                "type": "string",
                "enum": [
                  "pending",
                  "billing"
                ]
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "no_payment_method",
                  "billing_details",
                  "account_standing",
                  "switch_off",
                  "uptime_guarantee",
                  "staff_managed",
                  "too_large",
                  "purchase_failed",
                  "limit_reached"
                ]
              }
            },
            "required": [
              "environment_id",
              "environment_name",
              "used_bytes",
              "allowance_bytes",
              "state",
              "reason"
            ],
            "description": "Set while this environment uses more disk than it has: the disk used, the disk it has, and whether the account gets more disk (`pending`) or the excess bills per GB (`billing`). Absent or null otherwise."
          }
        },
        "required": [
          "total_bytes",
          "limit_bytes",
          "breakdown",
          "largest_folders",
          "largest_files",
          "account_limit_bytes",
          "warning"
        ],
        "description": "Disk usage breakdown, largest folders, and largest files."
      },
      "PatchFilesRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "op": {
                "type": "string",
                "const": "write"
              },
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "content": {
                "type": "string"
              },
              "expected_sha256": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$",
                "description": "The write fails with 409 when the file changed since this digest."
              }
            },
            "required": [
              "op",
              "path",
              "content"
            ]
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "type": "string",
                "const": "rename"
              },
              "from": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "to": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              }
            },
            "required": [
              "op",
              "from",
              "to"
            ]
          }
        ],
        "discriminator": {
          "propertyName": "op"
        },
        "description": "Edits a text file under 1 MB, or renames a file or folder."
      },
      "FileDownload": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "content_type": {
            "type": "string"
          },
          "content_base64": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "filename",
          "size_bytes",
          "content_type",
          "content_base64",
          "url",
          "expires_at"
        ]
      },
      "DatabaseInfo": {
        "type": "object",
        "properties": {
          "db_name": {
            "type": "string"
          },
          "db_user": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "version": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "table_count": {
            "type": "integer",
            "minimum": 0
          },
          "largest_tables": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "size_bytes": {
                  "type": "integer",
                  "minimum": 0
                },
                "rows": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "name",
                "size_bytes",
                "rows"
              ]
            }
          },
          "password": {
            "type": "string",
            "const": "********",
            "description": "Always masked here. Use the credentials reveal endpoint."
          },
          "ssh_tunnel_command": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opens a tunnel from a developer machine. Contains no secret."
          }
        },
        "required": [
          "db_name",
          "db_user",
          "host",
          "port",
          "version",
          "size_bytes",
          "table_count",
          "largest_tables",
          "password",
          "ssh_tunnel_command"
        ]
      },
      "PhpMyAdminSessionRequest": {
        "type": "object",
        "properties": {}
      },
      "PhpMyAdminSessionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "type": {
            "type": "string",
            "enum": [
              "provision_environment",
              "delete_environment",
              "set_php_version",
              "set_php_performance",
              "set_php_settings",
              "restart_php",
              "clear_server_cache",
              "search_replace",
              "run_wp_cli",
              "rotate_credentials",
              "apply_nginx_settings",
              "db_import",
              "cron_sync",
              "build_release",
              "activate_release",
              "create_repository",
              "create_node",
              "drain_node",
              "delete_node",
              "purchase_cud",
              "files_write",
              "files_delete",
              "files_rename",
              "phpmyadmin_session",
              "db_check",
              "db_rows_write",
              "db_sql_execute",
              "ssh_update",
              "sftp_account_change",
              "tool_setting",
              "wp_user_create",
              "set_code_mode",
              "env_var_set",
              "env_var_delete",
              "reset_site",
              "set_webroot",
              "set_wp_secrets_key",
              "wp_admin_login_token",
              "wp_login_user_ensure",
              "wp_login_users_remove",
              "repo_commit_read",
              "create_preview_environment",
              "clone_content",
              "merge_branch",
              "create_snapshot",
              "restore_snapshot",
              "set_apm",
              "push_content",
              "commit_branch",
              "sync_working_tree",
              "issue_certificate",
              "register_hostname",
              "unregister_hostname",
              "object_cache_set",
              "patchstack_credentials_write",
              "patchstack_credentials_remove",
              "patchstack_kill_switch",
              "set_disk_quota",
              "prepare_standby",
              "start_replication",
              "verify_replica",
              "fence_site",
              "resync_replica",
              "set_site_suspension",
              "clear_log",
              "promote_environment",
              "copy_into_live",
              "auto_update_run",
              "delete_snapshot",
              "prune_snapshots",
              "backup_download",
              "configure_git_remote",
              "import_git_push",
              "pull_external_git",
              "offsite_backup_test",
              "offsite_backup_run",
              "offsite_backup_list",
              "offsite_backup_restore",
              "restart_service",
              "container_exec",
              "set_network_domain",
              "map_subsite_domain",
              "reap_orphan_containers",
              "migrate_container",
              "migrate_control",
              "migrate_export",
              "migrate_import",
              "migrate_precopy",
              "migrate_delta",
              "migrate_freeze",
              "migrate_thaw",
              "update_mu_plugin",
              "import_site_files",
              "wake_environment",
              "set_sleep_policy",
              "integrity_check",
              "malware_scan",
              "malware_restore",
              "container_images",
              "rebuild_container",
              "update_runtime_image",
              "node_reboot_status",
              "schedule_node_reboot",
              "reboot_node",
              "core_update_commit",
              "core_update_advance",
              "core_update_run",
              "takedown_environment",
              "release_takedown",
              "set_egress",
              "set_standby_hold",
              "copy_evidence",
              "drop_evidence",
              "transfer_site",
              "relabel_environment",
              "record_site_facts",
              "attach_domain",
              "remove_domain",
              "set_primary_domain",
              "apply_redirects",
              "apply_ip_rules",
              "apply_bot_protection",
              "purge_cache",
              "apply_edge_settings",
              "provision_dns_zone",
              "refresh_ssl",
              "set_edge_certificate",
              "remove_edge_certificate",
              "rename_site",
              "rename_temp_hostname",
              "network_sync",
              "migration_fetch",
              "migration_inspect",
              "migration_triage",
              "migration_import",
              "migration_move",
              "export_company_data",
              "export_user_data",
              "export_audit_log",
              "purge_company",
              "reseal_secrets",
              "run_pagespeed",
              "patchstack_provision",
              "patchstack_deprovision",
              "patchstack_reconcile",
              "wp_login_member_users_remove",
              "provision_standby",
              "failover_site",
              "failback_site",
              "accessibility_scan"
            ],
            "description": "A node job type or an edge job type."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "dispatched",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "node_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean",
                "default": false
              }
            },
            "required": [
              "code",
              "message",
              "retryable"
            ]
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {}
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the job does, in one plain sentence, such as \"Turn on the server cron on site Elric (staging)\". It names the action and the place and never holds a secret, a value, or site content: a WP-CLI command shows its command words and the names that are safe to show, and a placeholder such as \"(value hidden)\" for the rest. Null on old servers."
          },
          "site_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the site the job belongs to, when it has one."
          },
          "environment_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the environment the job runs on, such as `live` or `staging`."
          },
          "quiet": {
            "type": "boolean",
            "description": "True for background work and reads, such as a cron sync or a login link lookup. A customer screen leaves a quiet job out of its bell, its lists, and its toasts. Quiet jobs are still stored, audited, and retried. Absent on old servers, where nothing is quiet."
          },
          "parent_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job this one works for: the job that ran it as a step, or that queued it as a follow-up. That job reads as done only once its follow-ups ended: it stays `running` until then, and its log names any follow-up that failed. Null for a job nobody started on another's behalf. Absent on old servers."
          },
          "requested_by": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user",
                  "api_key",
                  "mcp_agent",
                  "system"
                ]
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null
              },
              "client_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "MCP client name and version from the handshake, for `mcp_agent` requests."
              },
              "client_version": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "id",
              "label"
            ]
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "session": {
            "type": "object",
            "properties": {
              "token": {
                "type": "string",
                "minLength": 32
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "ttl_seconds": {
                "type": "number",
                "const": 60
              },
              "single_use": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "token",
              "url",
              "expires_at",
              "ttl_seconds",
              "single_use"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "environment_id",
          "site_id",
          "node_id",
          "group_id",
          "progress",
          "attempts",
          "error",
          "result",
          "requested_by",
          "idempotency_key",
          "created_at",
          "started_at",
          "finished_at",
          "updated_at",
          "session"
        ]
      },
      "DatabaseTableList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "table",
                    "view"
                  ]
                },
                "rows": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "An estimate for InnoDB tables, as information_schema reports it."
                },
                "size_bytes": {
                  "type": "integer",
                  "minimum": 0
                },
                "engine": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "name",
                "kind",
                "rows",
                "size_bytes",
                "engine"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "DatabaseTableSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "table",
              "view"
            ]
          },
          "engine": {
            "type": [
              "string",
              "null"
            ]
          },
          "collation": {
            "type": [
              "string",
              "null"
            ]
          },
          "rows": {
            "type": "integer",
            "minimum": 0
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "description": "The full column type, such as `bigint(20) unsigned` or `varchar(255)`."
                },
                "data_type": {
                  "type": "string",
                  "description": "The base type, such as `bigint`, `varchar`, `longtext`, or `datetime`."
                },
                "nullable": {
                  "type": "boolean"
                },
                "default": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "key": {
                  "type": "string",
                  "enum": [
                    "PRI",
                    "UNI",
                    "MUL",
                    ""
                  ]
                },
                "extra": {
                  "type": "string",
                  "description": "Such as `auto_increment`."
                },
                "comment": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "type",
                "data_type",
                "nullable",
                "default",
                "key",
                "extra",
                "comment"
              ]
            }
          },
          "indexes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "unique": {
                  "type": "boolean"
                },
                "columns": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "unique",
                "columns",
                "type"
              ]
            }
          },
          "foreign_keys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "columns": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "referenced_table": {
                  "type": "string"
                },
                "referenced_columns": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "on_update": {
                  "type": "string"
                },
                "on_delete": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "columns",
                "referenced_table",
                "referenced_columns",
                "on_update",
                "on_delete"
              ]
            }
          },
          "primary_key": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "row_key": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The columns that pick out one row: the primary key, or else the first unique index whose columns are all NOT NULL. Empty means the rows cannot be edited or deleted one at a time."
          }
        },
        "required": [
          "name",
          "kind",
          "engine",
          "collation",
          "rows",
          "columns",
          "indexes",
          "foreign_keys",
          "primary_key",
          "row_key"
        ]
      },
      "DatabaseRowsRequest": {
        "type": "object",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000,
            "default": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "default": 50
          },
          "sort": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "column": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "direction": {
                  "type": "string",
                  "enum": [
                    "asc",
                    "desc"
                  ],
                  "default": "asc"
                }
              },
              "required": [
                "column"
              ]
            },
            "maxItems": 4,
            "default": []
          },
          "filters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "column": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "op": {
                  "type": "string",
                  "enum": [
                    "eq",
                    "neq",
                    "lt",
                    "lte",
                    "gt",
                    "gte",
                    "contains",
                    "not_contains",
                    "starts_with",
                    "ends_with",
                    "is_null",
                    "is_not_null"
                  ]
                },
                "value": {
                  "type": "string",
                  "maxLength": 10000,
                  "default": "",
                  "description": "Ignored for is_null and is_not_null."
                }
              },
              "required": [
                "column",
                "op"
              ]
            },
            "maxItems": 10,
            "default": []
          },
          "count": {
            "type": "boolean",
            "default": true,
            "description": "Count matching rows for the pager. Leave it on unless the table is very large."
          }
        }
      },
      "DatabaseRowsPage": {
        "type": "object",
        "properties": {
          "table": {
            "type": "string"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 1048576
              }
            }
          },
          "truncated": {
            "type": "array",
            "items": {},
            "description": "`[row, column]` positions of cells cut to 1,000 characters. The cell endpoint has the full value."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Matching rows, or null when the count took too long."
          },
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "table",
          "columns",
          "rows",
          "truncated",
          "total",
          "offset",
          "limit"
        ]
      },
      "DatabaseCellRequest": {
        "type": "object",
        "properties": {
          "column": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "key": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 1048576
            }
          }
        },
        "required": [
          "column",
          "key"
        ]
      },
      "DatabaseCell": {
        "type": "object",
        "properties": {
          "value": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1048576
          },
          "length": {
            "type": "integer",
            "minimum": 0
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "value",
          "length",
          "truncated"
        ]
      },
      "DatabaseRowsChangeRequest": {
        "type": "object",
        "properties": {
          "changes": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "op": {
                      "type": "string",
                      "const": "insert"
                    },
                    "values": {
                      "type": "object",
                      "additionalProperties": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 1048576
                      }
                    }
                  },
                  "required": [
                    "op",
                    "values"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "op": {
                      "type": "string",
                      "const": "update"
                    },
                    "key": {
                      "type": "object",
                      "additionalProperties": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 1048576
                      }
                    },
                    "values": {
                      "type": "object",
                      "additionalProperties": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 1048576
                      }
                    }
                  },
                  "required": [
                    "op",
                    "key",
                    "values"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "op": {
                      "type": "string",
                      "const": "delete"
                    },
                    "key": {
                      "type": "object",
                      "additionalProperties": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 1048576
                      }
                    }
                  },
                  "required": [
                    "op",
                    "key"
                  ]
                }
              ],
              "discriminator": {
                "propertyName": "op"
              }
            },
            "minItems": 1,
            "maxItems": 100
          },
          "confirm": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "changes"
        ],
        "description": "Inserts, edits, and deletes rows. Staging and preview environments take the change as it is. On live, send `confirm: true`: the live database is the real site."
      },
      "DatabaseQueryRequest": {
        "type": "object",
        "properties": {
          "statement": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100000
          },
          "max_rows": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "default": 500
          }
        },
        "required": [
          "statement"
        ],
        "description": "One read-only statement for the SQL console."
      },
      "DatabaseQueryResult": {
        "type": "object",
        "properties": {
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 1048576
              }
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "True when the statement returned more rows than the limit."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "columns",
          "rows",
          "truncated",
          "duration_ms"
        ]
      },
      "DatabaseExecuteRequest": {
        "type": "object",
        "properties": {
          "statement": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100000
          },
          "confirm": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "statement"
        ],
        "description": "One statement that may change data. On live, send `confirm: true`."
      },
      "DatabaseExportRequest": {
        "type": "object",
        "properties": {
          "sort": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "column": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "direction": {
                  "type": "string",
                  "enum": [
                    "asc",
                    "desc"
                  ],
                  "default": "asc"
                }
              },
              "required": [
                "column"
              ]
            },
            "maxItems": 4,
            "default": []
          },
          "filters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "column": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "op": {
                  "type": "string",
                  "enum": [
                    "eq",
                    "neq",
                    "lt",
                    "lte",
                    "gt",
                    "gte",
                    "contains",
                    "not_contains",
                    "starts_with",
                    "ends_with",
                    "is_null",
                    "is_not_null"
                  ]
                },
                "value": {
                  "type": "string",
                  "maxLength": 10000,
                  "default": "",
                  "description": "Ignored for is_null and is_not_null."
                }
              },
              "required": [
                "column",
                "op"
              ]
            },
            "maxItems": 10,
            "default": []
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000,
            "default": 10000
          }
        },
        "description": "The current view of a table as CSV, up to 10,000 rows."
      },
      "DatabaseCheckRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "check",
              "repair"
            ],
            "default": "check"
          },
          "tables": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_]+$"
            },
            "maxItems": 500
          }
        }
      },
      "DatabaseImportRequest": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "size_bytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1073741824
          },
          "compression": {
            "type": "string",
            "enum": [
              "none",
              "gzip"
            ],
            "default": "none"
          },
          "drop_existing_tables": {
            "type": "boolean",
            "default": false
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "filename",
          "size_bytes",
          "confirm"
        ],
        "description": "Metadata for `POST.../database/import`. The SQL file travels in the `file` part."
      },
      "LogsResponse": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "enum": [
              "error",
              "access",
              "cache",
              "php-fpm",
              "slow",
              "cron"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ts": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "line": {
                  "type": "string",
                  "maxLength": 16384
                },
                "severity": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "debug",
                    "info",
                    "notice",
                    "warning",
                    "error",
                    "critical"
                  ],
                  "default": null
                }
              },
              "required": [
                "ts",
                "line",
                "severity"
              ]
            }
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "file",
          "lines",
          "truncated"
        ]
      },
      "LogStreamEvent": {
        "type": "object",
        "properties": {
          "ts": {
            "type": "string",
            "format": "date-time"
          },
          "line": {
            "type": "string"
          }
        },
        "required": [
          "ts",
          "line"
        ],
        "description": "The data field of each server-sent event on `GET.../logs/{file}/stream`."
      },
      "EnvironmentNetwork": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "False for a single site: the other fields are empty then."
          },
          "mode": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "subdirectory",
              "subdomain"
            ]
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The network host (DOMAIN_CURRENT_SITE)."
          },
          "network_admin_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The network admin address, `https://host/wp-admin/network/`."
          },
          "subsites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "blog_id": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "The WordPress blog id. 1 is the main site."
                },
                "domain": {
                  "type": "string",
                  "description": "The host WordPress holds for the site, and its path (`/` or `/name/`)."
                },
                "path": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "description": "The site address, such as `https://host/name`. Open it in a new tab."
                },
                "main": {
                  "type": "boolean"
                },
                "mapped": {
                  "type": "boolean",
                  "description": "The site sits on a custom host outside the network host."
                },
                "routed": {
                  "type": "boolean",
                  "description": "True when a visitor can reach the site: it is on the network host, or its own host is an attached domain that is active. A subdomain network on a temporary hostname has no routed subsites until each one gets its own domain."
                },
                "domain_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The attached domain that serves this subsite, and its state. Null when there is none."
                },
                "domain_status": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "requested",
                    "txt_pending",
                    "cname_pending",
                    "validating",
                    "securing",
                    "active",
                    "failed",
                    "removed"
                  ]
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The subsite's title (`blogname`), when the node could read it."
                },
                "locale": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The WordPress language of the subsite (`WPLANG`, such as `es_ES`). Null means the network default."
                },
                "temp_hostname": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The temporary hostname WP Waterfall gave this subsite in a subdomain network, one label under the sites domain (such as `es-staging-elric.wpwaterfall.dev`). Null in a subdirectory network, on the main site, and for a subsite that sits on an attached custom domain."
                },
                "health": {
                  "type": "string",
                  "enum": [
                    "ok",
                    "error",
                    "unknown"
                  ],
                  "description": "What the last homepage check of the subsite found: `ok` (answers 2xx or 3xx), `error` (answers 4xx or 5xx, or not at all), or `unknown` (no check yet, or the subsite is not routed)."
                },
                "http_status": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The HTTP status of that check, or null."
                }
              },
              "required": [
                "blog_id",
                "domain",
                "path",
                "url",
                "main",
                "mapped",
                "routed",
                "domain_id",
                "domain_status"
              ]
            }
          },
          "counts_as_sites": {
            "type": "number",
            "const": 1,
            "description": "A network counts as one site against the plan, however many subsites it has."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "One plain sentence about what the mode needs, or null when nothing is missing."
          },
          "read_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the node answered."
          }
        },
        "required": [
          "enabled",
          "mode",
          "domain",
          "network_admin_url",
          "subsites",
          "counts_as_sites",
          "note",
          "read_at"
        ]
      },
      "SuperAdminList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "login": {
                  "type": "string"
                }
              },
              "required": [
                "login"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "PutSuperAdminRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "enabled",
          "confirm"
        ],
        "description": "Grants or removes super administrator rights for one WordPress user of a network. A super administrator manages every site, plugin, theme, and user of the network, so `confirm: true` is required."
      },
      "CronJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "schedule": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "last_run": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "ran_at": {
                "type": "string",
                "format": "date-time"
              },
              "exit_code": {
                "type": "integer"
              },
              "duration_ms": {
                "type": "integer",
                "minimum": 0
              },
              "output": {
                "type": "string",
                "maxLength": 20000
              },
              "output_expires_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "ran_at",
              "exit_code",
              "duration_ms",
              "output",
              "output_expires_at"
            ]
          },
          "health": {
            "type": "string",
            "enum": [
              "ok",
              "failed",
              "missed",
              "rejected",
              "paused",
              "waiting"
            ],
            "description": "How the job is doing."
          },
          "issue": {
            "type": [
              "string",
              "null"
            ],
            "description": "One plain sentence behind `health`: the last error line, why it is rejected, or what was missed. Null when ok."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "environment_id",
          "schedule",
          "command",
          "description",
          "enabled",
          "last_run",
          "health",
          "issue",
          "created_at",
          "updated_at"
        ]
      },
      "CronJobList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CronJob"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          },
          "wp_cron": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "built_in",
                  "custom",
                  "off"
                ]
              },
              "method": {
                "type": "string",
                "enum": [
                  "server",
                  "wordpress",
                  "none"
                ],
                "description": "Which cron runs WordPress's scheduled events: `server` (a real schedule on the server, with WP-Cron off), `wordpress` (WP-Cron runs on page visits, and no server schedule exists), or `none` (WP-Cron is off and no server schedule exists, so nothing runs; the start of staging and previews). Every response sets it."
              },
              "server_cron_enabled": {
                "type": "boolean",
                "description": "True while the Server cron tool is on (the Tools switch). Every response sets it."
              },
              "interval_minutes": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "Minutes between runs of the schedule that runs WordPress's events."
              },
              "last_run": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "ran_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "exit_code": {
                    "type": "integer"
                  },
                  "duration_ms": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "output": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "output_expires_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "ran_at",
                  "exit_code",
                  "duration_ms",
                  "output",
                  "output_expires_at"
                ]
              },
              "health": {
                "type": "string",
                "enum": [
                  "ok",
                  "failed",
                  "stalled",
                  "unknown",
                  "off"
                ],
                "description": "`ok`, `failed`, `stalled` (the server stopped running it), or `unknown` (the node did not answer)."
              },
              "issue": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "mode",
              "interval_minutes",
              "last_run",
              "health",
              "issue"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor",
          "wp_cron"
        ]
      },
      "CreateCronJobRequest": {
        "type": "object",
        "properties": {
          "schedule": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "command": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "schedule",
          "command"
        ]
      },
      "PatchCronJobRequest": {
        "type": "object",
        "properties": {
          "schedule": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "command": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "PutServerCronEnabledRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "Turns the Server cron tool on or off."
      },
      "WpAdminLoginRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "create_if_missing": {
            "type": "boolean",
            "default": false,
            "description": "Creates an administrator when no WordPress user has the email."
          },
          "network": {
            "type": "boolean",
            "default": false,
            "description": "WordPress Multisite: land in the Network Admin instead of the site dashboard. It works for a super administrator only; anyone else lands on the dashboard as before."
          }
        },
        "description": "One-click wp-admin. The email defaults to the signed-in user's email."
      },
      "PutAutoLoginEnabledRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "One click login on or off for an environment (Tools). Off, the API makes no login links, the node drops the tickets it holds, and the MU plugin answers 404 at its login address. The plain WordPress login page stays."
      },
      "PutBlockXmlrpcRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "Block XML-RPC on or off for an environment (Tools, live only). On is the default: the site's web server answers 403 at /xmlrpc.php. Turn it off only for a client that needs XML-RPC, such as Jetpack or the WordPress mobile apps. The sign in rate limit on the node stays either way."
      },
      "PutSpeedOptimizationsRequest": {
        "type": "object",
        "properties": {
          "remove_jquery_migrate": {
            "type": "boolean"
          },
          "preload": {
            "type": "boolean"
          },
          "defer": {
            "type": "boolean"
          }
        },
        "description": "`PUT /environments/{id}/tools/speed`. Each part is optional: a part left out keeps its saved value. At least one part must be set."
      },
      "WpAdminLoginResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "type": {
            "type": "string",
            "enum": [
              "provision_environment",
              "delete_environment",
              "set_php_version",
              "set_php_performance",
              "set_php_settings",
              "restart_php",
              "clear_server_cache",
              "search_replace",
              "run_wp_cli",
              "rotate_credentials",
              "apply_nginx_settings",
              "db_import",
              "cron_sync",
              "build_release",
              "activate_release",
              "create_repository",
              "create_node",
              "drain_node",
              "delete_node",
              "purchase_cud",
              "files_write",
              "files_delete",
              "files_rename",
              "phpmyadmin_session",
              "db_check",
              "db_rows_write",
              "db_sql_execute",
              "ssh_update",
              "sftp_account_change",
              "tool_setting",
              "wp_user_create",
              "set_code_mode",
              "env_var_set",
              "env_var_delete",
              "reset_site",
              "set_webroot",
              "set_wp_secrets_key",
              "wp_admin_login_token",
              "wp_login_user_ensure",
              "wp_login_users_remove",
              "repo_commit_read",
              "create_preview_environment",
              "clone_content",
              "merge_branch",
              "create_snapshot",
              "restore_snapshot",
              "set_apm",
              "push_content",
              "commit_branch",
              "sync_working_tree",
              "issue_certificate",
              "register_hostname",
              "unregister_hostname",
              "object_cache_set",
              "patchstack_credentials_write",
              "patchstack_credentials_remove",
              "patchstack_kill_switch",
              "set_disk_quota",
              "prepare_standby",
              "start_replication",
              "verify_replica",
              "fence_site",
              "resync_replica",
              "set_site_suspension",
              "clear_log",
              "promote_environment",
              "copy_into_live",
              "auto_update_run",
              "delete_snapshot",
              "prune_snapshots",
              "backup_download",
              "configure_git_remote",
              "import_git_push",
              "pull_external_git",
              "offsite_backup_test",
              "offsite_backup_run",
              "offsite_backup_list",
              "offsite_backup_restore",
              "restart_service",
              "container_exec",
              "set_network_domain",
              "map_subsite_domain",
              "reap_orphan_containers",
              "migrate_container",
              "migrate_control",
              "migrate_export",
              "migrate_import",
              "migrate_precopy",
              "migrate_delta",
              "migrate_freeze",
              "migrate_thaw",
              "update_mu_plugin",
              "import_site_files",
              "wake_environment",
              "set_sleep_policy",
              "integrity_check",
              "malware_scan",
              "malware_restore",
              "container_images",
              "rebuild_container",
              "update_runtime_image",
              "node_reboot_status",
              "schedule_node_reboot",
              "reboot_node",
              "core_update_commit",
              "core_update_advance",
              "core_update_run",
              "takedown_environment",
              "release_takedown",
              "set_egress",
              "set_standby_hold",
              "copy_evidence",
              "drop_evidence",
              "transfer_site",
              "relabel_environment",
              "record_site_facts",
              "attach_domain",
              "remove_domain",
              "set_primary_domain",
              "apply_redirects",
              "apply_ip_rules",
              "apply_bot_protection",
              "purge_cache",
              "apply_edge_settings",
              "provision_dns_zone",
              "refresh_ssl",
              "set_edge_certificate",
              "remove_edge_certificate",
              "rename_site",
              "rename_temp_hostname",
              "network_sync",
              "migration_fetch",
              "migration_inspect",
              "migration_triage",
              "migration_import",
              "migration_move",
              "export_company_data",
              "export_user_data",
              "export_audit_log",
              "purge_company",
              "reseal_secrets",
              "run_pagespeed",
              "patchstack_provision",
              "patchstack_deprovision",
              "patchstack_reconcile",
              "wp_login_member_users_remove",
              "provision_standby",
              "failover_site",
              "failback_site",
              "accessibility_scan"
            ],
            "description": "A node job type or an edge job type."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "dispatched",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "node_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean",
                "default": false
              }
            },
            "required": [
              "code",
              "message",
              "retryable"
            ]
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {}
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the job does, in one plain sentence, such as \"Turn on the server cron on site Elric (staging)\". It names the action and the place and never holds a secret, a value, or site content: a WP-CLI command shows its command words and the names that are safe to show, and a placeholder such as \"(value hidden)\" for the rest. Null on old servers."
          },
          "site_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the site the job belongs to, when it has one."
          },
          "environment_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the environment the job runs on, such as `live` or `staging`."
          },
          "quiet": {
            "type": "boolean",
            "description": "True for background work and reads, such as a cron sync or a login link lookup. A customer screen leaves a quiet job out of its bell, its lists, and its toasts. Quiet jobs are still stored, audited, and retried. Absent on old servers, where nothing is quiet."
          },
          "parent_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job this one works for: the job that ran it as a step, or that queued it as a follow-up. That job reads as done only once its follow-ups ended: it stays `running` until then, and its log names any follow-up that failed. Null for a job nobody started on another's behalf. Absent on old servers."
          },
          "requested_by": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user",
                  "api_key",
                  "mcp_agent",
                  "system"
                ]
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null
              },
              "client_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "MCP client name and version from the handshake, for `mcp_agent` requests."
              },
              "client_version": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "id",
              "label"
            ]
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "login": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "ttl_seconds": {
                "type": "number",
                "const": 60
              },
              "single_use": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "url",
              "expires_at",
              "ttl_seconds",
              "single_use"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "environment_id",
          "site_id",
          "node_id",
          "group_id",
          "progress",
          "attempts",
          "error",
          "result",
          "requested_by",
          "idempotency_key",
          "created_at",
          "started_at",
          "finished_at",
          "updated_at",
          "login"
        ],
        "description": "The Job object plus the `login` link. Open the link after the job succeeds."
      },
      "BulkRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "cache_clear"
              },
              "environment_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "minItems": 1,
                "maxItems": 200
              },
              "params": {
                "type": "object",
                "properties": {},
                "default": {}
              }
            },
            "required": [
              "action",
              "environment_ids"
            ]
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "php_settings"
              },
              "environment_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "minItems": 1,
                "maxItems": 200
              },
              "params": {
                "type": "object",
                "properties": {
                  "php_version": {
                    "type": "string",
                    "enum": [
                      "8.1",
                      "8.2",
                      "8.3",
                      "8.4",
                      "8.5"
                    ]
                  },
                  "ini": {
                    "type": "object",
                    "properties": {
                      "memory_limit": {
                        "type": "string",
                        "pattern": "^\\d+[MG]$"
                      },
                      "max_execution_time": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 600
                      },
                      "max_input_vars": {
                        "type": "integer",
                        "minimum": 1000,
                        "maximum": 100000
                      },
                      "upload_max_filesize": {
                        "type": "string",
                        "pattern": "^\\d+[MG]$"
                      },
                      "post_max_size": {
                        "type": "string",
                        "pattern": "^\\d+[MG]$"
                      },
                      "display_errors": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            },
            "required": [
              "action",
              "environment_ids",
              "params"
            ]
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "labels"
              },
              "environment_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "minItems": 1,
                "maxItems": 200
              },
              "params": {
                "type": "object",
                "properties": {
                  "add": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUIDv7"
                    },
                    "maxItems": 20,
                    "default": []
                  },
                  "remove": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUIDv7"
                    },
                    "maxItems": 20,
                    "default": []
                  }
                }
              }
            },
            "required": [
              "action",
              "environment_ids",
              "params"
            ]
          }
        ],
        "discriminator": {
          "propertyName": "action"
        },
        "description": "`POST /bulk`. One job group, one child job per environment. The `params` shape depends on the action."
      },
      "Label": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "site_count": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "color",
          "site_count",
          "created_at"
        ],
        "description": "Labels belong to the company and are managed in company settings."
      },
      "LabelList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Label"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CreateLabelRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "default": "#6b7280"
          }
        },
        "required": [
          "name"
        ]
      },
      "PatchLabelRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          }
        }
      },
      "Notification": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "category": {
            "type": "string",
            "enum": [
              "site_health",
              "deployments",
              "backups",
              "domains",
              "security",
              "billing",
              "usage",
              "team",
              "support",
              "product_news"
            ]
          },
          "kind": {
            "type": "string",
            "description": "A dotted kind such as `job.succeeded` or `php.restarted`."
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "link": {
            "type": [
              "string",
              "null"
            ],
            "description": "A dashboard path."
          },
          "important": {
            "type": "boolean",
            "description": "True for a notice the person must act on, such as setting a password. It cannot be marked read until the action is done (`resolved_at` is set), and \"mark all as read\" skips it."
          },
          "requires_action": {
            "type": "boolean",
            "description": "True while the notice is important and the action is not done."
          },
          "action_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which action resolves this notice, such as `set_password`. Null for ordinary notices."
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the person did the action. WP Waterfall sets it, then marks the notice read."
          },
          "read_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "category",
          "kind",
          "title",
          "body",
          "link",
          "important",
          "requires_action",
          "action_key",
          "resolved_at",
          "read_at",
          "created_at"
        ]
      },
      "NotificationList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Notification"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "PatchNotificationRequest": {
        "type": "object",
        "properties": {
          "read": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "read"
        ],
        "description": "Read state moves one way. A notice becomes read when the person opens it or looks at the list, and \"Mark all as read\" covers the rest. There is no way to mark one unread again, in the dashboard or through the API, so the only accepted body is `{ \"read\": true }`."
      },
      "NotificationPreferences": {
        "type": "object",
        "properties": {
          "preferences": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "enum": [
                    "site_health",
                    "deployments",
                    "backups",
                    "domains",
                    "security",
                    "billing",
                    "usage",
                    "team",
                    "support",
                    "product_news"
                  ]
                },
                "email": {
                  "type": "boolean"
                },
                "in_app": {
                  "type": "boolean"
                },
                "required": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "type": "boolean"
                    },
                    "in_app": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "email",
                    "in_app"
                  ],
                  "description": "Channels the person cannot turn off. The value is always true for these."
                }
              },
              "required": [
                "category",
                "email",
                "in_app",
                "required"
              ]
            }
          }
        },
        "required": [
          "preferences"
        ]
      },
      "PutNotificationPreferencesRequest": {
        "type": "object",
        "properties": {
          "preferences": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "enum": [
                    "site_health",
                    "deployments",
                    "backups",
                    "domains",
                    "security",
                    "billing",
                    "usage",
                    "team",
                    "support",
                    "product_news"
                  ]
                },
                "email": {
                  "type": "boolean"
                },
                "in_app": {
                  "type": "boolean"
                }
              },
              "required": [
                "category"
              ]
            },
            "minItems": 1,
            "maxItems": 10
          }
        },
        "required": [
          "preferences"
        ],
        "description": "Changes the listed categories. Other categories keep their values."
      },
      "SavedView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "filters": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "region": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "node_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "php": {
                "type": "string",
                "enum": [
                  "8.1",
                  "8.2",
                  "8.3",
                  "8.4",
                  "8.5"
                ]
              },
              "search": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "status": {
                "type": "string",
                "enum": [
                  "live",
                  "staging",
                  "provisioning",
                  "attention"
                ]
              }
            }
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "name",
                "labels",
                "php_version",
                "wordpress_version",
                "region",
                "disk",
                "health"
              ]
            },
            "minItems": 1,
            "maxItems": 20
          },
          "sort": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "column": {
                "type": "string",
                "enum": [
                  "name",
                  "labels",
                  "php_version",
                  "wordpress_version",
                  "region",
                  "disk",
                  "health"
                ]
              },
              "direction": {
                "type": "string",
                "enum": [
                  "asc",
                  "desc"
                ]
              }
            },
            "required": [
              "column",
              "direction"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "filters",
          "columns",
          "sort",
          "created_at",
          "updated_at"
        ],
        "description": "A saved filter and column set for the Sites list. Views belong to one user."
      },
      "SavedViewList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedView"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CreateSavedViewRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "filters": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "region": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "node_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "php": {
                "type": "string",
                "enum": [
                  "8.1",
                  "8.2",
                  "8.3",
                  "8.4",
                  "8.5"
                ]
              },
              "search": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "status": {
                "type": "string",
                "enum": [
                  "live",
                  "staging",
                  "provisioning",
                  "attention"
                ]
              }
            },
            "default": {}
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "name",
                "labels",
                "php_version",
                "wordpress_version",
                "region",
                "disk",
                "health"
              ]
            },
            "minItems": 1,
            "maxItems": 20,
            "default": [
              "name",
              "labels",
              "php_version",
              "wordpress_version",
              "region",
              "disk",
              "health"
            ]
          },
          "sort": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "column": {
                "type": "string",
                "enum": [
                  "name",
                  "labels",
                  "php_version",
                  "wordpress_version",
                  "region",
                  "disk",
                  "health"
                ]
              },
              "direction": {
                "type": "string",
                "enum": [
                  "asc",
                  "desc"
                ]
              }
            },
            "required": [
              "column",
              "direction"
            ],
            "default": null
          }
        },
        "required": [
          "name"
        ]
      },
      "PatchSavedViewRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "filters": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "region": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "node_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "php": {
                "type": "string",
                "enum": [
                  "8.1",
                  "8.2",
                  "8.3",
                  "8.4",
                  "8.5"
                ]
              },
              "search": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "status": {
                "type": "string",
                "enum": [
                  "live",
                  "staging",
                  "provisioning",
                  "attention"
                ]
              }
            },
            "default": {}
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "name",
                "labels",
                "php_version",
                "wordpress_version",
                "region",
                "disk",
                "health"
              ]
            },
            "minItems": 1,
            "maxItems": 20,
            "default": [
              "name",
              "labels",
              "php_version",
              "wordpress_version",
              "region",
              "disk",
              "health"
            ]
          },
          "sort": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "column": {
                "type": "string",
                "enum": [
                  "name",
                  "labels",
                  "php_version",
                  "wordpress_version",
                  "region",
                  "disk",
                  "health"
                ]
              },
              "direction": {
                "type": "string",
                "enum": [
                  "asc",
                  "desc"
                ]
              }
            },
            "required": [
              "column",
              "direction"
            ],
            "default": null
          }
        }
      },
      "Repository": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "provider": {
            "type": "string",
            "enum": [
              "wpwaterfall"
            ]
          },
          "remote": {
            "type": "string"
          },
          "default_branch": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
          },
          "clone_commands": {
            "type": "object",
            "properties": {
              "https": {
                "type": "string"
              },
              "ssh": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "https",
              "ssh"
            ],
            "description": "Ready to copy. Contains no secret."
          },
          "git_ssh": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "available": {
                "type": "boolean"
              },
              "ssh_enabled": {
                "type": "boolean",
                "description": "False when SSH is switched off for the environment, so no key can sign in."
              },
              "host": {
                "type": "string"
              },
              "port": {
                "type": "integer"
              },
              "username": {
                "type": "string"
              },
              "path": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The repository path on the SSH host, as the node reports it."
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "`ssh://user@host:port/path`"
              },
              "clone_command": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "remote_command": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "key_count": {
                "type": "integer",
                "minimum": 0,
                "description": "How many SSH public keys may sign in. Zero means a push cannot work yet."
              }
            },
            "required": [
              "available",
              "ssh_enabled",
              "host",
              "port",
              "username",
              "path",
              "url",
              "clone_command",
              "remote_command",
              "key_count"
            ],
            "description": "Null when the site has no live environment yet."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "site_id",
          "provider",
          "remote",
          "default_branch",
          "clone_commands",
          "git_ssh",
          "created_at"
        ]
      },
      "CommitList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sha": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{40}$"
                },
                "message": {
                  "type": "string"
                },
                "author_name": {
                  "type": "string"
                },
                "authored_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "sha",
                "message",
                "author_name",
                "authored_at"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "Release": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "sha": {
            "type": "string",
            "pattern": "^[0-9a-f]{40}$"
          },
          "dataset": {
            "type": "string"
          },
          "build_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "status": {
            "type": "string",
            "enum": [
              "building",
              "ready",
              "active",
              "superseded",
              "failed"
            ]
          },
          "activated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "activated_by": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user",
                  "api_key",
                  "mcp_agent",
                  "system"
                ]
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null
              },
              "client_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "MCP client name and version from the handshake, for `mcp_agent` requests."
              },
              "client_version": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "id",
              "label"
            ]
          },
          "writable_suggestions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string"
                }
              },
              "required": [
                "path",
                "snippet"
              ]
            },
            "default": [],
            "description": "Set when the node reported a write to a read-only folder for this release. Add the snippet to `wpwaterfall.yml`, push, and deploy again."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "environment_id",
          "sha",
          "dataset",
          "build_id",
          "status",
          "activated_at",
          "activated_by",
          "writable_suggestions",
          "created_at"
        ]
      },
      "ReleaseList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Release"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "Build": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "sha": {
            "type": "string",
            "pattern": "^[0-9a-f]{40}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "duration_s": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the build was queued."
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "log_url": {
            "type": "string",
            "description": "Path of the build log, for example `/v1/builds/{id}/log`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "environment_id",
          "sha",
          "status",
          "duration_s",
          "started_at",
          "finished_at",
          "log_url",
          "created_at"
        ]
      },
      "BuildList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Build"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "BuildLog": {
        "type": "object",
        "properties": {
          "build_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "complete": {
            "type": "boolean"
          }
        },
        "required": [
          "build_id",
          "lines",
          "complete"
        ]
      },
      "DeployRequest": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
            "description": "Defaults to the environment's own branch."
          }
        },
        "description": "Builds the commit and activates it on live. Returns the build job."
      },
      "ActivateReleaseRequest": {
        "type": "object",
        "properties": {}
      },
      "EnvVar": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
              },
              "secret": {
                "type": "boolean",
                "const": true
              },
              "value": {
                "type": "string",
                "const": "********"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "key",
              "secret",
              "value",
              "updated_at"
            ]
          },
          {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
              },
              "secret": {
                "type": "boolean",
                "const": false
              },
              "value": {
                "type": "string"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "key",
              "secret",
              "value",
              "updated_at"
            ]
          }
        ],
        "discriminator": {
          "propertyName": "secret"
        },
        "description": "Secret values never leave the API. A secret variable shows the mask."
      },
      "EnvVarList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnvVar"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "PutEnvVarRequest": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
          },
          "value": {
            "type": "string",
            "maxLength": 65536
          },
          "secret": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "key",
          "value"
        ],
        "description": "Sets one variable. Secret values are encrypted at rest and never shown again."
      },
      "PutCodeModeRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "git",
              "classic"
            ]
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "mode",
          "confirm"
        ],
        "description": "Git mode keeps live code read-only. Classic mode makes it writable."
      },
      "SshSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535
          },
          "username": {
            "type": "string"
          },
          "password_auth": {
            "type": "boolean"
          },
          "password_expires_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "allowed_ips": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SshKey"
            }
          }
        },
        "required": [
          "enabled",
          "host",
          "port",
          "username",
          "password_auth",
          "password_expires_days",
          "allowed_ips",
          "keys"
        ],
        "description": "The state of SSH on an environment, with the keys that can sign in."
      },
      "PatchSshSettingsRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "password_auth": {
            "type": "boolean"
          },
          "password_expires_days": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 365
          }
        }
      },
      "SshAllowedIps": {
        "type": "object",
        "properties": {
          "allowed_ips": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "allowed_ips"
        ]
      },
      "PutSshAllowedIpsRequest": {
        "type": "object",
        "properties": {
          "allowed_ips": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 100
          }
        },
        "required": [
          "allowed_ips"
        ],
        "description": "An empty list means any address may connect."
      },
      "SshConfig": {
        "type": "object",
        "properties": {
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          },
          "ssh_command": {
            "type": "string"
          },
          "sftp_command": {
            "type": "string"
          },
          "database_tunnel_command": {
            "type": "string"
          },
          "host_key_fingerprint": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "host",
          "port",
          "username",
          "ssh_command",
          "sftp_command",
          "database_tunnel_command",
          "host_key_fingerprint"
        ],
        "description": "Ready to copy commands. They contain no secret."
      },
      "SftpAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "username": {
            "type": "string"
          },
          "directory": {
            "type": "string",
            "description": "The folder the user is limited to, below the site's web root. `/` is the whole web root."
          },
          "access": {
            "type": "string",
            "enum": [
              "read_write",
              "read_only",
              "read_upload"
            ],
            "description": "What the user may do now. `read_only` or `read_upload` while the environment code is read only (live, Git mode)."
          },
          "enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "environment_id",
          "username",
          "directory",
          "access",
          "enabled",
          "created_at"
        ]
      },
      "SftpAccountList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SftpAccount"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "SftpAccountCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "type": {
            "type": "string",
            "enum": [
              "provision_environment",
              "delete_environment",
              "set_php_version",
              "set_php_performance",
              "set_php_settings",
              "restart_php",
              "clear_server_cache",
              "search_replace",
              "run_wp_cli",
              "rotate_credentials",
              "apply_nginx_settings",
              "db_import",
              "cron_sync",
              "build_release",
              "activate_release",
              "create_repository",
              "create_node",
              "drain_node",
              "delete_node",
              "purchase_cud",
              "files_write",
              "files_delete",
              "files_rename",
              "phpmyadmin_session",
              "db_check",
              "db_rows_write",
              "db_sql_execute",
              "ssh_update",
              "sftp_account_change",
              "tool_setting",
              "wp_user_create",
              "set_code_mode",
              "env_var_set",
              "env_var_delete",
              "reset_site",
              "set_webroot",
              "set_wp_secrets_key",
              "wp_admin_login_token",
              "wp_login_user_ensure",
              "wp_login_users_remove",
              "repo_commit_read",
              "create_preview_environment",
              "clone_content",
              "merge_branch",
              "create_snapshot",
              "restore_snapshot",
              "set_apm",
              "push_content",
              "commit_branch",
              "sync_working_tree",
              "issue_certificate",
              "register_hostname",
              "unregister_hostname",
              "object_cache_set",
              "patchstack_credentials_write",
              "patchstack_credentials_remove",
              "patchstack_kill_switch",
              "set_disk_quota",
              "prepare_standby",
              "start_replication",
              "verify_replica",
              "fence_site",
              "resync_replica",
              "set_site_suspension",
              "clear_log",
              "promote_environment",
              "copy_into_live",
              "auto_update_run",
              "delete_snapshot",
              "prune_snapshots",
              "backup_download",
              "configure_git_remote",
              "import_git_push",
              "pull_external_git",
              "offsite_backup_test",
              "offsite_backup_run",
              "offsite_backup_list",
              "offsite_backup_restore",
              "restart_service",
              "container_exec",
              "set_network_domain",
              "map_subsite_domain",
              "reap_orphan_containers",
              "migrate_container",
              "migrate_control",
              "migrate_export",
              "migrate_import",
              "migrate_precopy",
              "migrate_delta",
              "migrate_freeze",
              "migrate_thaw",
              "update_mu_plugin",
              "import_site_files",
              "wake_environment",
              "set_sleep_policy",
              "integrity_check",
              "malware_scan",
              "malware_restore",
              "container_images",
              "rebuild_container",
              "update_runtime_image",
              "node_reboot_status",
              "schedule_node_reboot",
              "reboot_node",
              "core_update_commit",
              "core_update_advance",
              "core_update_run",
              "takedown_environment",
              "release_takedown",
              "set_egress",
              "set_standby_hold",
              "copy_evidence",
              "drop_evidence",
              "transfer_site",
              "relabel_environment",
              "record_site_facts",
              "attach_domain",
              "remove_domain",
              "set_primary_domain",
              "apply_redirects",
              "apply_ip_rules",
              "apply_bot_protection",
              "purge_cache",
              "apply_edge_settings",
              "provision_dns_zone",
              "refresh_ssl",
              "set_edge_certificate",
              "remove_edge_certificate",
              "rename_site",
              "rename_temp_hostname",
              "network_sync",
              "migration_fetch",
              "migration_inspect",
              "migration_triage",
              "migration_import",
              "migration_move",
              "export_company_data",
              "export_user_data",
              "export_audit_log",
              "purge_company",
              "reseal_secrets",
              "run_pagespeed",
              "patchstack_provision",
              "patchstack_deprovision",
              "patchstack_reconcile",
              "wp_login_member_users_remove",
              "provision_standby",
              "failover_site",
              "failback_site",
              "accessibility_scan"
            ],
            "description": "A node job type or an edge job type."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "dispatched",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "site_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "node_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean",
                "default": false
              }
            },
            "required": [
              "code",
              "message",
              "retryable"
            ]
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {}
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the job does, in one plain sentence, such as \"Turn on the server cron on site Elric (staging)\". It names the action and the place and never holds a secret, a value, or site content: a WP-CLI command shows its command words and the names that are safe to show, and a placeholder such as \"(value hidden)\" for the rest. Null on old servers."
          },
          "site_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the site the job belongs to, when it has one."
          },
          "environment_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the environment the job runs on, such as `live` or `staging`."
          },
          "quiet": {
            "type": "boolean",
            "description": "True for background work and reads, such as a cron sync or a login link lookup. A customer screen leaves a quiet job out of its bell, its lists, and its toasts. Quiet jobs are still stored, audited, and retried. Absent on old servers, where nothing is quiet."
          },
          "parent_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The job this one works for: the job that ran it as a step, or that queued it as a follow-up. That job reads as done only once its follow-ups ended: it stays `running` until then, and its log names any follow-up that failed. Null for a job nobody started on another's behalf. Absent on old servers."
          },
          "requested_by": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user",
                  "api_key",
                  "mcp_agent",
                  "system"
                ]
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null
              },
              "client_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "MCP client name and version from the handshake, for `mcp_agent` requests."
              },
              "client_version": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "id",
              "label"
            ]
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "account": {
            "$ref": "#/components/schemas/SftpAccount"
          },
          "password": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "environment_id",
          "site_id",
          "node_id",
          "group_id",
          "progress",
          "attempts",
          "error",
          "result",
          "requested_by",
          "idempotency_key",
          "created_at",
          "started_at",
          "finished_at",
          "updated_at",
          "account",
          "password"
        ],
        "description": "The Job object plus the new account. `password` is the one time view of a password the server made: it is set when the job finished within a few seconds and `null` otherwise. It is always `null` when the request carried its own password, which the answer never repeats. Later reads go through the SFTP credentials reveal, which needs a recent sign-in."
      },
      "CreateSftpAccountRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{2,31}$"
          },
          "directory": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096,
            "default": "/"
          },
          "password": {
            "type": "string",
            "minLength": 16,
            "maxLength": 32,
            "pattern": "^[\\x21-\\x39\\x3b-\\x7e]+$",
            "description": "16 to 32 characters. Leave it out and the server makes one, shown once in the answer. A password you send is sealed at once. It never sits in a job, an event, or an audit entry, and the answer does not repeat it. A password you choose must also pass the pattern rules of account passwords (not a common word, not a repeated unit, not a keyboard run) and use at least 8 different characters; the answer is 422 otherwise."
          },
          "access": {
            "type": "string",
            "enum": [
              "read_write",
              "read_only",
              "read_upload"
            ],
            "description": "Leave it out for the default: `read_write` where code is writable (SFTP mode), `read_only` where it is read only (live, Git mode). `read_upload` reads every file and uploads to the uploads folder; it needs read only code and a root directory of `/` or `/wp-content`, and answers 422 otherwise. `read_write` where code is read only is stored as `read_only`."
          }
        },
        "required": [
          "username"
        ]
      },
      "PutSftpStatusRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "Switches SFTP on or off for every account on the environment."
      },
      "WpUserList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "login": {
                  "type": "string"
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "maxLength": 254
                },
                "display_name": {
                  "type": "string"
                },
                "roles": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "registered_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "created_by_platform": {
                  "type": "boolean",
                  "description": "True for a user WP Waterfall made for one click login. Turning that tool off deletes it."
                }
              },
              "required": [
                "id",
                "login",
                "email",
                "display_name",
                "roles",
                "registered_at",
                "created_by_platform"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "ExtensionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Extension"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "refreshed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "refreshed_at"
        ],
        "description": "The lists are not paged yet. A site has few plugins, so `next_cursor` is always null. The list is the result of the last `plugin list` or `theme list` job on the site, kept in the control plane. `refreshed_at` is when that job finished. A change made through WP Waterfall makes the next read run the list again; `POST.../refresh` runs it on demand (for example after a push)."
      },
      "Extension": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$",
            "description": "The WP-CLI name. It is the value the routes take as `{slug}`."
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive",
              "must-use",
              "dropin",
              "parent"
            ]
          },
          "update_available": {
            "type": "boolean"
          },
          "update_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "auto_update": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "WordPress automatic updates for this extension, on staging and previews. Live code is a read-only release, so live has no automatic updates and this is null there."
          },
          "network_active": {
            "type": "boolean",
            "description": "WordPress Multisite: the plugin is network activated, which WP-CLI reports as `active-network`. Every site of the network runs it. Absent or false on a single site."
          },
          "vulnerable": {
            "type": "boolean",
            "description": "True when the installed version has a known vulnerability. Absent when no vulnerability source is set up or the environment was not matched yet, so an older answer reads as \"not known\"."
          },
          "vulnerability_count": {
            "type": "integer",
            "minimum": 0,
            "description": "How many known vulnerabilities this installed version has. Absent with `vulnerable`."
          }
        },
        "required": [
          "name",
          "title",
          "version",
          "status",
          "update_available",
          "update_version",
          "auto_update"
        ],
        "description": "One row of the plugin or theme list."
      },
      "PluginDetail": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$",
            "description": "The WP-CLI name. It is the value the routes take as `{slug}`."
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive",
              "must-use",
              "dropin",
              "parent"
            ]
          },
          "update_available": {
            "type": "boolean"
          },
          "update_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "auto_update": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "WordPress automatic updates for this extension, on staging and previews. Live code is a read-only release, so live has no automatic updates and this is null there."
          },
          "network_active": {
            "type": "boolean",
            "description": "WordPress Multisite: the plugin is network activated, which WP-CLI reports as `active-network`. Every site of the network runs it. Absent or false on a single site."
          },
          "vulnerable": {
            "type": "boolean",
            "description": "True when the installed version has a known vulnerability. Absent when no vulnerability source is set up or the environment was not matched yet, so an older answer reads as \"not known\"."
          },
          "vulnerability_count": {
            "type": "integer",
            "minimum": 0,
            "description": "How many known vulnerabilities this installed version has. Absent with `vulnerable`."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "author": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "title",
          "version",
          "status",
          "update_available",
          "update_version",
          "auto_update",
          "description",
          "author"
        ],
        "description": "A plugin with the fields `wp plugin get` adds."
      },
      "ExtensionActivateRequest": {
        "type": "object",
        "properties": {
          "network": {
            "type": "boolean"
          }
        },
        "description": "Activates or deactivates one plugin, or enables one theme for the network. `network` is for a WordPress Multisite network: a plugin is activated for every site of the network (`--network`), and a theme is enabled for the network so its sites can use it. Left out, the change applies to the main site. A single site refuses `network: true`."
      },
      "ExtensionConfirmRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          },
          "confirm_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
          }
        },
        "required": [
          "confirm",
          "confirm_name"
        ],
        "description": "Update needs the typed slug. `confirm` must be true."
      },
      "AutoUpdateRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "Turns automatic updates on or off for every plugin, or every theme, on the site."
      },
      "AutoUpdateAllRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "description": "Turns automatic updates on or off for every plugin, or every theme, on the site."
      },
      "BulkExtensionRequest": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "activate",
              "deactivate",
              "update",
              "delete",
              "enable_auto_update",
              "disable_auto_update"
            ]
          },
          "slugs": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            },
            "minItems": 1,
            "maxItems": 50
          },
          "confirm": {
            "type": "boolean"
          },
          "network": {
            "type": "boolean",
            "description": "Network wide, for WordPress Multisite. Only with `activate` and `deactivate`."
          }
        },
        "required": [
          "action",
          "slugs"
        ],
        "description": "One change to several plugins or themes, run as one WP-CLI job. Update and delete need `confirm: true`. Themes have no deactivate, and only one theme can be activated."
      },
      "CreateWpUserRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "username": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.@-]{3,60}$"
          },
          "role": {
            "type": "string",
            "enum": [
              "administrator",
              "editor",
              "author",
              "contributor",
              "subscriber",
              "shop_manager"
            ],
            "default": "administrator"
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "email",
          "confirm"
        ],
        "description": "Creates a WordPress user. The user signs in through WP Waterfall auto-login or a password reset."
      },
      "PatchWpUserRequest": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "administrator",
              "editor",
              "author",
              "contributor",
              "subscriber",
              "shop_manager"
            ]
          }
        },
        "required": [
          "role"
        ],
        "description": "Changes the WordPress role of one user."
      },
      "WpUserPasswordResetRequest": {
        "type": "object",
        "properties": {},
        "description": "Sends the WordPress password reset email to the user. WP Waterfall never sees the new password."
      },
      "WpLoginEventList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "login": {
                  "type": "string"
                },
                "user_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "exclusiveMinimum": 0
                },
                "outcome": {
                  "type": "string",
                  "enum": [
                    "succeeded",
                    "failed"
                  ]
                },
                "via": {
                  "type": "string",
                  "enum": [
                    "password",
                    "wpwaterfall"
                  ]
                },
                "ip": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "at",
                "login",
                "user_id",
                "outcome",
                "via",
                "ip"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "WpLoginUrl": {
        "type": "object",
        "properties": {
          "login_url": {
            "type": "string",
            "format": "uri"
          },
          "admin_url": {
            "type": "string",
            "format": "uri"
          },
          "custom": {
            "type": "boolean",
            "description": "True when the login page is not at `/wp-login.php`."
          },
          "plugin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "solid-security",
              "wps-hide-login",
              "patchstack",
              "all-in-one-wp-security",
              "wordfence",
              "other"
            ]
          },
          "plugin_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name to show, for example \"Solid Security\"."
          },
          "source": {
            "type": "string",
            "enum": [
              "reported",
              "default"
            ]
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "login_url",
          "admin_url",
          "custom",
          "plugin",
          "plugin_name",
          "source",
          "checked_at"
        ],
        "description": "Where the WordPress login and admin pages are. The WP Waterfall MU plugin reports the paths the way WordPress builds them for a signed out visitor, so a plugin that hides the login page at a secret address is followed. The host is always the site's primary domain, or the temporary domain when there is none. `source` is `default` when the site has not reported yet, and the URLs are then `/wp-login.php` and `/wp-admin/`."
      },
      "WordPressFact": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid"
          },
          "wordpress": {
            "type": "string",
            "enum": [
              "installed",
              "not_installed",
              "unknown"
            ],
            "description": "`installed`, `not_installed`, or `unknown` (never checked, or the check could not tell)."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The WordPress version when installed, from `wp-includes/version.php`."
          },
          "multisite": {
            "type": "boolean",
            "description": "True when WordPress runs as a Multisite network."
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the node last answered. Null before the first check."
          },
          "refreshed": {
            "type": "boolean",
            "description": "True when this answer asked the node again; false when it is the stored answer."
          },
          "update": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "version": {
                "type": "string",
                "maxLength": 16,
                "pattern": "^\\d{1,3}\\.\\d{1,3}(\\.\\d{1,3})?$",
                "description": "The release that is out, such as `6.8.3`."
              },
              "security": {
                "type": "boolean",
                "description": "True when wordpress.org marks the version this environment runs insecure, so the release carries a security fix for it. WP Waterfall installs a security release at any hour, not only in the update window, when the site's live environment (or staging, before a launch) runs an insecure version. Every response sets it."
              },
              "installs_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When WP Waterfall starts to install it by itself. When the site's live environment (or staging, before a launch) runs a version wordpress.org marks insecure, it is the next run of the update task, at most 10 minutes ahead. Otherwise it is the start of the next update window, or of the window that is open now, so it can lie in the past. Sites start a few at a time from then on, security releases first. Null when WP Waterfall does not install this release on this environment by itself as things stand: automatic WordPress updates are off, the site's code lives in a connected repository, the environment is a preview or in SFTP mode, its server cannot take the update now, the site tried this release a short while ago, or the rollout is stopped."
              }
            },
            "required": [
              "version",
              "installs_at"
            ],
            "description": "The newer WordPress release that is out for this environment, and when WP Waterfall installs it. Null when the environment runs the newest release of its major version, has no WordPress, or is a test site on the simulated server. Every response sets it."
          }
        },
        "required": [
          "environment_id",
          "wordpress",
          "version",
          "multisite",
          "checked_at",
          "refreshed"
        ],
        "description": "What the node and the environment say about WordPress, on the environment and from `GET /environments/{id}/wordpress`."
      },
      "AuditEventList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "actor_type": {
                  "type": "string",
                  "enum": [
                    "user",
                    "api_key",
                    "mcp_agent",
                    "system"
                  ]
                },
                "actor_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "actor_label": {
                  "type": "string"
                },
                "action": {
                  "type": "string"
                },
                "target_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "target_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "metadata": {
                  "type": "object",
                  "additionalProperties": {}
                },
                "ip": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "user_agent": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "actor_type",
                "actor_id",
                "actor_label",
                "action",
                "target_type",
                "target_id",
                "metadata",
                "ip",
                "user_agent",
                "created_at"
              ]
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "SiteMember": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the site membership, used in `PATCH` and `DELETE` paths."
          },
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "user_id": {
            "type": "string",
            "minLength": 16,
            "maxLength": 36
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "site_admin",
              "site_developer"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "site_id",
          "user_id",
          "email",
          "name",
          "role",
          "created_at"
        ],
        "description": "One person's access to one site. Removing it never removes the company membership."
      },
      "SiteMemberList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteMember"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AddSiteMemberRequest": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string",
            "minLength": 16,
            "maxLength": 36
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "role": {
            "type": "string",
            "enum": [
              "site_admin",
              "site_developer"
            ]
          }
        },
        "required": [
          "role"
        ],
        "description": "Gives a company member access to the site. Send the person's `user_id` or their `email`. The person must already belong to the company. Invite new people with `site_ids` on an invitation."
      },
      "PatchSiteMemberRequest": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "site_admin",
              "site_developer"
            ]
          }
        },
        "required": [
          "role"
        ]
      },
      "CreateEnvironmentRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "staging",
              "preview"
            ],
            "default": "staging",
            "description": "`staging` or `preview`. The name decides what is stored: the environment named `staging` is the site's staging, and an environment with any other name is a preview and answers with the kind `preview`, also when this says `staging`."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 63,
            "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",
            "description": "Defaults to `staging` for the first staging environment. A preview needs a name."
          },
          "from_env_id": {
            "type": "string",
            "format": "uuid",
            "description": "The environment to clone content and the branch base from. Defaults to the site's staging environment, or to live on a site that has no staging environment."
          },
          "base_branch": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
            "description": "The branch to start from. Defaults to the source environment's branch."
          },
          "code_mode": {
            "type": "string",
            "enum": [
              "git",
              "classic"
            ],
            "default": "git",
            "description": "New environments start in Git mode (`git`, a read-only release of their branch). `classic` starts the environment in SFTP mode with a writable working tree."
          }
        },
        "description": "Creates a staging or preview environment from another environment. WP Waterfall makes the Git branch from `base_branch` (the source's branch by default), clones the source's database and content store, replaces the hostname, and builds the branch."
      },
      "AdditionalPreviewQuote": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "will_be_additional": {
            "type": "boolean",
            "description": "True when the next preview is additional: no included preview is free."
          },
          "included_previews": {
            "type": "integer",
            "minimum": 0
          },
          "included_used": {
            "type": "integer",
            "minimum": 0
          },
          "included_remaining": {
            "type": "integer",
            "minimum": 0
          },
          "additional_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Additional preview environments this site has now."
          },
          "max_additional_per_site": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "slots": {
            "type": "integer",
            "minimum": 0,
            "description": "Slots the company holds, slots with an environment in them, and slots still free."
          },
          "slots_in_use": {
            "type": "integer",
            "minimum": 0
          },
          "slots_free": {
            "type": "integer",
            "minimum": 0
          },
          "slot_needed": {
            "type": "boolean",
            "description": "True when the next preview is additional and no slot is free, so the create would be refused."
          },
          "max_slots": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The most slots the company may hold before staff raise the limit, for a buyer who adds more."
          },
          "monthly_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What one slot costs a month in cents when it is used the whole month."
          },
          "message": {
            "type": "string",
            "description": "One plain sentence for the dialog and the agent."
          }
        },
        "required": [
          "site_id",
          "will_be_additional",
          "included_previews",
          "included_used",
          "included_remaining",
          "additional_count",
          "max_additional_per_site",
          "slots",
          "slots_in_use",
          "slots_free",
          "slot_needed",
          "max_slots",
          "monthly_cents",
          "message"
        ],
        "description": "What the next preview environment needs, shown before anything is created."
      },
      "ConvertToIncludedResult": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "allowance": {
            "type": "string",
            "const": "included"
          },
          "included_used": {
            "type": "integer",
            "minimum": 0,
            "description": "Included previews in use after the change, and how many the site includes."
          },
          "included_previews": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "environment_id",
          "allowance",
          "included_used",
          "included_previews"
        ],
        "description": "`POST /v1/environments/{id}/convert-to-included`: an additional preview environment becomes one of the site's included previews, once the site has a free included place. It stops using a slot, and the hours it used stay charged."
      },
      "AdditionalPreviewsUsage": {
        "type": "object",
        "properties": {
          "slots": {
            "type": "integer",
            "minimum": 0,
            "description": "Slots the company holds: a license for this many additional previews at a time."
          },
          "slots_in_use": {
            "type": "integer",
            "minimum": 0,
            "description": "Slots with an additional preview environment in them now."
          },
          "slots_free": {
            "type": "integer",
            "minimum": 0
          },
          "max_slots": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The most slots the company may hold before staff raise the limit."
          },
          "included_previews": {
            "type": "integer",
            "minimum": 0
          },
          "monthly_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What one slot costs a month in cents when it is used the whole month."
          },
          "period_start": {
            "type": "string"
          },
          "period_end": {
            "type": "string"
          },
          "used_hours": {
            "type": "number",
            "minimum": 0,
            "description": "Slot hours used so far this billing period. Unused slot time is never charged."
          },
          "used_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What the used hours cost so far, in cents."
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "environment_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "environment_name": {
                  "type": "string"
                },
                "site_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "site_name": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "When it started using a slot."
                }
              },
              "required": [
                "environment_id",
                "environment_name",
                "site_id",
                "site_name",
                "created_at"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when more lines remain after this page. The totals always cover every additional preview, not just the page."
          }
        },
        "required": [
          "slots",
          "slots_in_use",
          "slots_free",
          "max_slots",
          "included_previews",
          "monthly_cents",
          "period_start",
          "period_end",
          "used_hours",
          "used_cents",
          "data",
          "next_cursor"
        ],
        "description": "`GET /v1/billing/additional-previews`: the slots, their cost so far, and the environments in them."
      },
      "AdditionalPreviewSlots": {
        "type": "object",
        "properties": {
          "slots": {
            "type": "integer",
            "minimum": 0,
            "description": "Slots the company holds: a license for this many additional previews at a time."
          },
          "slots_in_use": {
            "type": "integer",
            "minimum": 0,
            "description": "Slots with an additional preview environment in them now."
          },
          "slots_free": {
            "type": "integer",
            "minimum": 0
          },
          "max_slots": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The most slots the company may hold before staff raise the limit."
          },
          "included_previews": {
            "type": "integer",
            "minimum": 0
          },
          "monthly_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What one slot costs a month in cents when it is used the whole month."
          },
          "period_start": {
            "type": "string"
          },
          "period_end": {
            "type": "string"
          },
          "used_hours": {
            "type": "number",
            "minimum": 0,
            "description": "Slot hours used so far this billing period. Unused slot time is never charged."
          },
          "used_cents": {
            "type": "integer",
            "minimum": 0,
            "description": "What the used hours cost so far, in cents."
          }
        },
        "required": [
          "slots",
          "slots_in_use",
          "slots_free",
          "max_slots",
          "included_previews",
          "monthly_cents",
          "period_start",
          "period_end",
          "used_hours",
          "used_cents"
        ],
        "description": "The slots of a company and what they cost so far this billing period."
      },
      "SetAdditionalPreviewSlotsRequest": {
        "type": "object",
        "properties": {
          "slots": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          }
        },
        "required": [
          "slots"
        ],
        "description": "`PUT /v1/billing/additional-previews`: set how many slots the company holds."
      },
      "EnvironmentSwitcher": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "live",
                    "staging",
                    "preview"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "branch": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "provisioning",
                    "live",
                    "failed",
                    "resetting",
                    "deleting",
                    "sleeping",
                    "waking",
                    "suspended_abuse"
                  ]
                },
                "temp_hostname": {
                  "type": "string"
                },
                "is_live": {
                  "type": "boolean"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "staging",
                    "live",
                    "preview"
                  ],
                  "description": "`staging`, `live`, or `preview`."
                },
                "release_sha": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9a-f]{40}$",
                  "description": "The commit the environment's active release runs."
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "branch",
                "status",
                "temp_hostname",
                "is_live"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "LaunchLiveRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          },
          "tier": {
            "type": "string",
            "enum": [
              "base",
              "tier_40",
              "tier_65",
              "tier_125",
              "tier_250"
            ],
            "description": "Only for a sandbox site of an Enterprise company: the Single tier the site goes live on and the company buys for it: `base` (Single 20GB), `tier_40`, `tier_65`, `tier_125`, or `tier_250`, at the company's level price. Left out, `base`. Any other site refuses it (422)."
          },
          "subscription_id": {
            "type": "string",
            "format": "uuid",
            "description": "Only for a sandbox site that goes live on a free site license an earlier plan left behind: the subscription whose free site license the site takes, from `GET /billing/subscriptions`. Left out, the one subscription with a free site license is used, and with none the company buys the site's license. Any other site ignores it."
          }
        },
        "required": [
          "confirm"
        ],
        "description": "Creates the live environment from staging."
      },
      "PromotePreview": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "staging": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "branch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
              },
              "status": {
                "type": "string",
                "enum": [
                  "provisioning",
                  "live",
                  "failed",
                  "resetting",
                  "deleting",
                  "sleeping",
                  "waking",
                  "suspended_abuse"
                ]
              },
              "temp_hostname": {
                "type": "string"
              },
              "release_sha": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9a-f]{40}$",
                "description": "The commit the environment runs. For staging with a working tree, the last commit of the working tree: the code a promote ships. Null before its first release."
              },
              "connection_mode": {
                "type": "string",
                "enum": [
                  "sftp",
                  "git"
                ],
                "description": "How the environment's code runs: `git` (read-only release, the default) or `sftp` (writable working tree). Live is always `git`. The promote dialog shows it for each side."
              }
            },
            "required": [
              "id",
              "name",
              "branch",
              "status",
              "temp_hostname",
              "release_sha"
            ]
          },
          "live": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "branch": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
              },
              "status": {
                "type": "string",
                "enum": [
                  "provisioning",
                  "live",
                  "failed",
                  "resetting",
                  "deleting",
                  "sleeping",
                  "waking",
                  "suspended_abuse"
                ]
              },
              "temp_hostname": {
                "type": "string"
              },
              "release_sha": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9a-f]{40}$",
                "description": "The commit the environment runs. For staging with a working tree, the last commit of the working tree: the code a promote ships. Null before its first release."
              },
              "connection_mode": {
                "type": "string",
                "enum": [
                  "sftp",
                  "git"
                ],
                "description": "How the environment's code runs: `git` (read-only release, the default) or `sftp` (writable working tree). Live is always `git`. The promote dialog shows it for each side."
              }
            },
            "required": [
              "id",
              "name",
              "branch",
              "status",
              "temp_hostname",
              "release_sha"
            ]
          },
          "ready": {
            "type": "boolean",
            "description": "True when a code promote (`POST /sites/{id}/promote`) would start now. With only the `nothing_to_promote` blocker, a promote that copies database or uploads can still start."
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "live_not_launched",
                    "staging_missing",
                    "staging_not_running",
                    "live_not_running",
                    "staging_sftp_mode",
                    "staging_no_release",
                    "nothing_to_promote",
                    "staging_uncommitted"
                  ]
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ]
            }
          },
          "commits": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sha": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{40}$"
                },
                "message": {
                  "type": "string"
                },
                "author_name": {
                  "type": "string"
                },
                "authored_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "sha",
                "message",
                "author_name",
                "authored_at"
              ]
            },
            "description": "Commits on staging's release that live's release lacks, newest first."
          },
          "commits_truncated": {
            "type": "boolean"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "added",
                    "modified",
                    "deleted",
                    "renamed"
                  ]
                },
                "additions": {
                  "type": "integer",
                  "minimum": 0
                },
                "deletions": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "path",
                "status",
                "additions",
                "deletions"
              ]
            },
            "description": "Files that differ between live's release and staging's release."
          },
          "files_truncated": {
            "type": "boolean"
          },
          "content": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "tables": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "size_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "rows": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "name",
                    "size_bytes",
                    "rows"
                  ]
                }
              },
              "uploads_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "uploads_merge": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "new_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "new_bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "changed_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "changed_bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "conflict_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "conflict_bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "php_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "overwrite": {
                    "type": "boolean"
                  },
                  "copied_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "samples": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "new",
                            "changed",
                            "conflict"
                          ]
                        },
                        "size_bytes": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "path",
                        "status",
                        "size_bytes"
                      ]
                    },
                    "maxItems": 20,
                    "description": "Up to 20 files, conflicts first."
                  }
                },
                "required": [
                  "new_files",
                  "new_bytes",
                  "changed_files",
                  "changed_bytes",
                  "conflict_files",
                  "conflict_bytes",
                  "php_files",
                  "overwrite",
                  "copied_files",
                  "skipped_files",
                  "samples"
                ],
                "description": "What copying staging's uploads would do to live's, across all folders: new files, files that differ where staging's is newer (`changed`), and files that differ where live's is newer (`conflict`, kept unless `uploads_overwrite`). A promote merges and never deletes. Null when the node cannot say."
              }
            },
            "required": [
              "tables",
              "uploads_bytes"
            ],
            "description": "Staging's content, for the database and uploads choices. Null when the node cannot say."
          },
          "working_tree": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkingTreeStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Staging's uncommitted changes, so the panel can offer to commit them first. Null for a legacy staging that runs a read-only release, or when the node cannot say."
          }
        },
        "required": [
          "site_id",
          "staging",
          "live",
          "ready",
          "blockers",
          "commits",
          "commits_truncated",
          "files",
          "files_truncated",
          "content"
        ],
        "description": "What a promote from staging to live would change: the commits and files of code, and staging's tables and uploads for the optional content choices. Read only."
      },
      "PromoteRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          },
          "sha": {
            "type": "string",
            "pattern": "^[0-9a-f]{40}$",
            "description": "The staging release the preview showed. A different commit on staging answers 409."
          },
          "database": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "type": "string",
                "const": "none"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 64,
                  "pattern": "^[A-Za-z0-9_]+$"
                },
                "minItems": 1,
                "maxItems": 500
              }
            ],
            "default": "none"
          },
          "uploads": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "type": "string",
                "const": "none"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[A-Za-z0-9._-]+(\\/[A-Za-z0-9._-]+)*$"
                },
                "minItems": 1,
                "maxItems": 500
              }
            ],
            "default": "none"
          },
          "uploads_overwrite": {
            "type": "boolean",
            "default": false,
            "description": "Also copy files that differ where live's copy is newer (\"Overwrite files that differ\"). Needs `uploads` and `confirm_content_overwrite`."
          },
          "confirm_content_overwrite": {
            "type": "boolean",
            "default": false
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "A short note for the release, such as what changed."
          },
          "commit_message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Commit staging's uncommitted working tree changes with this message first, as the person who promotes, and ship the result. Without it, uncommitted changes answer 409 `staging_uncommitted`. `sha` is then the commit staging ran before the commit."
          }
        },
        "required": [
          "confirm"
        ],
        "description": "Promotes staging to live: builds the commit staging runs into a release on live, optionally pushes database tables and uploads folders from staging, and swaps live to the new release. Code always moves. Content moves only when chosen. Database tables replace live's, so they need `confirm_content_overwrite`. Uploads MERGE: staging's new files, and files where staging's copy is newer, are added to live's uploads; nothing live has is deleted, and a live file that differs and is newer stays unless `uploads_overwrite` is true, which needs `confirm_content_overwrite`."
      },
      "CloneContentRequest": {
        "type": "object",
        "properties": {
          "from_env_id": {
            "type": "string",
            "format": "uuid",
            "description": "The environment to copy from. Defaults to live."
          },
          "tables": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "type": "string",
                "const": "none"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 64,
                  "pattern": "^[A-Za-z0-9_]+$"
                },
                "minItems": 1,
                "maxItems": 500
              }
            ],
            "default": "all"
          },
          "uploads": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "type": "string",
                "const": "none"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[A-Za-z0-9._-]+(\\/[A-Za-z0-9._-]+)*$"
                },
                "minItems": 1,
                "maxItems": 500
              }
            ],
            "default": "all"
          },
          "search_replace": {
            "type": "boolean",
            "default": true,
            "description": "Replace the source hostname with the target hostname in the copied tables."
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "confirm"
        ],
        "description": "Refreshes a preview environment's database and uploads from live or another environment, with table and folder selection and a search and replace to the target hostname. Code never moves this way: code moves by merge and deploy."
      },
      "CopyIntoLiveRequest": {
        "type": "object",
        "properties": {
          "from_env_id": {
            "type": "string",
            "format": "uuid",
            "description": "The staging or preview environment to copy from. Must be on the same site and server."
          },
          "tables": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "type": "string",
                "const": "none"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 64,
                  "pattern": "^[A-Za-z0-9_]+$"
                },
                "minItems": 1,
                "maxItems": 500
              }
            ],
            "default": "none"
          },
          "uploads": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "type": "string",
                "const": "none"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[A-Za-z0-9._-]+(\\/[A-Za-z0-9._-]+)*$"
                },
                "minItems": 1,
                "maxItems": 500
              }
            ],
            "default": "none"
          },
          "uploads_overwrite": {
            "type": "boolean",
            "default": false,
            "description": "Uploads merge into live's: new files and files where the source is newer arrive and nothing live has is deleted. With this on, files that differ and are newer on live are replaced too."
          },
          "confirm": {
            "type": "boolean"
          },
          "confirm_live": {
            "type": "boolean"
          },
          "live_name_confirmation": {
            "type": "string",
            "maxLength": 253
          }
        },
        "required": [
          "from_env_id"
        ],
        "description": "The three confirmations: `confirm`, `confirm_live`, and the live environment's primary hostname (or the site name) typed exactly. Nothing is selected by default: the caller chooses tables and uploads on purpose. The route says which confirmation is missing in plain words."
      },
      "CopyIntoLivePreview": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "live": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "hostname": {
                "type": "string",
                "description": "The primary hostname: the custom domain when it is active, else the temporary one."
              },
              "temp_hostname": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "hostname",
              "temp_hostname"
            ]
          },
          "source": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "name": {
                "type": "string"
              },
              "role": {
                "type": "string",
                "enum": [
                  "staging",
                  "preview",
                  "live"
                ]
              },
              "hostname": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "role",
              "hostname"
            ]
          },
          "confirmation_name": {
            "type": "string",
            "description": "What the person types to confirm: live's primary hostname. The site name works too."
          },
          "site_name": {
            "type": "string"
          },
          "ready": {
            "type": "boolean"
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "live_not_launched",
                    "live_not_running",
                    "source_not_running",
                    "source_is_live",
                    "different_server",
                    "different_table_prefix",
                    "copy_running"
                  ]
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ]
            }
          },
          "woocommerce": {
            "type": "boolean"
          },
          "tables": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "copyable": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "size_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "rows": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "on_live": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "name",
                    "size_bytes",
                    "rows",
                    "on_live"
                  ]
                },
                "description": "Source tables a copy can replace on live, with `on_live` true when live has one too."
              },
              "kept_on_live": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "size_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "rows": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "name",
                    "size_bytes",
                    "rows"
                  ]
                },
                "description": "Tables live has and the source lacks. A copy keeps them."
              },
              "protected": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Tables that never move into live."
              },
              "total_count": {
                "type": "integer",
                "minimum": 0
              },
              "total_bytes": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "copyable",
              "kept_on_live",
              "protected",
              "total_count",
              "total_bytes"
            ],
            "description": "Null when the node cannot list the tables."
          },
          "uploads": {
            "type": "object",
            "properties": {
              "source_bytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "merge": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "new_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "new_bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "changed_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "changed_bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "conflict_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "conflict_bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "php_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "overwrite": {
                    "type": "boolean"
                  },
                  "copied_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped_files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "samples": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "new",
                            "changed",
                            "conflict"
                          ]
                        },
                        "size_bytes": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "path",
                        "status",
                        "size_bytes"
                      ]
                    },
                    "maxItems": 20,
                    "description": "Up to 20 files, conflicts first."
                  }
                },
                "required": [
                  "new_files",
                  "new_bytes",
                  "changed_files",
                  "changed_bytes",
                  "conflict_files",
                  "conflict_bytes",
                  "php_files",
                  "overwrite",
                  "copied_files",
                  "skipped_files",
                  "samples"
                ],
                "description": "What merging all of the source's uploads would do to live's. Null when the node cannot say."
              }
            },
            "required": [
              "source_bytes",
              "merge"
            ]
          },
          "preserved_options": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The option patterns a copy keeps from live."
          },
          "restore_point": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "retention_days": {
                "type": "integer"
              }
            },
            "required": [
              "label",
              "retention_days"
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The warning, one sentence each. The dashboard, the error text, and the MCP prompt use them."
          }
        },
        "required": [
          "site_id",
          "live",
          "source",
          "confirmation_name",
          "site_name",
          "ready",
          "blockers",
          "woocommerce",
          "tables",
          "uploads",
          "preserved_options",
          "restore_point",
          "warnings"
        ],
        "description": "What copying one environment into live would do, with the sizes and the warning to show."
      },
      "MergeBranchRequest": {
        "type": "object",
        "properties": {
          "into": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$",
            "description": "The branch to merge into. Defaults to the site's default branch, which staging runs."
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "confirm"
        ],
        "description": "Merges this environment's branch into another branch after a conflict check."
      },
      "MergeCheck": {
        "type": "object",
        "properties": {
          "branch": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
          },
          "into": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
          },
          "clean": {
            "type": "boolean"
          },
          "conflicts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "commits_ahead": {
            "type": "integer",
            "minimum": 0
          },
          "commits_behind": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "branch",
          "into",
          "clean",
          "conflicts",
          "commits_ahead",
          "commits_behind"
        ],
        "description": "The answer of a conflict check."
      },
      "BranchList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]*$"
                },
                "sha": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{40}$"
                },
                "environment_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The environment that runs this branch, when one does."
                }
              },
              "required": [
                "name",
                "sha",
                "environment_id"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "Backup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "kind": {
            "type": "string",
            "enum": [
              "manual",
              "system",
              "daily",
              "weekly",
              "hourly"
            ]
          },
          "layer": {
            "type": "string",
            "enum": [
              "snapshot",
              "offsite"
            ],
            "description": "`snapshot` is the local ZFS layer. `offsite` is the restic copy."
          },
          "status": {
            "type": "string",
            "enum": [
              "creating",
              "ready",
              "restoring",
              "deleting",
              "expired",
              "failed"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "cause": {
            "type": "string",
            "description": "Why WP Waterfall took it: `manual`, `environment_delete`, `pre_set_php_version`, and so on."
          },
          "snapshot_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "size_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "manifest": {
            "type": "object",
            "additionalProperties": {}
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "environment_id",
          "kind",
          "layer",
          "status",
          "label",
          "cause",
          "snapshot_name",
          "size_bytes",
          "manifest",
          "expires_at",
          "created_at"
        ],
        "description": "A snapshot of an environment: its database, its content store, and a settings manifest."
      },
      "BackupList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Backup"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CreateBackupRequest": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "retention": {
            "type": "string",
            "enum": [
              "14d",
              "30d",
              "6m"
            ],
            "default": "14d",
            "description": "How long to keep the backup: `14d` (the default), `30d`, or `6m` (six months)."
          }
        }
      },
      "RestoreBackupRequest": {
        "type": "object",
        "properties": {
          "target_environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "parts": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "code",
                "database",
                "files"
              ]
            },
            "minItems": 1,
            "maxItems": 3,
            "description": "Which parts to restore: any of `code`, `database`, and `files`. Left out, all three. A backup from before WP Waterfall saved code has no code, so for it a request that leaves `parts` out restores the database and files; asking for `code` by name on it answers 409."
          },
          "confirm": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "confirm"
        ],
        "description": "Restores a snapshot to its own environment or to another environment of the same site."
      },
      "BackupDownloadLink": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "url",
          "expires_at"
        ]
      },
      "BackupDownloadLinkRequest": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "job_id"
        ],
        "description": "POST /backups/{id}/download-link. The finished `backup_download` job stores no link. The person (or API key) that asked for the download claims the link here, once."
      },
      "DownloadBackupList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "environment_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "preparing",
                    "ready",
                    "failed",
                    "expired"
                  ],
                  "description": "`preparing` while the node packs it, `ready` until it expires, `failed` when the node could not make it, and `expired` once the 48 hours are over and the file is gone. An expired row stays in the list until the week is over, then leaves."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "ready_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When the archive was ready. Null while it is being prepared and when it failed."
                },
                "expires_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When the file goes (48 hours after it was ready). Null until it is ready."
                },
                "size_bytes": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "filename": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "parts": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string",
                    "enum": [
                      "code",
                      "database",
                      "files"
                    ]
                  }
                },
                "error": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "A plain sentence when `status` is `failed`."
                },
                "job_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The job that makes the archive, for the progress of a row still `preparing`."
                }
              },
              "required": [
                "id",
                "environment_id",
                "status",
                "created_at",
                "ready_at",
                "expires_at",
                "size_bytes",
                "filename",
                "parts",
                "error",
                "job_id"
              ]
            },
            "maxItems": 20
          },
          "create": {
            "type": "object",
            "properties": {
              "allowed": {
                "type": "boolean"
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "`download_backup_weekly_limit` or `server_too_old`. Null when allowed."
              },
              "message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "next_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "The first moment a new archive is possible, for the weekly limit. Null otherwise."
              }
            },
            "required": [
              "allowed",
              "code",
              "message",
              "next_at"
            ]
          },
          "keep_hours": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "interval_days": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "data",
          "create",
          "keep_hours",
          "interval_days"
        ]
      },
      "DownloadBackupLink": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "url",
          "expires_at"
        ],
        "description": "`POST /download-backups/{id}/download-link` takes no body."
      },
      "BackupSchedule": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "off",
              "daily",
              "weekly"
            ]
          },
          "keep": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          },
          "hour_utc": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23
          },
          "weekday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          },
          "is_default": {
            "type": "boolean",
            "description": "True while the environment uses the default schedule (nobody changed it)."
          },
          "last_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next scheduled backup starts, or null when backups are off."
          },
          "system_keep": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "System restore points kept: the newest this many, each for its own hours."
          },
          "max_keep": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "description": "The most scheduled backups the plan keeps (its backup retention in days)."
          },
          "hourly": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "every_hours": {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 1
                  },
                  {
                    "type": "number",
                    "const": 6
                  }
                ]
              },
              "keep_hours": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "last_run_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "next_run_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "every_hours",
              "keep_hours",
              "last_run_at",
              "next_run_at"
            ],
            "description": "The Hourly backups add-on, on top of the schedule above: a backup every `every_hours` hours, each kept `keep_hours`. Null while the add-on is off. Only the add-on purchase sets it."
          },
          "platform_copy": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "current",
                  "late",
                  "pending",
                  "not_copied"
                ],
                "description": "`current`: a copy of this environment finished inside the limit. `late`: the newest copy is too old, or none ever finished. `pending`: the first copy has not had its day yet. `not_copied`: WP Waterfall does not copy this environment (a test site, a preview, a company's own server)."
              },
              "last_copy_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the newest copy of this environment finished, or null when none did."
              }
            },
            "required": [
              "state",
              "last_copy_at"
            ],
            "description": "The copy of this environment in another region, as the Backups tab tells it."
          }
        },
        "required": [
          "environment_id",
          "frequency",
          "keep",
          "hour_utc",
          "weekday",
          "is_default",
          "last_run_at",
          "next_run_at",
          "system_keep",
          "max_keep"
        ]
      },
      "PutBackupScheduleRequest": {
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "enum": [
              "off",
              "daily",
              "weekly"
            ]
          },
          "keep": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "description": "How many scheduled backups to keep. Older ones are deleted."
          },
          "hour_utc": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23,
            "default": 3,
            "description": "The hour the backup starts, in UTC."
          },
          "weekday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6,
            "default": 0,
            "description": "Weekly backups only: 0 is Sunday, 6 is Saturday."
          }
        },
        "required": [
          "frequency",
          "keep"
        ]
      },
      "PutHourlyBackupsRequest": {
        "type": "object",
        "properties": {
          "every_hours": {
            "anyOf": [
              {
                "type": "number",
                "const": 1
              },
              {
                "type": "number",
                "const": 6
              }
            ]
          }
        },
        "required": [
          "every_hours"
        ],
        "description": "`PUT /environments/{id}/backup-schedule/hourly`: how often the Hourly backups add-on backs up this environment. It needs the add-on on the environment (402 `hourly_backups_required` without it) and leaves the daily schedule as it is."
      },
      "PutSleepSettingRequest": {
        "type": "object",
        "properties": {
          "sleep_when_idle": {
            "type": "boolean"
          }
        },
        "required": [
          "sleep_when_idle"
        ],
        "description": "`PUT /v1/environments/{id}/sleep`: the Sleep when idle setting of one environment."
      },
      "SuspendEnvironmentRequest": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "const": true
          },
          "confirm_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "description": "The body of Suspend environment. The live environment asks for the site name, typed, as the delete does, so one stray click cannot take a public site offline. Staging and previews need nothing. `confirm` is the flag an API key sends on a guarded route (`endpointScopes`)."
      },
      "SleepSetting": {
        "type": "object",
        "properties": {
          "sleep_when_idle": {
            "type": "boolean",
            "description": "True for a non live environment whose Sleep when idle setting is on. Always false for live."
          },
          "sleeping_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the environment went to sleep, or began to wake. Null when awake."
          }
        },
        "required": [
          "sleep_when_idle",
          "sleeping_since"
        ],
        "description": "What the environment says about sleep, in the environment and the switcher."
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "string"
              }
            ]
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                }
              },
              "required": [
                "field",
                "message"
              ]
            }
          },
          "code": {
            "type": "string",
            "description": "A stable machine code for the failure, such as `missing_scope` or `job_already_running`. Every answer the API builds carries one: a specific code where `PROBLEM_CODES` names one, else the default for the status (`DEFAULT_PROBLEM_CODES`). Branch on this, never on `detail`."
          },
          "job_id": {
            "type": "string",
            "format": "uuid",
            "description": "The open job that caused a `job_already_running` conflict. Follow it with `GET /v1/jobs/{id}` instead of starting the same job again."
          },
          "verification_url": {
            "type": "string",
            "description": "The hosted page where the buyer verifies their identity, present on a `free_month_verification_required` conflict. Open it, finish, then start the plan again."
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "request_id"
        ]
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 16,
            "maxLength": 36
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "name": {
            "type": "string"
          },
          "locale": {
            "type": "string",
            "default": "en"
          },
          "assistant_mode": {
            "type": "boolean",
            "default": false,
            "description": "The person turned the Nami assistant screen on. It comes back on the next visit."
          },
          "marketing_consent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "default": null,
            "description": "When the person agreed to product news and tips by email, or null. Null means no marketing email."
          },
          "email_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "locale",
          "assistant_mode",
          "marketing_consent_at",
          "email_verified_at",
          "created_at"
        ]
      },
      "Company": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 16,
            "maxLength": 36
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "account_type": {
            "type": "string",
            "enum": [
              "individual",
              "agency",
              "enterprise"
            ]
          },
          "plan": {
            "type": [
              "string",
              "null"
            ]
          },
          "sso_enforced": {
            "type": "boolean"
          },
          "mfa_enforced": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "billing_access": {
            "type": "string",
            "enum": [
              "normal",
              "read_only",
              "suspended"
            ],
            "description": "What an unpaid invoice allows: `read_only` once Stripe's retries end (day 14), `suspended` from day 30, `normal` otherwise. Paying restores every site within a minute."
          },
          "deletion": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompanyDeletion"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set while the owner has asked to delete the company and it can still be undone."
          },
          "nami_site_content": {
            "type": "boolean",
            "description": "Nami AI may read the company's site content to answer and act: file contents, database rows, logs, WP-CLI output, WordPress users, traffic, and Safe Updates screenshots and PHP errors. On by default. While it is off the assistant refuses the tools that read site content, and Safe Updates decides by the required match alone, without its AI review."
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "account_type",
          "plan",
          "sso_enforced",
          "mfa_enforced",
          "created_at"
        ]
      },
      "Member": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 16,
            "maxLength": 36
          },
          "user_id": {
            "type": "string",
            "minLength": 16,
            "maxLength": 36
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "developer",
              "billing",
              "viewer",
              "site_admin",
              "site_developer"
            ]
          },
          "site_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 16,
              "maxLength": 36
            },
            "description": "The sites a Site Admin or Site Developer belongs to. Empty for company wide roles."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "email_verified": {
            "type": "boolean",
            "description": "False until the person confirms their email address. Absent when the server does not know."
          },
          "two_factor_enabled": {
            "type": "boolean",
            "description": "True once the person set up two-factor sign-in."
          }
        },
        "required": [
          "id",
          "user_id",
          "email",
          "name",
          "role",
          "created_at"
        ]
      },
      "MemberList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Member"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "Invitation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 16,
            "maxLength": 36
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "developer",
              "billing",
              "viewer",
              "site_admin",
              "site_developer"
            ]
          },
          "site_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "description": "UUIDv7"
            },
            "description": "Sites the invitee may use. Only set for Site Admin and Site Developer invitations."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "expires_at",
          "created_at"
        ]
      },
      "InvitationList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invitation"
            },
            "description": "The rows of this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it as `cursor` to get the next page. Null on the last page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CurrentApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sites:read",
                "sites:write",
                "backups:write",
                "backups:restore_live",
                "users:read",
                "users:write",
                "activity:read",
                "billing:read",
                "billing:write",
                "domains:read",
                "dns:write",
                "danger:destroy",
                "webhooks:read",
                "webhooks:write",
                "keys:read",
                "keys:write",
                "ssh-keys:read",
                "ssh-keys:write"
              ]
            }
          },
          "company_id": {
            "type": "string",
            "minLength": 16,
            "maxLength": 36,
            "description": "The company this call acts in."
          },
          "company_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "minLength": 16,
              "maxLength": 36
            },
            "description": "The companies the key reaches. Null means every company the person belongs to."
          }
        },
        "required": [
          "id",
          "name",
          "scopes",
          "company_id",
          "company_ids"
        ]
      },
      "PublicPricing": {
        "type": "object",
        "properties": {
          "account_type": {
            "type": "string",
            "enum": [
              "individual",
              "agency",
              "enterprise"
            ],
            "description": "The account type whose list this is. The public list reads as `individual`."
          },
          "licenses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "size": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "The site credits: 1, 2, 5, 10, or 20 on sale, 40 to 150 through an account rep."
                },
                "slug": {
                  "type": "string",
                  "description": "`license_5`."
                },
                "name": {
                  "type": "string",
                  "description": "\"WP 5\"."
                },
                "first_month_free": {
                  "type": "boolean",
                  "description": "True when the license has a free first month on the annual and three year terms (the 1 site license)."
                },
                "prices": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "lookup_key": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 80,
                        "pattern": "^[a-z0-9_]+$"
                      },
                      "interval": {
                        "type": "string",
                        "enum": [
                          "monthly",
                          "annual",
                          "triennial"
                        ]
                      },
                      "amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "What the term charges at a renewal, and at the start when there is no free first month."
                      },
                      "first_term_amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "What the FIRST term charges when the customer has the free first month: 11 months on annual, 35 on three years, for service to the end of the term. Absent on monthly."
                      },
                      "currency": {
                        "type": "string",
                        "const": "usd"
                      }
                    },
                    "required": [
                      "lookup_key",
                      "interval",
                      "amount_cents",
                      "currency"
                    ]
                  }
                },
                "limits": {
                  "type": "object",
                  "properties": {
                    "sites": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "The license's site credits: how many real sites it holds."
                    },
                    "disk_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "bandwidth_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Included server bandwidth a month in bytes: what the site's server sends out."
                    },
                    "cdn_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "staging_per_site": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Staging and preview environments per site. Under pricing model V3 this is the included allowance (one staging plus the included previews), not a cap: a site may add additional preview environments beyond it, up to `max_additional_previews_per_site`."
                    },
                    "included_previews": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Branches included beside the staging environment (V3)."
                    },
                    "max_additional_previews_per_site": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Additional preview environments a site may add beyond the included ones (V3)."
                    },
                    "php_pool_mb": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "php_workers": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "backup_retention_days": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "apm_retention_days": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "dedicated_vcpus": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "vCPUs pinned to one site. 0 on every plan and tier since ADR 241: sites share cores."
                    }
                  },
                  "required": [
                    "sites",
                    "disk_bytes",
                    "bandwidth_bytes",
                    "cdn_bytes",
                    "staging_per_site",
                    "php_pool_mb",
                    "php_workers",
                    "backup_retention_days",
                    "apm_retention_days"
                  ],
                  "description": "The pool at the included tier. A tier upgrade adds to it (`tiers`)."
                },
                "draft": {
                  "type": "boolean",
                  "description": "True while the amounts are not signed off."
                },
                "available": {
                  "type": "boolean",
                  "description": "False while a platform change the license needs has not shipped (the launch gate)."
                },
                "hidden": {
                  "type": "boolean",
                  "description": "True for a size only an account rep applies. The customer's list never carries one."
                },
                "annual_discount_bps": {
                  "type": "integer",
                  "description": "The annual discount against twelve monthly payments, in basis points."
                },
                "triennial_discount_bps": {
                  "type": "integer",
                  "description": "The three year discount against 36 monthly payments, in basis points."
                }
              },
              "required": [
                "size",
                "slug",
                "name",
                "first_month_free",
                "prices",
                "limits",
                "draft",
                "available",
                "hidden",
                "annual_discount_bps",
                "triennial_discount_bps"
              ]
            },
            "maxItems": 20
          },
          "tiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tier": {
                  "type": "string",
                  "enum": [
                    "base",
                    "tier_40",
                    "tier_65",
                    "tier_125",
                    "tier_250"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "\"Plus\"."
                },
                "monthly_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "What the tier adds a month for one site. 0 for `base`."
                },
                "prices": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "lookup_key": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 80,
                        "pattern": "^[a-z0-9_]+$"
                      },
                      "interval": {
                        "type": "string",
                        "enum": [
                          "monthly",
                          "annual",
                          "triennial"
                        ]
                      },
                      "amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "What the term charges at a renewal, and at the start when there is no free first month."
                      },
                      "first_term_amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "What the FIRST term charges when the customer has the free first month: 11 months on annual, 35 on three years, for service to the end of the term. Absent on monthly."
                      },
                      "currency": {
                        "type": "string",
                        "const": "usd"
                      }
                    },
                    "required": [
                      "lookup_key",
                      "interval",
                      "amount_cents",
                      "currency"
                    ]
                  },
                  "description": "What the tier adds for one site on each term. Empty for `base`."
                },
                "limits": {
                  "type": "object",
                  "properties": {
                    "bandwidth_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Included server bandwidth a month in bytes: what the site's server sends out."
                    },
                    "disk_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "cdn_bytes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "php_workers": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "backup_retention_days": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "dedicated_vcpus": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "vCPUs pinned to one site. 0 on every plan and tier since ADR 241: sites share cores."
                    }
                  },
                  "required": [
                    "bandwidth_bytes",
                    "disk_bytes",
                    "cdn_bytes",
                    "php_workers",
                    "backup_retention_days"
                  ],
                  "description": "The site's own limits at this tier, as on a 1 site license."
                },
                "available": {
                  "type": "boolean"
                }
              },
              "required": [
                "tier",
                "name",
                "monthly_cents",
                "prices",
                "limits",
                "available"
              ]
            }
          },
          "enterprise_levels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "level": {
                  "type": "string",
                  "enum": [
                    "silver",
                    "gold",
                    "platinum",
                    "diamond"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "from_sites": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "The licensed sites from which the level applies. A company under the Silver line has no level."
                },
                "discount_bps": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "description": "The percent off licenses and site tiers, in basis points: 500 is 5%."
                },
                "benefits": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "key",
                      "text"
                    ]
                  }
                }
              },
              "required": [
                "level",
                "name",
                "from_sites",
                "discount_bps",
                "benefits"
              ]
            },
            "description": "The Enterprise levels, Silver, Gold, and Diamond, lowest first, as information: the licensed sites each starts at, the percent off licenses and site tiers, and the service. They apply only to a company staff set up as an Enterprise partner agency."
          },
          "annual_months_free": {
            "type": "integer",
            "description": "Annual has no discount, so 0. Its saving is the free first month."
          },
          "triennial_months_free": {
            "type": "integer",
            "description": "Rounded: three year is about 2 months free on the entry plans. Read `triennial_discount_bps`."
          },
          "annual_discount_bps": {
            "type": "integer",
            "description": "The annual discount, in basis points: 0. Each license carries its own."
          },
          "triennial_discount_bps": {
            "type": "integer",
            "description": "The three year discount of Single 20GB, in basis points. Each license carries its own."
          },
          "money_back_days": {
            "type": "integer",
            "description": "The money back guarantee covers monthly licenses only."
          }
        },
        "required": [
          "account_type",
          "licenses",
          "tiers",
          "enterprise_levels",
          "annual_months_free",
          "triennial_months_free",
          "annual_discount_bps",
          "triennial_discount_bps",
          "money_back_days"
        ],
        "description": "`GET /v1/billing/licenses` and the public `GET /v1/pricing`: every license an account may buy and every site tier, with their prices. Any self-serve account buys any size."
      },
      "Readiness": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "not_ready"
            ]
          },
          "checks": {
            "type": "object",
            "properties": {
              "database": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "ok",
                      "down"
                    ]
                  },
                  "latency_ms": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Round trip of `select 1` in milliseconds. Null when the database did not answer."
                  }
                },
                "required": [
                  "status",
                  "latency_ms"
                ]
              },
              "migrations": {
                "type": "object",
                "properties": {
                  "applied": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "applied"
                ],
                "description": "Migrations the database has applied. Null when the count cannot be read."
              },
              "queue": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "inline",
                      "redis"
                    ]
                  }
                },
                "required": [
                  "mode"
                ],
                "description": "`inline` runs jobs in the API process; `redis` hands them to workers."
              },
              "gateway": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "ok",
                      "down",
                      "off"
                    ]
                  },
                  "latency_ms": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Time to open the connection in milliseconds. Null when it did not open."
                  }
                },
                "required": [
                  "status",
                  "latency_ms"
                ],
                "description": "Whether the node gateway accepts a connection: `ok`, `down`, or `off` when no gateway is set. For information only: the API serves sign-in and every read without the gateway, so a gateway that is down never makes the API not ready (that would restart it for nothing)."
              }
            },
            "required": [
              "database",
              "migrations",
              "queue"
            ]
          }
        },
        "required": [
          "status",
          "checks"
        ],
        "description": "`GET /v1/ready`: 200 when the API can reach its database, 503 when it cannot. The watchdog polls it and restarts a frozen process. `GET /v1/health` only says the process is up."
      },
      "DeepHealth": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "unavailable"
            ]
          }
        },
        "required": [
          "status"
        ],
        "description": "`GET /v1/health/deep`: 200 when the database answers and every queue has a consumer, 503 when one of them does not. The outside monitor reads it. The answer never says which part failed or how fast it was: the route is open, and that is for the logs."
      },
      "StatusBoard": {
        "type": "object",
        "properties": {
          "dashboard": {
            "type": "string",
            "enum": [
              "operational",
              "degraded",
              "outage"
            ]
          },
          "api": {
            "type": "string",
            "enum": [
              "operational",
              "degraded",
              "outage"
            ]
          },
          "edge": {
            "type": "string",
            "enum": [
              "operational",
              "degraded",
              "outage"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "overall": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "operational",
                  "degraded",
                  "partial_outage",
                  "major_outage",
                  "maintenance"
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "state",
              "message"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          },
          "components": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "group": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "operational",
                    "degraded",
                    "partial_outage",
                    "major_outage",
                    "maintenance",
                    "no_data"
                  ]
                },
                "uptime_percent": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100,
                  "description": "Uptime as a percent with two decimals, over the minutes that were measured in the last 90 days. A day nobody measured counts for nothing. Null when nothing was monitored."
                },
                "days": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "date": {
                        "type": "string",
                        "description": "UTC date, YYYY-MM-DD."
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "operational",
                          "degraded",
                          "partial_outage",
                          "major_outage",
                          "no_data"
                        ],
                        "description": "`no_data` means no minute of this day was measured. The API says so. The status page draws such a day blue with \"No issues reported\", as the owner decided on 2026-10-21, and never counts it in the uptime percent."
                      },
                      "outage_minutes": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "degraded_minutes": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "maintenance_minutes": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "description": "Minutes held in planned maintenance. Not downtime. Left out when zero."
                      },
                      "incidents": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "title": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "title"
                          ]
                        },
                        "maxItems": 3,
                        "description": "Incidents that touched the component this day, up to three. Left out when there were none."
                      }
                    },
                    "required": [
                      "date",
                      "status",
                      "outage_minutes",
                      "degraded_minutes"
                    ]
                  },
                  "description": "Oldest day first, 90 entries ending today (UTC)."
                },
                "measured_days": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 90,
                  "description": "Days of the 90 with at least one measured minute. Under 90 means the percent is \"since\"."
                },
                "measured_since": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The first UTC date of the 90 that was measured, or null when none was."
                },
                "measured_by": {
                  "type": "string",
                  "enum": [
                    "probes",
                    "provider"
                  ],
                  "description": "Where the row's status and days come from. `probes`: our own checks. `provider`: a data center where we run no server, read from Google Cloud's public incident record for its region. In a data center row measured by `probes`, a day our checks did not measure comes from that record too. The API always sends it. Left out by an older API, it means `probes`."
                },
                "history_start": {
                  "type": "string",
                  "description": "The first UTC date of the public history, when staff set one. Days before it are `no_data`, hold no minutes and no incident, and count for nothing. Left out when none is set."
                }
              },
              "required": [
                "id",
                "name",
                "group",
                "status",
                "uptime_percent",
                "days"
              ]
            }
          },
          "announcement": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "severity": {
                "type": "string",
                "enum": [
                  "info",
                  "warning"
                ]
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "After this time the line is gone. Null when staff clear it by hand."
              }
            },
            "required": [
              "message",
              "severity",
              "expires_at"
            ],
            "description": "Null when staff show no announcement, or the one they set has expired."
          },
          "active_incidents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatusIncident"
            }
          },
          "upcoming_maintenance": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatusMaintenance"
            }
          },
          "recent_incidents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatusIncident"
            },
            "description": "Resolved in the last 14 days, newest first."
          },
          "history_start": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first UTC date (YYYY-MM-DD) of the public history, or null when staff set none. Nothing before it is public: no day, no minute, and no incident that ended before it."
          }
        },
        "required": [
          "dashboard",
          "api",
          "edge",
          "url",
          "overall",
          "updated_at",
          "groups",
          "components",
          "announcement",
          "active_incidents",
          "upcoming_maintenance",
          "recent_incidents"
        ],
        "description": "`GET /v1/status`. The first four fields are the old shape the sign-in page reads and stay as they were: the dashboard, the API, and the edge as operational, degraded, or outage."
      },
      "StatusHistory": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string"
          },
          "months": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Months that hold at least one incident, newest first, plus the current month."
          },
          "incidents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatusIncident"
            }
          }
        },
        "required": [
          "month",
          "months",
          "incidents"
        ]
      },
      "StatusIncident": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "investigating",
              "identified",
              "monitoring",
              "resolved"
            ]
          },
          "impact": {
            "type": "string",
            "enum": [
              "minor",
              "major",
              "critical"
            ]
          },
          "components": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Component ids."
          },
          "component_names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Display names of those components."
          },
          "source": {
            "type": "string",
            "enum": [
              "automatic",
              "staff"
            ],
            "description": "automatic for a probe incident, staff for one a person wrote."
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "investigating",
                    "identified",
                    "monitoring",
                    "resolved"
                  ]
                },
                "body": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "edited_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When staff last changed the text. The page says so: an edit is never hidden."
                }
              },
              "required": [
                "id",
                "status",
                "body",
                "created_at",
                "edited_at"
              ]
            }
          }
        },
        "required": [
          "id",
          "title",
          "status",
          "impact",
          "components",
          "component_names",
          "source",
          "started_at",
          "resolved_at",
          "updates"
        ]
      },
      "StatusMaintenance": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "components": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "component_names": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "in_progress",
              "completed",
              "cancelled"
            ]
          }
        },
        "required": [
          "id",
          "title",
          "body",
          "components",
          "component_names",
          "starts_at",
          "ends_at",
          "status"
        ]
      },
      "ContactRequest": {
        "type": "object",
        "properties": {
          "topic": {
            "type": "string",
            "enum": [
              "general",
              "sales",
              "migration",
              "support"
            ],
            "default": "general"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 320
          },
          "company": {
            "type": "string",
            "maxLength": 200
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          },
          "website": {
            "type": "string",
            "maxLength": 500,
            "description": "The honeypot. People never see it, so it must stay empty."
          },
          "turnstile_token": {
            "type": "string",
            "maxLength": 4096,
            "description": "The Cloudflare Turnstile token, when the widget is on."
          }
        },
        "required": [
          "name",
          "email",
          "message"
        ]
      },
      "ContactResponse": {
        "type": "object",
        "properties": {
          "received": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "received"
        ]
      },
      "SetNamiSiteContent": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "True lets Nami AI read site content, false turns that off for the whole company."
          }
        },
        "required": [
          "enabled"
        ],
        "description": "`PUT /v1/companies/me/nami-site-content`. Owner or Admin, in a signed-in dashboard session. Turns Nami AI's access to the company's site content on or off."
      },
      "AdConversionRequest": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string",
            "enum": [
              "sign_up",
              "purchase"
            ],
            "description": "sign_up after the account is made, purchase after a checkout returns."
          }
        },
        "required": [
          "event"
        ],
        "additionalProperties": false,
        "description": "`POST /v1/companies/me/ad-conversions`."
      },
      "AdConversionResult": {
        "type": "object",
        "properties": {
          "fire": {
            "type": "boolean",
            "description": "True only the first time the event is recorded for the company. The dashboard reports the conversion only then, so each company counts once."
          },
          "value_usd": {
            "type": "number",
            "minimum": 0,
            "description": "For purchase: the monthly price of the company's license in US dollars."
          },
          "tx": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "description": "An opaque id for the platforms to drop a repeat report: a hash of the company id and the event. It names no company and cannot be turned back into the id."
          }
        },
        "required": [
          "fire",
          "tx"
        ]
      },
      "WebVitalsRequest": {
        "type": "object",
        "properties": {
          "route": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "pattern": "^\\/[A-Za-z0-9._~\\-/]*$"
          },
          "metrics": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "enum": [
                    "LCP",
                    "INP",
                    "CLS",
                    "FCP",
                    "TTFB"
                  ]
                },
                "value": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 600000
                }
              },
              "required": [
                "name",
                "value"
              ]
            },
            "minItems": 1,
            "maxItems": 5
          }
        },
        "required": [
          "route",
          "metrics"
        ]
      },
      "WebVitalsResponse": {
        "type": "object",
        "properties": {
          "received": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "received"
        ]
      },
      "ReferralVisitRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": [
          "code"
        ],
        "description": "A visit that arrived with `?ref=<code>`. The dashboard posts it once, and the API records the click and sets the first-party referral cookie, the same as a visit to the referral link."
      },
      "ReferralVisitResult": {
        "type": "object",
        "properties": {
          "recorded": {
            "type": "boolean"
          }
        },
        "required": [
          "recorded"
        ],
        "description": "`recorded` is false for an unknown or switched off code, and when an earlier referral stands."
      },
      "AssistantMessageRequest": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          }
        },
        "required": [
          "message"
        ]
      },
      "AssistantAnswer": {
        "type": "object",
        "properties": {
          "answer": {
            "type": "string"
          },
          "tools_used": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "refused_tools": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "answer",
          "tools_used",
          "refused_tools"
        ]
      },
      "SandboxStatus": {
        "type": "object",
        "properties": {
          "company_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              {
                "type": "string"
              }
            ],
            "description": "UUIDv7"
          },
          "sandbox": {
            "type": "boolean",
            "description": "True when this company is a sandbox: test keys work here and nowhere else."
          },
          "last_reset_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When an Owner or Admin last reset the sandbox. Null when it was never reset."
          }
        },
        "required": [
          "company_id",
          "sandbox",
          "last_reset_at"
        ],
        "description": "Test keys (`wpw_test_`) work only against a sandbox company. A sandbox keeps its sites until an Owner or Admin of the company resets it. Nothing resets it on a schedule."
      },
      "SandboxReset": {
        "type": "object",
        "properties": {
          "company_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              {
                "type": "string"
              }
            ],
            "description": "UUIDv7"
          },
          "reset_at": {
            "type": "string",
            "format": "date-time"
          },
          "sites_removed": {
            "type": "integer",
            "minimum": 0,
            "description": "Sites the reset removed before it seeded the sandbox again."
          },
          "sites_created": {
            "type": "integer",
            "minimum": 0,
            "description": "Sites the seed created."
          }
        },
        "required": [
          "company_id",
          "reset_at",
          "sites_removed",
          "sites_created"
        ],
        "description": "`POST /sandbox/reset` answers with the reset that ran."
      },
      "BulkAddonRequest": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "add",
              "remove"
            ]
          },
          "addon_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "pattern": "^[a-z0-9_]+$",
            "description": "Required for add."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "environment_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "For add: the environment that gets the add-on, when the add-on is per environment."
                },
                "addon_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "For remove: the add-on to switch off."
                }
              }
            },
            "minItems": 1,
            "maxItems": 200
          }
        },
        "required": [
          "action",
          "targets"
        ]
      },
      "DisasterRecoveryRequest": {
        "type": "object",
        "properties": {
          "standby_region": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          }
        },
        "required": [
          "standby_region"
        ],
        "description": "The node comes from the path: POST /v1/nodes/{id}/disaster-recovery."
      },
      "SiteTransferRequest": {
        "type": "object",
        "properties": {
          "to_owner_email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "to_company_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "tier": {
            "type": "string",
            "enum": [
              "base",
              "tier_40",
              "tier_65",
              "tier_125",
              "tier_250"
            ]
          },
          "confirm_dedicated_server": {
            "type": "boolean",
            "description": "A site on a month to month dedicated server takes the server with it. Send true to say you know: the sender's subscription ends with the month it paid, with no refund, and the receiving company takes the server over at its price. A site on shared hosting ignores it."
          }
        },
        "description": "`POST /v1/sites/{id}/transfer`. Name the Owner who receives the site by email (`to_owner_email`), and that Owner accepts. Or name one of your own accounts (`to_company_id`): the person who is the Owner of both companies, signed in a moment ago, moves the site at once with no second step. Send exactly one of them. An account the signed-in person does not own looks the same as one that does not exist. `tier` goes with `to_company_id` only, and only matters when that account is an Enterprise account: the site gets its own 1 site license there at the Single tier named, as a new Enterprise site does. Left out, it is `base` (Single 20GB). With `to_owner_email` the receiving Owner picks the tier when they accept."
      },
      "AcceptSiteTransferRequest": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "base",
              "tier_40",
              "tier_65",
              "tier_125",
              "tier_250"
            ]
          },
          "confirm_dedicated_server": {
            "type": "boolean",
            "description": "A site on a month to month dedicated server takes the server with it: send true to take it over at its monthly price. The first invoice is when the month the sender paid for ends. Nothing is charged now."
          }
        },
        "additionalProperties": false,
        "description": "`POST /v1/site-transfers/{id}/accept`. The body is optional. `tier` is the Single tier the site's own 1 site license is bought at when the receiving company is an Enterprise account with no free site license; left out, it is `base` (Single 20GB). Any other account that sends it gets 422, the same answer `POST /v1/sites` gives."
      },
      "SiteTransferDestinationList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "company_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "account_type": {
                  "type": "string",
                  "enum": [
                    "individual",
                    "agency",
                    "enterprise"
                  ]
                },
                "free_site_licenses": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Site licenses free in this account's plans. Null means no limit (an Enterprise account)."
                },
                "on_hold": {
                  "type": "boolean",
                  "description": "True while an unpaid invoice stops this account from taking a site."
                }
              },
              "required": [
                "company_id",
                "name",
                "account_type",
                "free_site_licenses",
                "on_hold"
              ]
            },
            "maxItems": 50
          }
        },
        "required": [
          "data"
        ]
      },
      "DomainTransferRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "zone"
          },
          "object_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253
          },
          "to_owner_email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          }
        },
        "required": [
          "kind",
          "object_id",
          "to_owner_email"
        ],
        "description": "Moves a Cloudflare DNS zone between companies, with both Owners confirming."
      },
      "AcceptInvitationRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 16,
            "maxLength": 256
          }
        },
        "required": [
          "token"
        ]
      },
      "StepUpRequest": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          }
        },
        "required": [
          "password"
        ]
      },
      "StepUpPasskeyRequest": {
        "type": "object",
        "properties": {
          "response": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "response"
        ]
      },
      "DataExport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "scope": {
            "type": "string",
            "enum": [
              "company",
              "user"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "building",
              "ready",
              "failed",
              "expired"
            ]
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "ready_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the archive is removed. Null until it is ready."
          },
          "size_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "file_count": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUIDv7"
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "One plain sentence when the export failed."
          },
          "download_available": {
            "type": "boolean",
            "description": "True while the archive is ready and has not expired."
          }
        },
        "required": [
          "id",
          "scope",
          "status",
          "requested_at",
          "ready_at",
          "expires_at",
          "size_bytes",
          "file_count",
          "job_id",
          "error",
          "download_available"
        ],
        "description": "One export request, as the dashboard and the API show it. Never holds a link."
      },
      "DataExportState": {
        "type": "object",
        "properties": {
          "latest": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataExport"
              },
              {
                "type": "null"
              }
            ],
            "description": "The newest request, or null when there never was one."
          },
          "next_request_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next request is allowed. Null when one can start now."
          }
        },
        "required": [
          "latest",
          "next_request_at"
        ],
        "description": "`GET /v1/company/data-export` and `GET /v1/users/me/data-export`."
      },
      "DataExportLink": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "filename": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "expires_at",
          "filename"
        ],
        "description": "`POST.../data-export/{id}/download-link`: a signed link that works for a few minutes."
      },
      "DataExportRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "The body of a request is empty on purpose: the export always holds everything allowed."
      },
      "CompanyDeletion": {
        "type": "object",
        "properties": {
          "company_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUIDv7"
          },
          "state": {
            "type": "string",
            "enum": [
              "scheduled",
              "purging",
              "purged",
              "cancelled"
            ]
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "purge_after": {
            "type": "string",
            "format": "date-time",
            "description": "The day the erase starts, unless the owner undoes the deletion first."
          },
          "requested_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "can_undo": {
            "type": "boolean",
            "description": "True while the owner can still undo it."
          },
          "closed": {
            "type": "boolean",
            "description": "True when the company is already closed to its members (the older Close company path)."
          },
          "plan_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "One sentence about the plan, for the owner. Null when there was no plan."
          },
          "deletes_account": {
            "type": "boolean",
            "description": "True when this is the erase of a personal workspace that ends the owner's account."
          }
        },
        "required": [
          "company_id",
          "state",
          "requested_at",
          "purge_after",
          "requested_by",
          "can_undo",
          "closed",
          "plan_note",
          "deletes_account"
        ],
        "description": "What `GET /v1/companies/me` and the staff customer view say about a pending deletion."
      },
      "PendingCompanyDeletionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "company_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUIDv7"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "scheduled",
                    "purging",
                    "purged",
                    "cancelled"
                  ]
                },
                "requested_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "purge_after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "The day the erase starts, unless the owner undoes the deletion first."
                },
                "requested_by": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "can_undo": {
                  "type": "boolean",
                  "description": "True while the owner can still undo it."
                },
                "closed": {
                  "type": "boolean",
                  "description": "True when the company is already closed to its members (the older Close company path)."
                },
                "plan_note": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "One sentence about the plan, for the owner. Null when there was no plan."
                },
                "deletes_account": {
                  "type": "boolean",
                  "description": "True when this is the erase of a personal workspace that ends the owner's account."
                },
                "company_name": {
                  "type": "string"
                }
              },
              "required": [
                "company_id",
                "state",
                "requested_at",
                "purge_after",
                "requested_by",
                "can_undo",
                "closed",
                "plan_note",
                "deletes_account",
                "company_name"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "AccountDeletionRequestBody": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "minLength": 3,
            "maxLength": 254
          }
        },
        "required": [
          "email"
        ],
        "description": "`POST /v1/users/me/deletion-request`: the address typed on the screen, or kept for a resend."
      },
      "AccountDeletionRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "The address the email went to."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "next_resend_at": {
            "type": "string",
            "format": "date-time",
            "description": "The earliest time the email can be sent again."
          }
        },
        "required": [
          "email",
          "expires_at",
          "next_resend_at"
        ],
        "description": "A link was sent, or is still waiting. Nothing has changed on the account yet."
      },
      "AccountDeletionStatus": {
        "type": "object",
        "properties": {
          "request": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AccountDeletionRequest"
              },
              {
                "type": "null"
              }
            ],
            "description": "A link was sent and still works, or null."
          },
          "scheduled": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "company_id": {
                "type": "string",
                "format": "uuid",
                "description": "UUIDv7"
              },
              "state": {
                "type": "string",
                "enum": [
                  "scheduled",
                  "purging",
                  "purged",
                  "cancelled"
                ]
              },
              "requested_at": {
                "type": "string",
                "format": "date-time"
              },
              "purge_after": {
                "type": "string",
                "format": "date-time",
                "description": "The day the erase starts, unless the owner undoes the deletion first."
              },
              "requested_by": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "can_undo": {
                "type": "boolean",
                "description": "True while the owner can still undo it."
              },
              "closed": {
                "type": "boolean",
                "description": "True when the company is already closed to its members (the older Close company path)."
              },
              "plan_note": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "One sentence about the plan, for the owner. Null when there was no plan."
              },
              "deletes_account": {
                "type": "boolean",
                "description": "True when this is the erase of a personal workspace that ends the owner's account."
              },
              "company_name": {
                "type": "string"
              }
            },
            "required": [
              "company_id",
              "state",
              "requested_at",
              "purge_after",
              "requested_by",
              "can_undo",
              "closed",
              "plan_note",
              "deletes_account",
              "company_name"
            ],
            "description": "The erase of the personal workspace is scheduled and can be undone, or null."
          }
        },
        "required": [
          "request",
          "scheduled"
        ],
        "description": "`GET /v1/users/me/deletion-request`: where the person is on the way to deleting the account."
      },
      "AccountDeletionLinkBody": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 16,
            "maxLength": 256,
            "description": "The single use secret from the link in the confirmation email."
          }
        },
        "required": [
          "token"
        ],
        "description": "The link in the email carries this secret."
      },
      "AccountDeletionConfirm": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 16,
            "maxLength": 256,
            "description": "The single use secret from the link in the confirmation email."
          },
          "erase_now": {
            "type": "boolean",
            "default": false,
            "description": "False (the default): subscriptions run to the end of the term already paid, and the 30 day wait starts then. True: erase now. Every subscription ends now with no refund for the time left, even a prepaid annual or 3 year term, and the 30 day wait starts today. Needs a sign in from the last 10 minutes."
          }
        },
        "required": [
          "token",
          "erase_now"
        ],
        "description": "`POST /v1/users/me/deletion-confirm`: the link's secret and the choice of when."
      },
      "AccountDeletionPreview": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "link_expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "workspace": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 16,
                "maxLength": 36
              },
              "name": {
                "type": "string"
              },
              "sites": {
                "type": "integer",
                "minimum": 0
              },
              "domains": {
                "type": "integer",
                "minimum": 0
              },
              "dns_zones": {
                "type": "integer",
                "minimum": 0
              },
              "plans": {
                "type": "integer",
                "minimum": 0,
                "description": "Subscriptions that are not over. They end at the end of the term already paid, no refund."
              }
            },
            "required": [
              "id",
              "name",
              "sites",
              "domains",
              "dns_zones",
              "plans"
            ],
            "description": "The personal workspace that is erased, or null when the person has none."
          },
          "leaves": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "company_id": {
                  "type": "string",
                  "minLength": 16,
                  "maxLength": 36
                },
                "company_name": {
                  "type": "string"
                }
              },
              "required": [
                "company_id",
                "company_name"
              ]
            },
            "description": "The businesses the person leaves at once. They stay open for everyone else."
          },
          "purge_after": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the erase starts unless it is undone. Null when there is no workspace to wait for."
          },
          "plan_ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the last paid term ends, when it is later than today. Null when no plan runs on."
          },
          "erase_now_purge_after": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the erase starts if you choose erase now: the 30 day wait counted from today. Null when there is no workspace to wait for."
          },
          "grace_days": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "email",
          "link_expires_at",
          "workspace",
          "leaves",
          "purge_after",
          "plan_ends_at",
          "erase_now_purge_after",
          "grace_days"
        ],
        "description": "`POST /v1/users/me/deletion-request/preview`: what the final button does. Changes nothing."
      },
      "AccountDeletionResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "erased"
            ],
            "description": "`scheduled`: the workspace waits for the erase and can be undone. `erased`: nothing was left."
          },
          "purge_after": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "company_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 16,
            "maxLength": 36
          }
        },
        "required": [
          "status",
          "purge_after",
          "company_id"
        ],
        "description": "`POST /v1/users/me/deletion-confirm`."
      },
      "CompanyEraseRequestBody": {
        "type": "object",
        "properties": {
          "confirm": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The business name, typed exactly as it appears, to confirm erasing it now."
          }
        },
        "required": [
          "confirm"
        ],
        "description": "Erase a business now. The owner of a business may give up the paid time the same way a person may for an account: `POST /v1/company/deletion-request` (a recent sign-in and the typed business name) emails a single use link, and the link's page confirms with a fresh sign-in (`POST /v1/company/deletion-confirm`). Every subscription of the business ends at once with no refund, and the 30 day wait with its undo starts today. The end of term path stays `DELETE /v1/company`. Session only: no API key and no MCP tool."
      },
      "CompanyErasePreview": {
        "type": "object",
        "properties": {
          "company_id": {
            "type": "string",
            "format": "uuid",
            "description": "The business the link erases."
          },
          "company_name": {
            "type": "string",
            "description": "The name of the business the link erases."
          },
          "email": {
            "type": "string",
            "description": "The owner's address the link was sent to."
          },
          "link_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the link stops working."
          },
          "sites": {
            "type": "integer",
            "minimum": 0,
            "description": "Sites of the business, each with its staging copies and backups."
          },
          "members": {
            "type": "integer",
            "minimum": 0,
            "description": "Members other than the owner. Each one is emailed and loses access when the erase runs."
          },
          "plans": {
            "type": "integer",
            "minimum": 0,
            "description": "Subscriptions that are not over. Each one ends today with no refund."
          },
          "purge_after": {
            "type": "string",
            "format": "date-time",
            "description": "When the erase starts: the 30 day wait counted from today. The owner can undo it until then."
          },
          "grace_days": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The days of the wait before the erase."
          }
        },
        "required": [
          "company_id",
          "company_name",
          "email",
          "link_expires_at",
          "sites",
          "members",
          "plans",
          "purge_after",
          "grace_days"
        ],
        "description": "`POST /v1/company/deletion-request/preview`: what erasing the business now does. Changes nothing."
      },
      "AuthProviders": {
        "type": "object",
        "properties": {
          "password": {
            "type": "boolean"
          },
          "google": {
            "type": "boolean"
          },
          "github": {
            "type": "boolean"
          },
          "sso": {
            "type": "boolean"
          },
          "two_factor_methods": {
            "type": "object",
            "properties": {
              "passkey": {
                "type": "boolean"
              },
              "totp": {
                "type": "boolean"
              },
              "email": {
                "type": "boolean"
              }
            },
            "required": [
              "passkey",
              "totp",
              "email"
            ]
          }
        },
        "required": [
          "password",
          "google",
          "github",
          "sso",
          "two_factor_methods"
        ]
      },
      "PasswordSignInRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "SignInResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "signed_in",
              "two_factor_required",
              "email_verification_required"
            ]
          },
          "two_factor_methods": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "passkey",
                "totp",
                "email",
                "recovery"
              ]
            },
            "default": [],
            "description": "With `two_factor_required`: the ways this person can answer."
          },
          "provider_link": {
            "type": "object",
            "properties": {
              "provider": {
                "type": "string",
                "enum": [
                  "google",
                  "github"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "linked",
                  "expired",
                  "other_account"
                ]
              }
            },
            "required": [
              "provider",
              "status"
            ],
            "description": "Set with `signed_in` when this browser held a pending provider link."
          }
        },
        "required": [
          "status",
          "two_factor_methods"
        ]
      },
      "SignUpRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 128
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "callback_path": {
            "type": "string",
            "maxLength": 300,
            "pattern": "^\\/(?!\\/)[^\\s\\\\]*$"
          },
          "marketing_consent": {
            "type": "boolean",
            "default": false,
            "description": "The person ticked \"Send me product news and tips by email.\" Off by default. Only a person who ticked it is ever sent product news."
          }
        },
        "required": [
          "email",
          "password",
          "name"
        ]
      },
      "SignUpResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "verification_sent"
          }
        },
        "required": [
          "status"
        ],
        "description": "The same answer whether or not the address already has an account."
      },
      "ResendVerificationRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "callback_path": {
            "type": "string",
            "maxLength": 300,
            "pattern": "^\\/(?!\\/)[^\\s\\\\]*$"
          }
        },
        "required": [
          "email"
        ]
      },
      "ConfirmVerificationRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 20,
            "maxLength": 2048
          }
        },
        "required": [
          "token"
        ],
        "description": "Confirms an email address with the token from the emailed link. The link opens the dashboard page `/verify`, which sends the token here when the person presses the button. Opening the link changes nothing, so a mail scanner that follows it confirms nothing."
      },
      "ConfirmVerificationResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "signed_in",
              "password_required",
              "confirmed",
              "already_confirmed"
            ]
          },
          "reset_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set only with `password_required`."
          }
        },
        "required": [
          "status",
          "reset_token"
        ],
        "description": "- `signed_in`: the address is confirmed and this browser is signed in. Only the browser that signed up gets this. - `password_required`: the address is confirmed from another browser. The password stored at sign-up is gone, and `reset_token` lets the person choose their own with `POST /auth/password/reset`. It works once, for 30 minutes. - `confirmed`: the address is confirmed, and the person signs in another way (for example a company that requires single sign-on). - `already_confirmed`: the address was confirmed before. Nothing changed."
      },
      "ForgotPasswordRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          }
        },
        "required": [
          "email"
        ]
      },
      "ForgotPasswordResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "email_sent_if_registered"
          }
        },
        "required": [
          "status"
        ]
      },
      "ResetPasswordRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 20,
            "maxLength": 200
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 128
          }
        },
        "required": [
          "token",
          "password"
        ]
      },
      "VerifyTwoFactorRequest": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "totp",
              "email",
              "recovery"
            ]
          },
          "code": {
            "type": "string",
            "minLength": 4,
            "maxLength": 32
          },
          "remember_device": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "method",
          "code"
        ]
      },
      "SendEmailCodeResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "sent"
          },
          "resend_after_seconds": {
            "type": "integer",
            "minimum": 0,
            "description": "Seconds before another code can be sent."
          }
        },
        "required": [
          "status",
          "resend_after_seconds"
        ]
      },
      "FirstFactorCodeResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "sent"
          },
          "email": {
            "type": "string",
            "description": "The account address the code went to, so the screen can say where to look."
          },
          "expires_in_seconds": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "How long the code works, in seconds."
          },
          "resend_after_seconds": {
            "type": "integer",
            "minimum": 0,
            "description": "Seconds before another code can be sent."
          }
        },
        "required": [
          "status",
          "email",
          "expires_in_seconds",
          "resend_after_seconds"
        ]
      },
      "PasskeyAuthOptionsRequest": {
        "type": "object",
        "properties": {
          "purpose": {
            "type": "string",
            "enum": [
              "sign_in",
              "second_factor"
            ]
          }
        },
        "required": [
          "purpose"
        ]
      },
      "PasskeyAuthVerifyRequest": {
        "type": "object",
        "properties": {
          "purpose": {
            "type": "string",
            "enum": [
              "sign_in",
              "second_factor"
            ]
          },
          "response": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "purpose",
          "response"
        ]
      },
      "PasskeyOptionsResult": {
        "type": "object",
        "properties": {
          "options": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "options"
        ],
        "description": "WebAuthn options as JSON for the browser. Valid for three minutes, once."
      },
      "PasskeyList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "last_used_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "synced": {
                  "type": "boolean",
                  "description": "The operating system or a password manager keeps a copy, so it follows the person to a new device."
                }
              },
              "required": [
                "id",
                "name",
                "created_at",
                "last_used_at",
                "synced"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "PasskeyRegisterOptionsRequest": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "Needed when the account has a password. A person with no password has nothing to confirm."
          },
          "email_code": {
            "type": "string",
            "pattern": "^\\d{6}$",
            "description": "Needed for a first passkey when the session started more than 15 minutes ago."
          }
        }
      },
      "PasskeyRegisterRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "response": {
            "type": "object",
            "additionalProperties": {}
          },
          "email_code": {
            "type": "string",
            "pattern": "^\\d{6}$",
            "description": "The same code as the options call. It is used up here, when the first passkey is saved."
          }
        },
        "required": [
          "response"
        ]
      },
      "PasskeyRegisterResult": {
        "type": "object",
        "properties": {
          "passkey": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "last_used_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "synced": {
                "type": "boolean",
                "description": "The operating system or a password manager keeps a copy, so it follows the person to a new device."
              }
            },
            "required": [
              "id",
              "name",
              "created_at",
              "last_used_at",
              "synced"
            ]
          },
          "recovery_codes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ten new recovery codes when this is the first passkey and no app is on. Shown once. Otherwise empty."
          }
        },
        "required": [
          "passkey",
          "recovery_codes"
        ]
      },
      "RenamePasskeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          }
        },
        "required": [
          "name"
        ]
      },
      "SocialStartRequest": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "google",
              "github"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "login",
              "signup",
              "link"
            ],
            "default": "login"
          },
          "callback_path": {
            "type": "string",
            "maxLength": 300,
            "pattern": "^\\/(?!\\/)[^\\s\\\\]*$"
          },
          "new_user_path": {
            "type": "string",
            "maxLength": 300,
            "pattern": "^\\/(?!\\/)[^\\s\\\\]*$"
          },
          "error_path": {
            "type": "string",
            "maxLength": 300,
            "pattern": "^\\/(?!\\/)[^\\s\\\\]*$"
          }
        },
        "required": [
          "provider"
        ]
      },
      "RedirectUrl": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "url"
        ]
      },
      "SsoDiscoverRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          }
        },
        "required": [
          "email"
        ]
      },
      "SsoDiscoverResult": {
        "type": "object",
        "properties": {
          "sso": {
            "type": "boolean"
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "enforced": {
            "type": "boolean",
            "description": "True when the company requires SSO, so a password is refused for this address."
          }
        },
        "required": [
          "sso",
          "company_name",
          "enforced"
        ]
      },
      "SsoStartRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "callback_path": {
            "type": "string",
            "maxLength": 300,
            "pattern": "^\\/(?!\\/)[^\\s\\\\]*$"
          },
          "error_path": {
            "type": "string",
            "maxLength": 300,
            "pattern": "^\\/(?!\\/)[^\\s\\\\]*$"
          }
        },
        "required": [
          "email"
        ]
      },
      "SetPasswordRequest": {
        "type": "object",
        "properties": {
          "current_password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "Required when the account already has a password. A Google or GitHub account has none yet."
          },
          "new_password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 128
          },
          "email_code": {
            "type": "string",
            "pattern": "^\\d{6}$",
            "description": "Needed for a first password when the session started more than 15 minutes ago: the code sent by `POST /users/me/security/first-factor-code`."
          }
        },
        "required": [
          "new_password"
        ]
      },
      "SkipPasswordPromptRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "PasswordConfirmRequest": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "Needed when the account has a password. A person with no password has nothing to confirm."
          }
        }
      },
      "TotpBeginRequest": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "Needed when the account has a password. A person with no password has nothing to confirm."
          },
          "email_code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "description": "Setting up the authenticator app. A person with no password and no passkey that checks them, whose session started more than 15 minutes ago, also sends `email_code`."
      },
      "TotpBeginResult": {
        "type": "object",
        "properties": {
          "totp_uri": {
            "type": "string",
            "description": "The otpauth URI for a QR code."
          },
          "secret": {
            "type": "string",
            "description": "The same secret as text, for typing into an app."
          },
          "recovery_codes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ten single use recovery codes. Shown once."
          }
        },
        "required": [
          "totp_uri",
          "secret",
          "recovery_codes"
        ]
      },
      "CodeConfirmRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 4,
            "maxLength": 16
          }
        },
        "required": [
          "code"
        ]
      },
      "DisableTwoFactorRequest": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "method": {
            "type": "string",
            "enum": [
              "totp",
              "email",
              "passkey",
              "all"
            ],
            "default": "all"
          },
          "passkey_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "With `method` `passkey`: the passkey to remove."
          },
          "email_code": {
            "type": "string",
            "pattern": "^\\d{6}$",
            "description": "For a person with no password and no passkey that checks them, whose session started more than 15 minutes ago: the code from `POST /users/me/security/first-factor-code`."
          },
          "second_factor": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "totp",
                  "recovery",
                  "passkey",
                  "email"
                ]
              },
              "code": {
                "type": "string",
                "minLength": 4,
                "maxLength": 32
              }
            },
            "required": [
              "method"
            ],
            "description": "A current second factor. Required: the password alone does not remove one."
          }
        }
      },
      "RegenerateRecoveryCodesRequest": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "Needed when the account has a password. A person with no password has nothing to confirm."
          },
          "email_code": {
            "type": "string",
            "pattern": "^\\d{6}$",
            "description": "As for `totpBegin`."
          },
          "second_factor": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "totp",
                  "recovery",
                  "passkey",
                  "email"
                ]
              },
              "code": {
                "type": "string",
                "minLength": 4,
                "maxLength": 32
              }
            },
            "required": [
              "method"
            ],
            "description": "A current second factor. Required: the password alone does not make new codes."
          }
        },
        "description": "Making new recovery codes: the password (or emailed code) and a current second factor."
      },
      "RecoveryCodesResult": {
        "type": "object",
        "properties": {
          "recovery_codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "recovery_codes"
        ]
      },
      "SecureAccountRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "SecureAccountResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "secured"
          },
          "sessions_ended": {
            "type": "integer",
            "minimum": 0
          },
          "trusted_browsers_forgotten": {
            "type": "integer",
            "minimum": 0
          },
          "connections_ended": {
            "type": "integer",
            "minimum": 0
          },
          "api_keys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "prefix": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "last_used_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "name",
                "prefix",
                "created_at",
                "last_used_at"
              ]
            },
            "description": "The person's API keys that still work."
          }
        },
        "required": [
          "status",
          "sessions_ended",
          "trusted_browsers_forgotten",
          "connections_ended",
          "api_keys"
        ],
        "description": "What \"Secure my account\" ended: every other session, every trusted browser, and every assistant connection the person approved. API keys are listed, not revoked."
      },
      "TrustedDeviceList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "expires_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "created_at",
                "expires_at"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "ConnectionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "provider": {
                  "type": "string",
                  "enum": [
                    "google",
                    "github"
                  ]
                },
                "available": {
                  "type": "boolean",
                  "description": "The server has client credentials for this provider, so the button can show."
                },
                "linked": {
                  "type": "boolean"
                },
                "linked_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When this person linked the account, or null when it is not linked."
                }
              },
              "required": [
                "provider",
                "available",
                "linked"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "SecurityOverview": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "email_verified": {
            "type": "boolean"
          },
          "has_password": {
            "type": "boolean"
          },
          "password_nudge": {
            "type": "boolean",
            "description": "True for a person who signed in with Google or GitHub and has not made a password."
          },
          "has_proof": {
            "type": "boolean",
            "description": "True when a password or a passkey that checks the person can confirm sensitive actions."
          },
          "recent_sign_in": {
            "type": "boolean",
            "description": "True when this session started in the last 15 minutes, so a person with no password and no passkey may add the first one without more. False means the first one also needs the 6 digit code emailed to the account address."
          },
          "sign_in_methods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "two_factor": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "passkeys": {
                "type": "integer",
                "minimum": 0,
                "description": "How many passkeys the person has."
              },
              "totp": {
                "type": "boolean"
              },
              "email": {
                "type": "boolean"
              },
              "recovery_codes_remaining": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "required_by_company": {
                "type": "boolean",
                "description": "A company this person belongs to requires two factor."
              },
              "must_enroll": {
                "type": "boolean",
                "description": "Required and not set up yet: the dashboard sends this person to the Security page."
              }
            },
            "required": [
              "enabled",
              "passkeys",
              "totp",
              "email",
              "recovery_codes_remaining",
              "required_by_company",
              "must_enroll"
            ]
          },
          "connections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "provider": {
                  "type": "string",
                  "enum": [
                    "google",
                    "github"
                  ]
                },
                "available": {
                  "type": "boolean",
                  "description": "The server has client credentials for this provider, so the button can show."
                },
                "linked": {
                  "type": "boolean"
                },
                "linked_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When this person linked the account, or null when it is not linked."
                }
              },
              "required": [
                "provider",
                "available",
                "linked"
              ]
            }
          },
          "trusted_device_count": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "email",
          "email_verified",
          "has_password",
          "password_nudge",
          "has_proof",
          "recent_sign_in",
          "sign_in_methods",
          "two_factor",
          "connections",
          "trusted_device_count"
        ]
      },
      "SecurityEventList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string"
                },
                "outcome": {
                  "type": "string",
                  "enum": [
                    "success",
                    "failure",
                    "blocked"
                  ]
                },
                "ip": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "user_agent": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "kind",
                "outcome",
                "ip",
                "user_agent",
                "created_at"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "SecurityStatus": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status"
        ]
      },
      "SessionsRevoked": {
        "type": "object",
        "properties": {
          "revoked": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "revoked"
        ]
      },
      "SessionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "user_agent": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "ip": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "last_active_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "current": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "user_agent",
                "ip",
                "created_at",
                "last_active_at",
                "current"
              ]
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "IntercomIdentity": {
        "type": "object",
        "properties": {
          "app_id": {
            "type": "string",
            "description": "The Intercom workspace id the Messenger boots with."
          },
          "user_jwt": {
            "type": "string",
            "description": "A JSON Web Token signed with HS256. Its claims are user_id, email, name, company (the id and name of the company in use), iat, and exp."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the token stops working. Ask again before then."
          }
        },
        "required": [
          "app_id",
          "user_jwt",
          "expires_at"
        ]
      },
      "BugReportRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2000,
            "format": "uri",
            "description": "The address of the page the person was on."
          },
          "note": {
            "type": "string",
            "maxLength": 2000,
            "default": "",
            "description": "What the person typed. May be empty when a picture is sent."
          },
          "screenshot": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "content_type": {
                "type": "string",
                "enum": [
                  "image/jpeg",
                  "image/png"
                ],
                "description": "The kind of picture."
              },
              "data": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000000,
                "pattern": "^[A-Za-z0-9+/]+={0,2}$",
                "description": "The picture in base64, with no `data:` prefix. At most 1.5 MB before base64."
              }
            },
            "required": [
              "content_type",
              "data"
            ],
            "default": null,
            "description": "A picture of the page as the person saw it, or null when they sent none."
          },
          "viewport": {
            "type": "object",
            "properties": {
              "width": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20000,
                "description": "The width of the window, in CSS pixels."
              },
              "height": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20000,
                "description": "The height of the window, in CSS pixels."
              }
            },
            "required": [
              "width",
              "height"
            ],
            "description": "The size of the browser window, in CSS pixels."
          }
        },
        "required": [
          "url"
        ]
      },
      "BugReportResponse": {
        "type": "object",
        "properties": {
          "received": {
            "type": "boolean",
            "const": true,
            "description": "Always true: the report was emailed to WP Waterfall staff."
          }
        },
        "required": [
          "received"
        ]
      },
      "SsoConnection": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "const": "saml"
          },
          "issuer": {
            "type": "string",
            "description": "The identity provider's entity ID."
          },
          "entry_point": {
            "type": "string",
            "description": "The identity provider's single sign-on URL."
          },
          "enforced": {
            "type": "boolean"
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "domain_verified": {
            "type": "boolean"
          },
          "domain_record": {
            "type": "object",
            "properties": {
              "name_prefix": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "name_prefix",
              "value"
            ],
            "description": "The DNS TXT record that proves the company owns its domains."
          },
          "sp": {
            "type": "object",
            "properties": {
              "entity_id": {
                "type": "string"
              },
              "acs_url": {
                "type": "string"
              },
              "metadata_url": {
                "type": "string"
              }
            },
            "required": [
              "entity_id",
              "acs_url",
              "metadata_url"
            ]
          },
          "certificates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fingerprint": {
                  "type": "string"
                },
                "subject": {
                  "type": "string"
                },
                "not_before": {
                  "type": "string",
                  "format": "date-time"
                },
                "not_after": {
                  "type": "string",
                  "format": "date-time"
                },
                "expired": {
                  "type": "boolean"
                },
                "expires_soon": {
                  "type": "boolean",
                  "description": "Expires within 30 days. Add the new certificate before the old one stops."
                }
              },
              "required": [
                "fingerprint",
                "subject",
                "not_before",
                "not_after",
                "expired",
                "expires_soon"
              ]
            }
          },
          "jit": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "default_role": {
                "type": "string",
                "enum": [
                  "admin",
                  "developer",
                  "billing",
                  "viewer",
                  "site_admin",
                  "site_developer"
                ]
              },
              "group_attribute": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "role_map": {
                "type": "object",
                "additionalProperties": {
                  "type": "string",
                  "enum": [
                    "admin",
                    "developer",
                    "billing",
                    "viewer",
                    "site_admin",
                    "site_developer"
                  ]
                }
              }
            },
            "required": [
              "enabled",
              "default_role",
              "group_attribute",
              "role_map"
            ]
          },
          "idp_initiated": {
            "type": "boolean"
          },
          "exceptions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Addresses that may still use a password when SSO is mandatory. The owner always may."
          },
          "last_test": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "ok": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "at",
              "ok",
              "message"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "provider",
          "issuer",
          "entry_point",
          "enforced",
          "domains",
          "domain_verified",
          "domain_record",
          "sp",
          "certificates",
          "jit",
          "idp_initiated",
          "exceptions",
          "last_test",
          "created_at"
        ]
      },
      "UpsertSsoRequest": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "const": "saml",
            "default": "saml"
          },
          "idp_metadata_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "idp_metadata_xml": {
            "type": "string",
            "maxLength": 200000
          },
          "issuer": {
            "type": "string",
            "maxLength": 2048
          },
          "entry_point": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "certificate": {
            "type": "string",
            "maxLength": 20000
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 253,
              "pattern": "^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
            },
            "maxItems": 10,
            "default": []
          },
          "enforced": {
            "type": "boolean",
            "default": false
          }
        },
        "description": "Sets the identity provider. Give metadata (a URL or the XML) or the three manual fields."
      },
      "PatchSsoRequest": {
        "type": "object",
        "properties": {
          "enforced": {
            "type": "boolean"
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 253,
              "pattern": "^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
            },
            "maxItems": 10
          },
          "jit_enabled": {
            "type": "boolean"
          },
          "default_role": {
            "type": "string",
            "enum": [
              "admin",
              "developer",
              "billing",
              "viewer",
              "site_admin",
              "site_developer"
            ]
          },
          "group_attribute": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "role_map": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "admin",
                "developer",
                "billing",
                "viewer",
                "site_admin",
                "site_developer"
              ]
            }
          },
          "idp_initiated": {
            "type": "boolean"
          },
          "exceptions": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email",
              "maxLength": 254
            },
            "maxItems": 50
          }
        },
        "description": "Changes the settings around the connection without touching the identity provider."
      },
      "AddSsoCertificateRequest": {
        "type": "object",
        "properties": {
          "certificate": {
            "type": "string",
            "maxLength": 20000
          }
        },
        "required": [
          "certificate"
        ]
      },
      "SsoDomainCheck": {
        "type": "object",
        "properties": {
          "verified": {
            "type": "boolean"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "verified",
          "detail"
        ]
      },
      "SsoTestResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ok": {
                  "type": "boolean"
                },
                "detail": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "ok",
                "detail"
              ]
            }
          }
        },
        "required": [
          "ok",
          "checks"
        ]
      },
      "SsoSpMetadata": {
        "type": "object",
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "acs_url": {
            "type": "string"
          },
          "metadata_url": {
            "type": "string"
          },
          "metadata_xml": {
            "type": "string"
          }
        },
        "required": [
          "entity_id",
          "acs_url",
          "metadata_url",
          "metadata_xml"
        ]
      },
      "CancelRecoveryRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 20,
            "maxLength": 200,
            "description": "The token from the link in the email."
          }
        },
        "required": [
          "token"
        ]
      },
      "CancelRecoveryResult": {
        "type": "object",
        "properties": {
          "cancelled": {
            "type": "boolean",
            "description": "True when this call stopped the change. False when it had already ended."
          }
        },
        "required": [
          "cancelled"
        ]
      }
    }
  }
}
