{
  "openapi": "3.1.0",
  "info": {
    "title": "Rabbitflare API",
    "version": "v1 (2026-11-18)",
    "description": "The Rabbitflare API lets your code do what you do in the panel: create servers and WordPress sites, connect domains, and more.\n\n- [Quick start](https://rabbitflare.com/docs/api/quickstart)\n- [Authentication](https://rabbitflare.com/docs/api/authentication) and [scopes](https://rabbitflare.com/docs/api/scopes)\n- [Errors](https://rabbitflare.com/docs/api/errors)\n- [Pagination and filtering](https://rabbitflare.com/docs/api/pagination)\n- [Rate limits](https://rabbitflare.com/docs/api/rate-limits)\n- [Idempotency](https://rabbitflare.com/docs/api/idempotency)\n- [Long-running operations](https://rabbitflare.com/docs/api/async)",
    "contact": {
      "name": "Rabbitflare support",
      "email": "support@rabbitflare.com",
      "url": "https://rabbitflare.com/support"
    },
    "termsOfService": "https://rabbitflare.com/terms"
  },
  "externalDocs": {
    "description": "Guides and reference",
    "url": "https://rabbitflare.com/docs/api"
  },
  "servers": [
    {
      "url": "https://api.rabbitflare.com/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "The account the token belongs to: its features and limits."
    },
    {
      "name": "Catalogue",
      "description": "Clouds, locations and plans you can create servers with, and what's in stock."
    },
    {
      "name": "Servers",
      "description": "Servers: create, power, resize, snapshots and restores, graphs, logs and more."
    },
    {
      "name": "Sites",
      "description": "WordPress sites on your servers: create, sign in, tools, and delete."
    },
    {
      "name": "Site domains",
      "description": "Connect domains to sites, verify their DNS and choose the primary one."
    },
    {
      "name": "CDN",
      "description": "The included CDN for a site's static files."
    },
    {
      "name": "Firewall",
      "description": "A site's web application firewall."
    },
    {
      "name": "Cloudflare protection",
      "description": "Putting a site behind Cloudflare."
    },
    {
      "name": "Server security",
      "description": "Imunify360 on a server: its firewall, web application firewall, bot checks, kernel patches and WordPress plugin."
    },
    {
      "name": "Malware protection",
      "description": "Imunify360's malware scanning and cleaning for a site."
    },
    {
      "name": "Resources",
      "description": "The CPU, memory, processes and PHP settings a site may use."
    },
    {
      "name": "Cron jobs",
      "description": "Scheduled tasks on a site."
    },
    {
      "name": "Files",
      "description": "A site's files: list, read, write, upload and download."
    },
    {
      "name": "Backups",
      "description": "Site backups, restores, and where backups are stored."
    },
    {
      "name": "Staging",
      "description": "A site's staging copy: create, refresh, push and undo."
    },
    {
      "name": "Cloning",
      "description": "Copy a site to a new site."
    },
    {
      "name": "RabbitPress Cache",
      "description": "The RabbitPress Cache plugin on sites, and its licences."
    },
    {
      "name": "Media Offload",
      "description": "Keep a site's media library in cloud storage."
    },
    {
      "name": "Rabbitflare SMTP",
      "description": "Send a site's WordPress emails through Rabbitflare."
    },
    {
      "name": "Support tickets",
      "description": "Open support tickets and answer them."
    },
    {
      "name": "Events",
      "description": "What happened on the account, newest first."
    },
    {
      "name": "Webhooks",
      "description": "Get told when something happens, at a URL of yours."
    },
    {
      "name": "Token",
      "description": "The API token in use."
    },
    {
      "name": "Meta",
      "description": "The API's index, its OpenAPI document and a test call."
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "metaIndex",
        "summary": "Get the API's index",
        "description": "Answers what the API is and where its documentation and OpenAPI document are. Needs no token.\n\nUse it to check you have the right address: `https://api.rabbitflare.com/v1`.",
        "tags": [
          "Meta"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiIndex"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`api_unavailable`: The API is switched off for everyone for a while.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1\");\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare();\nconst data = await rf.meta.index();\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1\",\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "metaOpenapi",
        "summary": "Get the OpenAPI document",
        "description": "Answers the API's [OpenAPI 3.1](https://spec.openapis.org/oas/v3.1.0) document: every operation, schema, scope and error of `v1`. Needs no token.\n\nThe document itself is the answer (it isn't wrapped in `data`). It can be cached for 5 minutes. Code generators, Postman and other API tools can read it directly.",
        "tags": [
          "Meta"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/json"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`api_unavailable`: The API is switched off for everyone for a while.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/openapi.json\" \\\n  -OJ"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { writeFile } from \"node:fs/promises\";\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/openapi.json\");\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nawait writeFile(\"download\", Buffer.from(await res.arrayBuffer()));"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { writeFile } from \"node:fs/promises\";\nimport { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare();\nconst res = await rf.meta.openapi();\nawait writeFile(\"download\", Buffer.from(await res.arrayBuffer()));"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/openapi.json');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nfile_put_contents('download', $body);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/openapi.json\",\n    timeout=120,\n)\nresponse.raise_for_status()\nwith open(\"download\", \"wb\") as f:\n    f.write(response.content)"
          }
        ]
      }
    },
    "/ping": {
      "get": {
        "operationId": "metaPing",
        "summary": "Test a token",
        "description": "Answers `ok: true` and the API's time when the token works. Any valid token can call it: it needs no scope and changes nothing.\n\nUse it to check a new token, or that a token still works, before making real calls.",
        "tags": [
          "Meta"
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ping"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`missing_token`: No API token was sent.\n\n`invalid_token`: The token is malformed or unknown.\n\n`token_expired`: The token passed its expiry date (`expiredAt`).\n\n`token_revoked`: The token was revoked, or replaced by a regenerated one whose grace time has passed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`api_not_enabled`: The API isn't open to this account.\n\n`api_access_suspended`: Support paused this account's API access.\n\n`two_factor_required`: Two-factor authentication became required for this account and is off.\n\n`ip_not_allowed`: The request came from an address that isn't on the token's list of allowed IP addresses.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.\n\n`concurrency_limited`: Too many requests of this token are in progress at once.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`api_unavailable`: The API is switched off for everyone for a while.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/ping\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/ping\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.meta.ping();\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/ping');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/ping\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/token": {
      "get": {
        "operationId": "tokenGet",
        "summary": "Get the token in use",
        "description": "Answers the token making the request: its name, scopes, the servers and IP addresses it is limited to, when it expires, when it was last used, and its rate limits. Any valid token can call it: it needs no scope.\n\nThe token's secret is never shown: only its first 8 and last 4 characters, to recognise it.",
        "tags": [
          "Token"
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiToken"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`missing_token`: No API token was sent.\n\n`invalid_token`: The token is malformed or unknown.\n\n`token_expired`: The token passed its expiry date (`expiredAt`).\n\n`token_revoked`: The token was revoked, or replaced by a regenerated one whose grace time has passed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`api_not_enabled`: The API isn't open to this account.\n\n`api_access_suspended`: Support paused this account's API access.\n\n`two_factor_required`: Two-factor authentication became required for this account and is off.\n\n`ip_not_allowed`: The request came from an address that isn't on the token's list of allowed IP addresses.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.\n\n`concurrency_limited`: Too many requests of this token are in progress at once.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`api_unavailable`: The API is switched off for everyone for a while.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/token\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/token\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.token.get();\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/token');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/token\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "delete": {
        "operationId": "tokenRevoke",
        "summary": "Revoke the token in use",
        "description": "Revokes the token making the request. It stops working at once: every later call with it answers `401 token_revoked`. This can't be undone; make a new token in the panel if you need one again.\n\nThe webhook endpoints it added are turned off with it (they can be turned on again in the panel).\n\nUse it when a token may have leaked, or when the script that used it is retired. Any valid token can revoke itself: it needs no scope.",
        "tags": [
          "Token"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. There's no answer body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_json`: The body isn't valid JSON, or isn't a JSON object where one is expected.\n\n`invalid_idempotency_key`: The Idempotency-Key is empty, too long, or has characters other than A-Z a-z 0-9 _ - : .",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`missing_token`: No API token was sent.\n\n`invalid_token`: The token is malformed or unknown.\n\n`token_expired`: The token passed its expiry date (`expiredAt`).\n\n`token_revoked`: The token was revoked, or replaced by a regenerated one whose grace time has passed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`api_not_enabled`: The API isn't open to this account.\n\n`api_access_suspended`: Support paused this account's API access.\n\n`two_factor_required`: Two-factor authentication became required for this account and is off.\n\n`ip_not_allowed`: The request came from an address that isn't on the token's list of allowed IP addresses.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: The body isn't sent as application/json (or application/octet-stream for uploads).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`idempotency_key_reused`: The Idempotency-Key was already used in the last 24 hours with another operation or another body, or by another token of the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.\n\n`concurrency_limited`: Too many requests of this token are in progress at once.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`api_unavailable`: The API is switched off for everyone for a while.\n\n`api_read_only`: Only reads are served for a while (for example during maintenance).",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/token\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/token\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nawait rf.token.revoke();"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/token');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/token\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()"
          }
        ]
      }
    },
    "/account": {
      "get": {
        "operationId": "accountGet",
        "summary": "Get the account",
        "description": "Returns the account the token belongs to: its name and email address, the clouds you can create servers on, the products open to it, and its limits.\n\n`features` says which products are open to the account. An operation of a product that isn't open answers `403 feature_unavailable`, but for the few that only read or take away what the account already has there, which say so in their descriptions: Media Offload on a site (reading it, turning it off, cancelling a setup that failed, stopping an operation, a restore) and Rabbitflare SMTP (turning it off, removing an address). Products open to more accounts over time, so read it again rather than keeping it for long.",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Account"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks a scope this operation needs (`missingScopes`).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "account:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/account\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/account\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.account.get();\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/account');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/account\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/clouds": {
      "get": {
        "operationId": "catalogCloudsList",
        "summary": "List clouds",
        "description": "Lists the clouds you can create servers on, and `custom` for servers you already have at any provider, which you connect with one command.\n\nUse a cloud's `id` to list its regions and plans, to check what's in stock, and as `cloud` when you create a server. A cloud that isn't open to your account isn't listed. `GET /v1/account` gives the same ids in the order the panel shows them.",
        "tags": [
          "Catalogue"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "name"
              ],
              "default": "name"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Cloud"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.\n\n`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/clouds\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/clouds\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.catalog.clouds.list()) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/clouds');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/clouds\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/clouds/{cloud}/regions": {
      "get": {
        "operationId": "catalogRegionsList",
        "summary": "List a cloud's regions",
        "description": "Lists the regions (data centers) of a cloud where servers can be created. Pass a region's `id` as `region` when you create a server.\n\nYour own servers (`custom`) have no regions here: the list is empty. A cloud that isn't open to your account, or that doesn't exist, answers `404 not_found`.",
        "tags": [
          "Catalogue"
        ],
        "parameters": [
          {
            "name": "cloud",
            "in": "path",
            "required": true,
            "description": "A cloud's id, as `GET /v1/clouds` lists them: `digitalocean`, `vultr`, `hetzner`, `linode`, `gcp`, `edge` (Amazon EC2) or `custom` (your own servers).",
            "schema": {
              "type": "string",
              "enum": [
                "digitalocean",
                "vultr",
                "hetzner",
                "linode",
                "gcp",
                "edge",
                "custom"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "city",
                "country",
                "continent"
              ],
              "default": "name"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Region"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.\n\n`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/clouds/digitalocean/regions\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/clouds/digitalocean/regions\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.catalog.regions.list({ cloud: \"digitalocean\" })) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/clouds/digitalocean/regions');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/clouds/digitalocean/regions\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/clouds/{cloud}/plans": {
      "get": {
        "operationId": "catalogPlansList",
        "summary": "List a cloud's plans",
        "description": "Lists the plans (server sizes) you can choose on a cloud, with their price a month in US cents. Disk and data transfer are this cloud's.\n\nSome plans are offered in some regions only (`regions`). Pass `region` to list only the plans offered there; a region the cloud doesn't have gives an empty list. A plan that's sold out for now is still listed: `GET /v1/clouds/{cloud}/availability` says what's in stock.\n\nPlans the cloud no longer sells aren't listed (servers already on one keep it). For `custom`, the one plan listed is the Own servers plan: one price a month for all the servers you connect. A cloud that isn't open to your account, or that doesn't exist, answers `404 not_found`.",
        "tags": [
          "Catalogue"
        ],
        "parameters": [
          {
            "name": "cloud",
            "in": "path",
            "required": true,
            "description": "A cloud's id, as `GET /v1/clouds` lists them: `digitalocean`, `vultr`, `hetzner`, `linode`, `gcp`, `edge` (Amazon EC2) or `custom` (your own servers).",
            "schema": {
              "type": "string",
              "enum": [
                "digitalocean",
                "vultr",
                "hetzner",
                "linode",
                "gcp",
                "edge",
                "custom"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "priceMonthlyCents",
                "name",
                "vcpus",
                "memoryGb",
                "diskGb"
              ],
              "default": "priceMonthlyCents"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Only the plans offered in this region: a region's `id` from `GET /v1/clouds/{cloud}/regions`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Plan"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.\n\n`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/clouds/digitalocean/plans?region=fra1\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/clouds/digitalocean/plans?region=fra1\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.catalog.plans.list({ cloud: \"digitalocean\", region: \"fra1\" })) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/clouds/digitalocean/plans?region=fra1');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/clouds/digitalocean/plans\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"region\": \"fra1\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/clouds/{cloud}/availability": {
      "get": {
        "operationId": "catalogAvailabilityGet",
        "summary": "Get what's in stock on a cloud",
        "description": "Says which plans can be created in each region of a cloud right now, so you can choose a region and plan that won't be refused as sold out.\n\n`regions` maps each region's id to the ids of the plans in stock there. It is `null` when the cloud doesn't report its stock: then any plan it lists can be ordered, and the order is still checked when it's placed. The answer can be a few minutes old. Only plans open to your account are listed.\n\nThis asks the cloud, so it counts as a heavy request. A cloud that isn't open to your account, or that doesn't exist, answers `404 not_found`.",
        "tags": [
          "Catalogue"
        ],
        "parameters": [
          {
            "name": "cloud",
            "in": "path",
            "required": true,
            "description": "A cloud's id, as `GET /v1/clouds` lists them: `digitalocean`, `vultr`, `hetzner`, `linode`, `gcp`, `edge` (Amazon EC2) or `custom` (your own servers).",
            "schema": {
              "type": "string",
              "enum": [
                "digitalocean",
                "vultr",
                "hetzner",
                "linode",
                "gcp",
                "edge",
                "custom"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Availability"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/clouds/digitalocean/availability\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/clouds/digitalocean/availability\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.catalog.availability.get({ cloud: \"digitalocean\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/clouds/digitalocean/availability');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/clouds/digitalocean/availability\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers": {
      "get": {
        "operationId": "serversList",
        "summary": "List servers",
        "description": "Lists the account's servers, newest first. Destroyed servers aren't listed.\n\nA token limited to some servers sees only those. Filter by `status`, `cloud` or `region`; sort by `createdAt` or `name`.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "name"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only servers with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "pending_payment",
                "provisioning",
                "active",
                "off",
                "suspended",
                "failed",
                "deleting"
              ]
            }
          },
          {
            "name": "cloud",
            "in": "query",
            "required": false,
            "description": "Only servers on this cloud (`custom`: servers of your own).",
            "schema": {
              "type": "string",
              "enum": [
                "digitalocean",
                "vultr",
                "hetzner",
                "linode",
                "gcp",
                "edge",
                "custom"
              ]
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Only servers in this location, like fra1.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Server"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers?status=active\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers?status=active\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.servers.list({ status: \"active\" })) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers?status=active');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"status\": \"active\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "serversCreate",
        "summary": "Create a server",
        "description": "Orders a new server on the cloud, in the location and on the plan you choose, and sets it up for WordPress. To connect a server you already have, send `cloud: \"custom\"` with its public IPv4 address.\n\n**What happens next.** The answer is the server with `status: \"provisioning\"`; it then moves through the stages in `stage` (`creating`, `booting`, `packages`, `database`, `security`, `verifying`). It's usually ready in about 5 minutes: poll `GET /servers/{serverId}` every 10 seconds until `status` is `active`. If setup fails, `status` is `failed` with the reason in `lastError`; start it again with `POST /servers/{serverId}/actions/retry-provisioning`. Rarely the bank takes a moment to decide the card payment: the answer is then the server with `status: \"pending_payment\"`. It moves on to `provisioning` by itself once the bank accepts, or ends `deleted`, with nothing charged, if it refuses.\n\n**A first site.** Send `site` to have WordPress installed as soon as the server is ready (1 to 2 minutes more). The site is listed at once, as `queued`.\n\n**Imunify360 comes with the server.** While the account's `features.security` is on, a server Rabbitflare creates with Intel or AMD processors and 2 GB of memory or more (not your own servers, Amazon EC2 or Arm sizes) gets Imunify360 turned on by itself once it's ready (`server.ready`): `security.status` goes to `installing`, then `on` (`server.security_enabled`, a few minutes) or `failed` (`server.security_failed`). Its firewall, web application firewall and bot protection guard every site on the server, and its malware scanning and cleaning is included for the server's oldest site; each other site can have it too, for $2.99 a month (`sites.malwareProtection.enable`). It uses about 300 MB of the server's memory, and its web application firewall rules take the place of Rabbitflare's own for the server's sites. To run the server without it, wait until `security.status` is `installing` (turning it off while it's still `off` does nothing, and it would start anyway), then call `servers.security.disable`; a server where it was turned off isn't given it again. A server resized to 2 GB or more later doesn't get it by itself: use `servers.security.enable`.\n\n**A server of your own.** Nothing is ordered: the server waits until you run its connect command on it. Read the command with `GET /servers/{serverId}/connection`. Servers of your own are covered by the account's Own servers plan.\n\n**Payment.** The server is billed each month at its plan's price (`priceMonthlyCents`). The wallet is used first, then the card in `paymentMethodId`, or the account's default card. The account must have agreed to card charges once, in the panel's Billing. If the card is declined (`card_declined`) or the bank asks to confirm the payment (`payment_action_required`), nothing is created: no server, and no `server.created` or `site.created` event. `502 billing_error` means the card payment couldn't be made, was stopped before it ran, or couldn't be confirmed: send the same request again with the same key, which finds a payment that went through and never pays twice (what nobody sends again is given back). An `Idempotency-Key` header is required. A request sent again while its first try's payment is being checked answers `409 busy` (try again in a minute, with the same key: it's never paid twice); one whose server was bought and has been deleted since answers `409 conflict` (a new key buys another). A server of your own whose Own servers plan's first payment is still with the bank answers `409 busy` too, with nothing charged: try again in a few minutes.\n\n**Limits.** By default, 10 new servers an hour per account through the API (see [Rate limits](https://rabbitflare.com/docs/api/rate-limits)), and the account's own limit on servers. Some sizes and clouds open only after an account's first month.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: this operation spends money. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of paying twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServerCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.\n\n`bad_plan`: The plan can't be paid for: it has no price set up.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "`payment_method_required`: There's no money in the wallet and no saved card to pay with.\n\n`card_declined`: The card was declined. `message` gives the bank's reason. Nothing was created.\n\n`payment_action_required`: The bank wants the customer to confirm this payment, which can't happen through the API. Nothing was created.\n\n`card_needed`: Servers on this cloud need a saved card: data transfer beyond what the plan includes is charged to it.\n\n`transfer_unpaid`: An earlier data transfer bill is unpaid.\n\n`payment_required`: An unpaid bill must be settled first (for example, the Own servers plan's).\n\n`billing_error`: The payment couldn't be made or set up. `message` gives the reason.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`charges_not_authorized`: The account hasn't agreed to card charges yet.\n\n`plan_unavailable`: The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet.\n\n`cloud_unavailable`: 403: servers on this cloud aren't open to your account. 503: the cloud didn't answer just now (its stock couldn't be checked, or a server's snapshots and backups couldn't all be listed).\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`feature_unavailable`: This product isn't open to the account.\n\n`edge_new_account`: A new account can have a few servers on this cloud, and its larger sizes once the account is a month old.\n\n`email_unverified`: The account's email address isn't confirmed yet.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`card_not_found`: The card in `paymentMethodId` isn't one of this account's saved cards.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`plan_unavailable`: The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet.\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`billing_error`: The payment couldn't be made or set up. `message` gives the reason.\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`plan_unavailable`: The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`billing_error`: The payment couldn't be made or set up. `message` gives the reason.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`card_payments_off`: Card payments can't be taken right now, and servers on this cloud are paid by card.\n\n`cloud_unavailable`: 403: servers on this cloud aren't open to your account. 503: the cloud didn't answer just now (its stock couldn't be checked, or a server's snapshots and backups couldn't all be listed).\n\n`offer_unavailable`: A discount couldn't be applied just now. Nothing was charged.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:create"
        ],
        "x-rate-class": "write",
        "x-spends-money": true,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/servers\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $KEY\" \\\n  -d '{\n  \"name\": \"Production\",\n  \"cloud\": \"digitalocean\",\n  \"region\": \"fra1\",\n  \"planId\": \"business\",\n  \"site\": {\n    \"name\": \"Shop\",\n    \"siteTitle\": \"Example Shop\",\n    \"adminUsername\": \"editor\",\n    \"adminEmail\": \"you@example.com\"\n  }\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/servers\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify({\n    \"name\": \"Production\",\n    \"cloud\": \"digitalocean\",\n    \"region\": \"fra1\",\n    \"planId\": \"business\",\n    \"site\": {\n      \"name\": \"Shop\",\n      \"siteTitle\": \"Example Shop\",\n      \"adminUsername\": \"editor\",\n      \"adminEmail\": \"you@example.com\"\n    }\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.servers.create({\n  name: \"Production\",\n  cloud: \"digitalocean\",\n  region: \"fra1\",\n  planId: \"business\",\n  site: {\n    name: \"Shop\",\n    siteTitle: \"Example Shop\",\n    adminUsername: \"editor\",\n    adminEmail: \"you@example.com\",\n  },\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/servers');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Production',\n        'cloud' => 'digitalocean',\n        'region' => 'fra1',\n        'planId' => 'business',\n        'site' => [\n            'name' => 'Shop',\n            'siteTitle' => 'Example Shop',\n            'adminUsername' => 'editor',\n            'adminEmail' => 'you@example.com',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json={\n        \"name\": \"Production\",\n        \"cloud\": \"digitalocean\",\n        \"region\": \"fra1\",\n        \"planId\": \"business\",\n        \"site\": {\n            \"name\": \"Shop\",\n            \"siteTitle\": \"Example Shop\",\n            \"adminUsername\": \"editor\",\n            \"adminEmail\": \"you@example.com\",\n        },\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}": {
      "get": {
        "operationId": "serversGet",
        "summary": "Get a server",
        "description": "Returns one server: its status, plan and price, addresses, billing and PHP security status. Poll it to follow a change in progress (`status`, `stage`, `pendingAction`).",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.get({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "delete": {
        "operationId": "serversDelete",
        "summary": "Destroy a server",
        "description": "Destroys the server **and every site on it**, with their files and databases, and the server's snapshots. Rabbitflare's own copies of it (`takenBy: \"rabbitflare\"` in its list of snapshots and backups) are deleted for good about a week after the server is deleted. Its billing stops. This can't be undone.\n\nAnswers `202` with `status: \"deleting\"` while the server is removed (usually a minute or two; `GET /servers/{serverId}` then answers `404`), or `200` with `status: \"deleted\"` when the server was never paid for and is removed at once.\n\nA server of your own is disconnected instead: it keeps running at your provider with its sites, and Rabbitflare's access to it is removed.\n\nRefused while a site on the server is being copied (staging or cloning).",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:delete"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.delete({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/sites": {
      "get": {
        "operationId": "serversSitesList",
        "summary": "List a server's sites",
        "description": "Lists the WordPress sites on one server, newest first. Staging copies aren't listed: they belong to their live site.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "name"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only sites with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "installing",
                "active",
                "failed",
                "deleting"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Site"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/sites\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/sites\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.servers.sites.list({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/sites');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/sites\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/actions/power-on": {
      "post": {
        "operationId": "serversPowerOn",
        "summary": "Power on a server",
        "description": "Starts a server that's powered off (`status: \"off\"`). Answers with `pendingAction: \"power_on\"`; the server is usually `active` again within a minute or two. Servers of your own are powered at your provider. A server switched off for an unpaid data transfer bill starts once the bill is paid.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "`transfer_unpaid`: An earlier data transfer bill is unpaid.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`own_server_unsupported`: Your own servers can't do this here: their power, size, snapshots and restores belong to your provider.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/power-on\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/power-on\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.powerOn({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/power-on');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/power-on\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/actions/power-off": {
      "post": {
        "operationId": "serversPowerOff",
        "summary": "Power off a server",
        "description": "Shuts a running server down. **Its sites are offline until it's powered on again.** A server that's off is still billed. Answers with `pendingAction: \"power_off\"`; `status` is `off` within a minute or two. Servers of your own are powered at your provider.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`own_server_unsupported`: Your own servers can't do this here: their power, size, snapshots and restores belong to your provider.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/power-off\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/power-off\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.powerOff({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/power-off');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/power-off\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/actions/reboot": {
      "post": {
        "operationId": "serversReboot",
        "summary": "Reboot a server",
        "description": "Restarts a running server. Its sites are offline for the minute or two it takes. Answers with `pendingAction: \"reboot\"`, which clears once the server answers again. Works for servers of your own too.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/reboot\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/reboot\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.reboot({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/reboot');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/reboot\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/actions/resize": {
      "post": {
        "operationId": "serversResize",
        "summary": "Resize a server",
        "description": "Moves the server to a larger plan on its cloud, in its own location. **Its sites are offline for a few minutes** while it's resized; `pendingAction` is `resize` until it's done, and `planId` and `priceMonthlyCents` change then.\n\n**Payment.** The difference for the rest of the month is paid at once, from the wallet first, then the card the server is paid with, and the new price applies from then on. The account must have agreed to card charges once, in the panel's Billing. A server paid through PayPal is resized in the panel (`paypal_billed`), where PayPal asks for approval. An `Idempotency-Key` header is required.\n\n**Limits.** Only larger plans: contact support to move to a smaller one. Servers of your own are resized at your provider; a free trial server is kept (paid for) first.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: this operation spends money. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of paying twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServerResizeInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.\n\n`bad_plan`: The plan can't be paid for: it has no price set up.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "`payment_method_required`: There's no money in the wallet and no saved card to pay with.\n\n`payment_failed`: The payment didn't go through. `message` gives the reason. Nothing was changed.\n\n`payment_action_required`: The bank wants the customer to confirm this payment, which can't happen through the API. Nothing was created.\n\n`billing_error`: The payment couldn't be made or set up. `message` gives the reason.\n\n`transfer_unpaid`: An earlier data transfer bill is unpaid.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`charges_not_authorized`: The account hasn't agreed to card charges yet.\n\n`plan_unavailable`: The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet.\n\n`edge_new_account`: A new account can have a few servers on this cloud, and its larger sizes once the account is a month old.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`paypal_billed`: This server is paid through PayPal, so price changes are approved on PayPal's site.\n\n`billing_error`: The payment couldn't be made or set up. `message` gives the reason.\n\n`plan_unavailable`: The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet.\n\n`trial_server`: The server is on the free trial, which can't do this.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`plan_unavailable`: The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet.\n\n`downsize_unsupported`: A server can only move to a larger plan.\n\n`own_server_unsupported`: Your own servers can't do this here: their power, size, snapshots and restores belong to your provider.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`billing_error`: The payment couldn't be made or set up. `message` gives the reason.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:resize"
        ],
        "x-rate-class": "write",
        "x-spends-money": true,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/resize\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $KEY\" \\\n  -d '{\n  \"planId\": \"performance\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/resize\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify({\n    \"planId\": \"performance\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.servers.resize({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  planId: \"performance\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/resize');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'planId' => 'performance',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/resize\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json={\n        \"planId\": \"performance\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/actions/retry-provisioning": {
      "post": {
        "operationId": "serversRetryProvisioning",
        "summary": "Retry a failed server setup",
        "description": "Sets up again a server whose first setup failed (`status: \"failed\"`, never ready): what was half made is removed and setup starts over, as `provisioning`. Usually ready in about 5 minutes. A server that was already running can't be retried this way: contact support. For a server of your own, run its connect command again instead.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`plan_unavailable`: The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`plan_unavailable`: The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`plan_unavailable`: The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet.\n\n`own_server_unsupported`: Your own servers can't do this here: their power, size, snapshots and restores belong to your provider.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/retry-provisioning\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/retry-provisioning\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.retryProvisioning({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/retry-provisioning');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/retry-provisioning\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/actions/restart-php": {
      "post": {
        "operationId": "serversRestartPhp",
        "summary": "Restart PHP on a server",
        "description": "Restarts PHP for every site on a running server, for example after a PHP security update (`phpSecurity.state` is `restart`). Waits for the server, which can take up to a minute and a half. If PHP couldn't be restarted for some sites, the answer is `409 php_not_fully_restarted` and its message names them.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ToolResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`php_not_fully_restarted`: PHP was restarted on the server, except for the sites `message` names, with the reason.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/restart-php\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/restart-php\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.restartPhp({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/restart-php');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/restart-php\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/actions/check-php-security": {
      "post": {
        "operationId": "serversCheckPhpSecurity",
        "summary": "Check PHP security updates now",
        "description": "Checks now whether the server has every PHP security fix installed and running, and answers the result (the server's `phpSecurity` shows it too). Servers are checked every few hours anyway; a check made moments ago isn't repeated. It only reads the server, which must be running.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PhpSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`installing_updates`: Updates are being installed on the server right now.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/check-php-security\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/check-php-security\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.checkPhpSecurity({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/check-php-security');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/check-php-security\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/metrics": {
      "get": {
        "operationId": "serversMetricsGet",
        "summary": "Get a server's graphs",
        "description": "The server's graphs over a time range: processor, memory and disk use in percent, load, and bandwidth in and out. Each graph is a list of readings (`t` in Unix seconds). They're empty while the server isn't running; a new server's history fills in over its first minutes (`notice` says so).",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "The time the graphs cover: `1h`, `6h` (the default), `24h` or `7d`.",
            "schema": {
              "default": "6h",
              "type": "string",
              "enum": [
                "1h",
                "6h",
                "24h",
                "7d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerMetrics"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/metrics?range=1h\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/metrics?range=1h\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.metrics.get({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  range: \"1h\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/metrics?range=1h');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/metrics\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"range\": \"1h\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/snapshots": {
      "get": {
        "operationId": "serversSnapshotsList",
        "summary": "List a server's snapshots and backups",
        "description": "Lists the copies of the whole server it can be restored from, newest first: snapshots (`kind: \"snapshot\"`) and automatic backups (`kind: \"backup\"`). Only finished ones are listed. Amazon EC2 and Google Cloud servers and servers of your own have none: their sites are backed up one by one.\n\n`takenBy` says whose each one is. A server's automatic backups are its cloud's (`cloud`), or Rabbitflare's own weekly backups once it has moved to them (`rabbitflare`, see the server's `automaticBackupsBy`); while it moves, both are listed. Its snapshots are its cloud's, except on a Linode server on Rabbitflare's backups, whose snapshots are Rabbitflare's.\n\nWhen the server's cloud doesn't answer, its own copies can't be listed, so the list is refused with `503 cloud_unavailable` rather than answered without them (the newest copy may be one of them): try again in a minute. Rabbitflare's copies can still be listed then, with `takenBy=rabbitflare`.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "name"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Only snapshots, or only automatic backups.",
            "schema": {
              "type": "string",
              "enum": [
                "snapshot",
                "backup"
              ]
            }
          },
          {
            "name": "takenBy",
            "in": "query",
            "required": false,
            "description": "Only Rabbitflare's copies, or only the cloud's. Rabbitflare's are listed even when the cloud doesn't answer.",
            "schema": {
              "type": "string",
              "enum": [
                "rabbitflare",
                "cloud"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Snapshot"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`cloud_unavailable`: 403: servers on this cloud aren't open to your account. 503: the cloud didn't answer just now (its stock couldn't be checked, or a server's snapshots and backups couldn't all be listed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`cloud_unavailable`: 403: servers on this cloud aren't open to your account. 503: the cloud didn't answer just now (its stock couldn't be checked, or a server's snapshots and backups couldn't all be listed).",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.servers.snapshots.list({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "serversSnapshotsCreate",
        "summary": "Take a snapshot",
        "description": "Takes a snapshot of the whole server, to restore it from later. It takes a few minutes: `pendingAction` is `snapshot` until it's done, and the snapshot is then in the server's list. A server keeps up to 5 snapshots. Not available on Amazon EC2 and Google Cloud servers or servers of your own: back their sites up instead.\n\n**Linode.** Linode keeps one snapshot of a server (a new one replaces it) until the server is on Rabbitflare's backups (`automaticBackupsBy: \"rabbitflare\"`). Its snapshots are then Rabbitflare's (`takenBy: \"rabbitflare\"`): up to 5, each one deletable, and taken only while the server is running (`409 invalid_state` when it's off), while none of its backups is being taken (`409 busy`) and once its backups are set up (`409 not_ready` for a few minutes after it moves, or while our team checks them). While its backups are moving to Rabbitflare's, no snapshot can be taken (`409 busy`).",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SnapshotCreateInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`not_supported`: The server's cloud doesn't offer this (for example, whole-server snapshots on Amazon EC2 and Google Cloud), or the server's kind or size doesn't allow it (Imunify360 on a server of your own, or under 2 GB of memory).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`own_server_unsupported`: Your own servers can't do this here: their power, size, snapshots and restores belong to your provider.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"Before the theme update\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"name\": \"Before the theme update\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.snapshots.create({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  name: \"Before the theme update\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Before the theme update',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"name\": \"Before the theme update\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/snapshots/{snapshotId}": {
      "delete": {
        "operationId": "serversSnapshotsDelete",
        "summary": "Delete a snapshot",
        "description": "Deletes a snapshot. This can't be undone. Automatic backups can't be deleted, the cloud's or Rabbitflare's (they're replaced as new ones are taken), nor the one snapshot Linode keeps of a server (a new one replaces it). A Linode server on Rabbitflare's backups has Rabbitflare's snapshots instead (`takenBy: \"rabbitflare\"`), and each of those can be deleted.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "snapshotId",
            "in": "path",
            "required": true,
            "description": "The snapshot's `id`, from the server's list of snapshots: a number on some clouds, a UUID on others.",
            "schema": {
              "type": "string",
              "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9._:@+-]{1,128}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. There's no answer body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_supported`: The server's cloud doesn't offer this (for example, whole-server snapshots on Amazon EC2 and Google Cloud), or the server's kind or size doesn't allow it (Imunify360 on a server of your own, or under 2 GB of memory).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots/171824639\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots/171824639\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nawait rf.servers.snapshots.delete({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  snapshotId: \"171824639\",\n});"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots/171824639');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/snapshots/171824639\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()"
          }
        ]
      }
    },
    "/servers/{serverId}/actions/restore": {
      "post": {
        "operationId": "serversRestore",
        "summary": "Restore a server from a snapshot",
        "description": "Puts the whole server back as it was when a snapshot or automatic backup was taken. **Everything on the server since then is lost**, every site included, and the sites are offline while it's restored (usually a few minutes; `pendingAction` is `restore` until it's done). This can't be undone: take a snapshot first if you may want today's state back.\n\n**Rabbitflare's copies** (`takenBy: \"rabbitflare\"`) are copied back onto the server, which takes longer for a server with a lot of data. A server that's off is switched on for it, and stays on. When the copy can't be put back in place, the server's system is reinstalled first (its IP addresses stay), which takes longer still; on DigitalOcean our team restores it instead. Such a restore is refused while a site backup or restore runs on the server (`409 busy`), while the server's backups aren't set up (`409 not_ready`: try again in a few minutes), and for a copy that's incomplete (`409 not_restorable`).\n\n**While a server's automatic backups move to Rabbitflare's**, its cloud's backups and snapshots can't be restored (`409 busy`) for a few minutes, or for a few hours when the move has to be tried again; `pendingAction` stays null meanwhile. Rabbitflare's copies can be restored then.\n\n**If it fails**, `lastError` says so (it's null while the restore runs) and `pendingAction` is null again. A restore of one of Rabbitflare's copies that stopped partway is the exception: it keeps `pendingAction: \"restore\"` until our team has checked the server, so stop waiting once `lastError` is set.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServerRestoreInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`not_supported`: The server's cloud doesn't offer this (for example, whole-server snapshots on Amazon EC2 and Google Cloud), or the server's kind or size doesn't allow it (Imunify360 on a server of your own, or under 2 GB of memory).\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`not_restorable`: The backup is incomplete, so the server can't be restored from it. Nothing was changed.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`own_server_unsupported`: Your own servers can't do this here: their power, size, snapshots and restores belong to your provider.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/restore\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"imageId\": \"171824639\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/restore\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"imageId\": \"171824639\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.restore({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  imageId: \"171824639\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/restore');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'imageId' => '171824639',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/actions/restore\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"imageId\": \"171824639\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/logs": {
      "get": {
        "operationId": "serversLogsGet",
        "summary": "Get a server's logs and clean-up settings",
        "description": "How much room the server's logs take (the system's own logs by group, and each site's) and how they're cleaned up. The sizes are read from the server while it's running, which can take a few seconds; otherwise `usage` is null and `usageError` says why.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerLogs"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.logs.get({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/logs/settings": {
      "put": {
        "operationId": "serversLogsUpdateSettings",
        "summary": "Change a server's log clean-up",
        "description": "Sets how the server cleans up its logs: automatically every hour or not, how long old copies are kept, how large a log may grow, and whether to free up space when the disk is nearly full. The settings are put in place on the server in the background (`state: \"applying\"`, then `applied`). The server must be running. Turning automatic clean-up off always works.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServerLogSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerLogSettings"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs/settings\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"autoClean\": true,\n  \"keepDays\": 7,\n  \"maxSizeMb\": 100,\n  \"freeSpace\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs/settings\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"autoClean\": true,\n    \"keepDays\": 7,\n    \"maxSizeMb\": 100,\n    \"freeSpace\": true\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.logs.updateSettings({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  autoClean: true,\n  keepDays: 7,\n  maxSizeMb: 100,\n  freeSpace: true,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs/settings');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'autoClean' => true,\n        'keepDays' => 7,\n        'maxSizeMb' => 100,\n        'freeSpace' => true,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs/settings\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"autoClean\": True,\n        \"keepDays\": 7,\n        \"maxSizeMb\": 100,\n        \"freeSpace\": True,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/logs/actions/clear": {
      "post": {
        "operationId": "serversLogsClear",
        "summary": "Clear a server's logs",
        "description": "Empties logs on the server right away and deletes their old copies: one site's logs (or only its PHP error log or WordPress debug log), every site's, a group of the system's logs, or all of them. What's cleared can't be read again. Answers how much space was freed. The server must be running.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServerLogsClearInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerLogsCleared"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs/actions/clear\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"target\": \"site\",\n  \"siteId\": \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  \"kind\": \"debug\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs/actions/clear\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"target\": \"site\",\n    \"siteId\": \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n    \"kind\": \"debug\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.logs.clear({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  target: \"site\",\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  kind: \"debug\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs/actions/clear');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'target' => 'site',\n        'siteId' => '8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d',\n        'kind' => 'debug',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/logs/actions/clear\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"target\": \"site\",\n        \"siteId\": \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n        \"kind\": \"debug\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/connection": {
      "get": {
        "operationId": "serversConnectionGet",
        "summary": "Get the connect command of your own server",
        "description": "Servers of your own only: the one line to run on the server as root to connect it to Rabbitflare, and the ports its firewall must allow. The command carries a one-time key: keep it private, and make a new one with `POST /servers/{serverId}/connection/actions/renew` if it was shared by mistake. `command` is null once the server is connected. A server Rabbitflare created has no connection command (409 `invalid_state`).",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerConnection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.connection.get({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/connection/actions/renew": {
      "post": {
        "operationId": "serversConnectionRenew",
        "summary": "Make a new connect command",
        "description": "Servers of your own that aren't connected yet: makes a new connect command. The old one stops working at once. Refused while the server is running the command, and for servers Rabbitflare created (409 `invalid_state`).",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerConnection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection/actions/renew\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection/actions/renew\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.connection.renew({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection/actions/renew');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection/actions/renew\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/connection/actions/check": {
      "post": {
        "operationId": "serversConnectionCheck",
        "summary": "Check the connection to your own server again",
        "description": "Servers of your own: after the connect command finished on the server but Rabbitflare couldn't reach it (`stage: \"verifying\"`, usually a firewall in the way), tries again. Open the ports from `GET /servers/{serverId}/connection` first. Answers at once; the server becomes `active` once it's reached. Servers Rabbitflare created answer 409 `invalid_state`.",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Server"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection/actions/check\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection/actions/check\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.connection.check({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection/actions/check');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection/actions/check\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/media-offload": {
      "get": {
        "operationId": "serversMediaOffloadGet",
        "summary": "Get a server's Media Offload storage",
        "description": "Media Offload on a server: the storage included with it for its sites' media libraries, how much each site uses, and this month's extra storage so far. Storage beyond what's included is billed after the month ends. Servers of your own have no storage included (`allowance` is null).",
        "tags": [
          "Servers"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/media-offload\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/media-offload\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.mediaOffload.get({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/media-offload');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/media-offload\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites": {
      "get": {
        "operationId": "sitesList",
        "summary": "List sites",
        "description": "Lists the account's WordPress sites, newest first. Deleted sites and staging copies aren't listed (a staging copy belongs to its live site).\n\nA token limited to some servers sees only the sites on those. Filter by `serverId` or `status`; sort by `createdAt` or `name`.",
        "tags": [
          "Sites"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "name"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "serverId",
            "in": "query",
            "required": false,
            "description": "Only sites on this server.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only sites with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "installing",
                "active",
                "failed",
                "deleting"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Site"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites?status=active\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites?status=active\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.sites.list({ status: \"active\" })) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites?status=active');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"status\": \"active\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "sitesCreate",
        "summary": "Create a site",
        "description": "Installs a new WordPress site on one of your servers, with the administrator you name. It's reached on its built-in address (`builtInDomain`); connect your own domain with `POST /sites/{siteId}/domains`.\n\n**What happens next.** The answer is the site with `status: \"queued\"`. On a running server the install starts at once and usually takes 1 to 2 minutes (`installing`, with `stage` `wordpress`, then `ssl`); on a server that's still being set up it starts as soon as the server is ready. Poll `GET /sites/{siteId}` every 10 seconds until `status` is `active`. If the install fails, `status` is `failed` with the reason in `lastError`; try again with `POST /sites/{siteId}/actions/retry-install`.\n\nThe administrator's password is made for you: read it with `GET /sites/{siteId}/wordpress-login`. Where the firewall is available, new sites start with it protecting them.\n\n**Limits.** By default, 60 new sites an hour per account through the API (see [Rate limits](https://rabbitflare.com/docs/api/rate-limits)). Sites can't be added while their server is off, failed or being destroyed.",
        "tags": [
          "Sites"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Site"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:create"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"serverId\": \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  \"name\": \"Shop\",\n  \"siteTitle\": \"Example Shop\",\n  \"adminUsername\": \"editor\",\n  \"adminEmail\": \"you@example.com\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"serverId\": \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n    \"name\": \"Shop\",\n    \"siteTitle\": \"Example Shop\",\n    \"adminUsername\": \"editor\",\n    \"adminEmail\": \"you@example.com\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.create({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  name: \"Shop\",\n  siteTitle: \"Example Shop\",\n  adminUsername: \"editor\",\n  adminEmail: \"you@example.com\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'serverId' => '3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d',\n        'name' => 'Shop',\n        'siteTitle' => 'Example Shop',\n        'adminUsername' => 'editor',\n        'adminEmail' => 'you@example.com',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"serverId\": \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n        \"name\": \"Shop\",\n        \"siteTitle\": \"Example Shop\",\n        \"adminUsername\": \"editor\",\n        \"adminEmail\": \"you@example.com\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}": {
      "get": {
        "operationId": "sitesGet",
        "summary": "Get a site",
        "description": "Returns one site: its status, addresses, its server at a glance, its WordPress administrator, certificate, CDN, firewall and staging. Poll it to follow a change in progress (`status`, `stage`, `pendingAction`).",
        "tags": [
          "Sites"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Site"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "delete": {
        "operationId": "sitesDelete",
        "summary": "Delete a site",
        "description": "Deletes the site with its files and database, its domains, and its staging copy. This can't be undone.\n\nAnswers `202` with `status: \"deleting\"` while it's removed from its server (usually under a minute; `GET /sites/{siteId}` then answers `404`), or `200` with `status: \"deleted\"` when it was never installed and is removed at once.\n\nThe server must be running. Refused while the site is installing or busy with another change, a staging operation or a clone. A staging copy is deleted with its live site's staging (`staging_copy`).",
        "tags": [
          "Sites"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Site"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Site"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:delete"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.delete({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/actions/retry-install": {
      "post": {
        "operationId": "sitesRetryInstall",
        "summary": "Retry a failed site install",
        "description": "Installs again a site whose install failed (`status: \"failed\"`, never live). The site goes back to `queued` and installs as soon as its server is running, usually in 1 to 2 minutes. A site that was live before can't be installed again this way.",
        "tags": [
          "Sites"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Site"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/retry-install\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/retry-install\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.retryInstall({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/retry-install');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/retry-install\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/wordpress-login": {
      "get": {
        "operationId": "sitesWordpressLoginGet",
        "summary": "Get the site's WordPress login",
        "description": "The username, email address and password of the WordPress administrator made with the site. Keep the password safe. If it was changed inside WordPress, this one no longer works: set a new one with `POST /sites/{siteId}/actions/reset-admin-password`.",
        "tags": [
          "Sites"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WordPressLogin"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/wordpress-login\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/wordpress-login\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.wordpressLogin.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/wordpress-login');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/wordpress-login\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/actions/purge-cache": {
      "post": {
        "operationId": "sitesPurgeCache",
        "summary": "Purge a site's cache",
        "description": "Clears the site's page cache on its server, so visitors get fresh pages at once (the next visits are a little slower while it fills again). The site must be live and its server running. Waits for the server, which can take up to a minute and a half.",
        "tags": [
          "Sites"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ToolResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/purge-cache\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/purge-cache\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.purgeCache({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/purge-cache');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/purge-cache\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/actions/reset-admin-password": {
      "post": {
        "operationId": "sitesResetAdminPassword",
        "summary": "Reset the WordPress administrator's password",
        "description": "Sets a new random password for the WordPress administrator made with the site, and answers the login with it. The old password stops working at once. The site must be live and its server running.",
        "tags": [
          "Sites"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WordPressLogin"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`server_error`: The server answered, but not as expected.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write",
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/reset-admin-password\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/reset-admin-password\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.resetAdminPassword({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/reset-admin-password');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/reset-admin-password\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/actions/reissue-ssl": {
      "post": {
        "operationId": "sitesReissueSsl",
        "summary": "Ask for the site's SSL certificate again",
        "description": "Asks again for the SSL certificate of the site's domains, for example after a domain's DNS was fixed. It's queued at once (`sslStatus: \"pending\"`) and usually done within a few minutes: follow it on `GET /sites/{siteId}`. The site must be live and its server running.",
        "tags": [
          "Sites"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ToolResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/reissue-ssl\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/reissue-ssl\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.reissueSsl({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/reissue-ssl');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/reissue-ssl\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/domains": {
      "get": {
        "operationId": "sitesDomainsList",
        "summary": "List a site's domains",
        "description": "Lists the domains connected to a site, oldest first (its built-in address comes first), each with its DNS and certificate status.",
        "tags": [
          "Site domains"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "hostname"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SiteDomain"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.sites.domains.list({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "sitesDomainsAdd",
        "summary": "Connect a domain to a site",
        "description": "Connects a domain you own to the site. First point the domain's A record at the site's server: `dnsTarget` in the answer is its address.\n\n**What happens next.** Its DNS is checked at once. If it already points at the server, the answer has `status: \"provisioning\"`: the domain is set up on the server and its SSL certificate issued, usually within a few minutes. If not, it's `pending_dns` with the reason in `lastError`: point the DNS, then check again with `POST /sites/{siteId}/domains/{domainId}/actions/verify`.\n\nWith `makePrimary: true` the site moves to the domain as soon as its DNS is verified.\n\n**Limits.** Up to 10 domains per site, and a domain can be connected to one site only. A staging copy keeps its own address.",
        "tags": [
          "Site domains"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteDomainAddInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteDomain"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"hostname\": \"shop.example.com\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"hostname\": \"shop.example.com\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.domains.add({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  hostname: \"shop.example.com\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'hostname' => 'shop.example.com',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"hostname\": \"shop.example.com\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/domains/{domainId}/actions/verify": {
      "post": {
        "operationId": "sitesDomainsVerify",
        "summary": "Check a domain's DNS now",
        "description": "Checks now that the domain points at the site's server. When it does, the answer is `202` with `status: \"provisioning\"`: the domain is set up on the server and its SSL certificate issued, usually within a few minutes. When it doesn't, the answer is `422 dns_mismatch` saying where it points (DNS changes can take a few minutes to be seen). The built-in address needs no check (`200`).",
        "tags": [
          "Site domains"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "description": "The domain's id, from the site's list of domains.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteDomain"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteDomain"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`dns_mismatch`: The domain doesn't point to the site's server yet. `message` says where it points now.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f/actions/verify\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f/actions/verify\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.domains.verify({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  domainId: \"c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f/actions/verify');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f/actions/verify\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/domains/{domainId}/actions/make-primary": {
      "post": {
        "operationId": "sitesDomainsMakePrimary",
        "summary": "Make a domain the site's primary domain",
        "description": "Serves the site on this domain; its other domains redirect to it. For a verified domain the change is put in place on the server at once (`202`; the site's `pendingAction` is `domain` for a moment). A domain still waiting for DNS becomes primary as soon as its DNS is verified (`200`, with `primaryOnVerify: true`). A staging copy keeps its own address.",
        "tags": [
          "Site domains"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "description": "The domain's id, from the site's list of domains.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteDomain"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteDomain"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`not_verified`: The domain's DNS isn't verified yet.\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f/actions/make-primary\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f/actions/make-primary\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.domains.makePrimary({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  domainId: \"c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f/actions/make-primary');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f/actions/make-primary\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/domains/{domainId}/actions/cancel-make-primary": {
      "post": {
        "operationId": "sitesDomainsCancelMakePrimary",
        "summary": "Don't make a domain primary once verified",
        "description": "For a domain waiting for DNS: cancels its becoming the primary domain once verified (`primaryOnVerify` goes back to false). It stays connected to the site.",
        "tags": [
          "Site domains"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "description": "The domain's id, from the site's list of domains.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteDomain"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80/actions/cancel-make-primary\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80/actions/cancel-make-primary\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.domains.cancelMakePrimary({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  domainId: \"d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80/actions/cancel-make-primary');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80/actions/cancel-make-primary\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/domains/{domainId}": {
      "delete": {
        "operationId": "sitesDomainsRemove",
        "summary": "Remove a domain from a site",
        "description": "Disconnects a domain from the site: the site stops answering on it, and if it was the primary domain the site moves back to its built-in address. The built-in address can't be removed. To use the domain again, connect it again.",
        "tags": [
          "Site domains"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "description": "The domain's id, from the site's list of domains.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. There's no answer body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "400": {
            "description": "`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nawait rf.sites.domains.remove({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  domainId: \"d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80\",\n});"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/domains/d5e6f7a8-b9c0-4d1e-8f2a-3b4c5d6e7f80\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()"
          }
        ]
      }
    },
    "/site-domains": {
      "get": {
        "operationId": "siteDomainsList",
        "summary": "List the domains of every site",
        "description": "Lists every domain connected to the account's sites, built-in addresses included, newest first. A token limited to some servers sees only the domains of the sites on those. Filter by `siteId` or `status`; sort by `createdAt` or `hostname`.",
        "tags": [
          "Site domains"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "hostname"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "siteId",
            "in": "query",
            "required": false,
            "description": "Only the domains of this site.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only domains with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "pending_dns",
                "provisioning",
                "active",
                "failed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SiteDomain"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/site-domains?status=pending_dns\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/site-domains?status=pending_dns\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.siteDomains.list({ status: \"pending_dns\" })) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/site-domains?status=pending_dns');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/site-domains\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"status\": \"pending_dns\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cdn": {
      "get": {
        "operationId": "sitesCdnGet",
        "summary": "Get a site's CDN",
        "description": "Returns the site's CDN: whether it's on (`status`, and `stage` while it's being set up), why it can't be switched on if it can't (`blockedReason`), its address, what it served over the last 7 days, what it serves, and its custom hostname. Poll it to follow a change in progress.",
        "tags": [
          "CDN"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cdn.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cdn/actions/enable": {
      "post": {
        "operationId": "sitesCdnEnable",
        "summary": "Turn on a site's CDN",
        "description": "Switches on the CDN included with the site's server: no DNS changes and no plugin to set up, and logins, carts and forms keep working as before.\n\n**What happens next.** The answer is `202` with `status: \"enabling\"`. Setting it up usually takes 3 to 10 minutes (`stage`: `creating`, `deploying`, `verifying`, then `installing`); poll `GET /sites/{siteId}/cdn` every 30 seconds until `status` is `active`, when the site's files are served from `domain`. If it fails, `status` is `failed` with the reason in `lastError`: calling this again carries on where it stopped. A CDN that's already on answers `200` as it is.\n\n**Limits.** Not for staging copies, sites still installing, sites on your own servers or trial servers, or while the server is off: `blockedReason` on the CDN says which (`409 cdn_blocked`). Switching it on and off is limited to 6 times an hour per site. Setting it up from the start (a site's first time, or after a setup that failed at its first step) is limited to 5 sites a day per account (`429 rate_limited`; a day ends at 00:00 UTC); switching it back on within 48 hours of switching it off isn't counted.",
        "tags": [
          "CDN"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`cdn_blocked`: The CDN can't be switched on for this site right now. The CDN's `blockedReason` says why.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`cdn_unavailable`: The CDN isn't available right now.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/enable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/enable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cdn.enable({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/enable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/enable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cdn/actions/disable": {
      "post": {
        "operationId": "sitesCdnDisable",
        "summary": "Turn off a site's CDN",
        "description": "Switches the site back to serving every file itself, straight away, and removes its custom hostname. Pages keep working throughout, and the CDN can be switched on again at any time. The server must be running when the CDN was on (the site's pages change on it). Switching it on and off is limited to 6 times an hour per site.",
        "tags": [
          "CDN"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cdn.disable({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cdn/actions/purge": {
      "post": {
        "operationId": "sitesCdnPurge",
        "summary": "Clear files from a site's CDN",
        "description": "Clears files from the CDN, so visitors get their latest version. Usually there's nothing to clear: WordPress gives updated plugin and theme files new addresses, and files changed in the panel's File Manager are cleared for you. Clear after replacing a file but keeping its name.\n\nSend no body (or `{}`) to clear everything. Send `paths` to clear only those files and folders (one of the delivery options: `403 feature_unavailable` while they aren't open to the account).\n\n**What happens next.** The answer is `202` with `purging: true`; clearing takes a minute or two, then `purging` is false again and `purgedAt` is set. The CDN must be on (`409 cdn_off`). Up to 10 clears an hour per site.",
        "tags": [
          "CDN"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CdnPurgeInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`cdn_off`: The site's CDN isn't on, and this needs it.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/purge\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"paths\": [\n    \"/wp-content/themes/shop/style.css\",\n    \"/wp-content/uploads/2026/11/*\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/purge\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"paths\": [\n      \"/wp-content/themes/shop/style.css\",\n      \"/wp-content/uploads/2026/11/*\"\n    ]\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cdn.purge({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  paths: [\n    \"/wp-content/themes/shop/style.css\",\n    \"/wp-content/uploads/2026/11/*\",\n  ],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/purge');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'paths' => [\n            '/wp-content/themes/shop/style.css',\n            '/wp-content/uploads/2026/11/*',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/actions/purge\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"paths\": [\n            \"/wp-content/themes/shop/style.css\",\n            \"/wp-content/uploads/2026/11/*\",\n        ],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cdn/settings": {
      "put": {
        "operationId": "sitesCdnUpdateSettings",
        "summary": "Choose what a site's CDN serves",
        "description": "Sets the kinds of files the CDN serves (`types`) and the paths it leaves on the server (`exclude`), for example for a plugin that only works from the site's own address. Both replace what was there.\n\nWhile the CDN is on, the site uses the new settings straight away (its server must be running); while it's off, they apply when it's switched on. One of the delivery options: while they aren't open to the account (`deliveryOptions: false`), it answers `403 feature_unavailable`.",
        "tags": [
          "CDN"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CdnSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/settings\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"types\": [\n    \"images\",\n    \"css\",\n    \"js\",\n    \"fonts\"\n  ],\n  \"exclude\": [\n    \"/wp-content/plugins/booking-calendar/\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/settings\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"types\": [\n      \"images\",\n      \"css\",\n      \"js\",\n      \"fonts\"\n    ],\n    \"exclude\": [\n      \"/wp-content/plugins/booking-calendar/\"\n    ]\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cdn.updateSettings({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  types: [\"images\", \"css\", \"js\", \"fonts\"],\n  exclude: [\"/wp-content/plugins/booking-calendar/\"],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/settings');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'types' => [\n            'images',\n            'css',\n            'js',\n            'fonts',\n        ],\n        'exclude' => [\n            '/wp-content/plugins/booking-calendar/',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/settings\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"types\": [\n            \"images\",\n            \"css\",\n            \"js\",\n            \"fonts\",\n        ],\n        \"exclude\": [\n            \"/wp-content/plugins/booking-calendar/\",\n        ],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cdn/hostname": {
      "put": {
        "operationId": "sitesCdnHostnameSet",
        "summary": "Add a custom hostname to a site's CDN",
        "description": "Serves the site's files from a hostname of your own, like cdn.example.com, instead of the CDN's own address. Use a name that isn't used for anything else yet. The CDN must be on (`409 cdn_off`), and a site has one hostname: remove it first to use another (`409 hostname_exists`). A failed one is replaced. Sending the hostname the site already has, while it's being set up or in use, changes nothing: the answer is `200` with the CDN as it is.\n\n**What happens next.** The answer is `202` with `customHostname.status: \"validating\"` and the DNS records to add, in `customHostname.records`: one proves the hostname is yours (for its SSL certificate; it appears a few seconds after this call), one sends its visitors to the CDN. When the hostname's domain is registered with Rabbitflare and uses Rabbitflare DNS (`customHostname.dnsZone`), add them in the panel, on the domain's DNS page. Once they're in place, setup usually takes a few minutes; poll `GET /sites/{siteId}/cdn` until `customHostname.status` is `active`.\n\n**Limits.** Up to 5 hostnames an hour per site, and 5 a day per account (`429 rate_limited`; a day ends at 00:00 UTC). Hostnames added through the API also share a daily limit for all accounts together: when it's reached, the answer is `429 rate_limited` with the seconds to wait until the day ends. One of the delivery options: while they aren't open to the account (`deliveryOptions: false`), it answers `403 feature_unavailable`.",
        "tags": [
          "CDN"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CdnHostnameInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`cdn_off`: The site's CDN isn't on, and this needs it.\n\n`hostname_exists`: The site's CDN already has a custom hostname.\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`cdn_error`: The CDN didn't accept the change just now.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`cdn_limit`: Custom CDN hostnames can't be added right now.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"hostname\": \"cdn.example.com\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"hostname\": \"cdn.example.com\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cdn.hostname.set({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  hostname: \"cdn.example.com\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'hostname' => 'cdn.example.com',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"hostname\": \"cdn.example.com\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "delete": {
        "operationId": "sitesCdnHostnameRemove",
        "summary": "Remove a site's custom CDN hostname",
        "description": "Switches the site back to the CDN's own address straight away (its server must be running while the hostname is in use); the hostname and its certificate are removed in the background (`customHostname.status: \"removing\"`, then null). Its DNS records can be deleted afterwards. With no hostname, the CDN comes back as it is. One of the delivery options: while they aren't open to the account (`deliveryOptions: false`), it answers `403 feature_unavailable`.",
        "tags": [
          "CDN"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cdn.hostname.remove({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cdn/hostname/actions/check": {
      "post": {
        "operationId": "sitesCdnHostnameCheck",
        "summary": "Check a custom CDN hostname's DNS now",
        "description": "Looks for the custom hostname's DNS records now, instead of at the setup's next scheduled check (for example straight after adding them). The setup then carries on by itself; follow it on `GET /sites/{siteId}/cdn`. A hostname whose setup failed can't be checked again (`409 hostname_failed`): remove it and add it again. With no hostname being set up, the CDN comes back as it is. Up to 30 checks an hour per site. One of the delivery options: while they aren't open to the account (`deliveryOptions: false`), it answers `403 feature_unavailable`.",
        "tags": [
          "CDN"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteCdn"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`hostname_failed`: Setting up the custom CDN hostname failed, so it can't be checked again.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname/actions/check\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname/actions/check\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cdn.hostname.check({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname/actions/check');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cdn/hostname/actions/check\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/firewall": {
      "get": {
        "operationId": "sitesFirewallGet",
        "summary": "Get a site's firewall",
        "description": "Returns the site's firewall: its mode, sensitivity and login protection, whether its settings are in place on the server (`status`), and its allowed and blocked addresses and exceptions (`rules`).\n\n**On a server with Imunify360 on** (the server's `security.status`), the web application firewall's rules are Imunify360's, in place of Rabbitflare's own for every site there. `mode` still decides whether the site's requests are checked and whether attacks are blocked; `sensitivity` has no effect until Imunify360 is off. Allowed and blocked addresses and login protection keep working, but an address the server's own lists block (`servers.security.addresses.list`) is blocked for every site, whatever this list allows. Exceptions still turn rules off for the site's pages, by the numbers `sites.firewall.events.list` shows (Imunify360's there); `servers.security.rules.disable` turns a rule off for whole sites. The events keep listing the site's blocked and flagged requests; `servers.security.incidents.get` has the server's wider view (its address lists, denial of service, bots, WordPress).",
        "tags": [
          "Firewall"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteFirewall"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.firewall.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "put": {
        "operationId": "sitesFirewallUpdate",
        "summary": "Change a site's firewall settings",
        "description": "Changes the firewall's mode (`protect`, `monitor` or `off`), its sensitivity (`standard` or `strict`) and login protection. Settings left out stay as they are. To try Protect safely, run the site in `monitor` for a day or two first: nothing is blocked, and the events show what Protect would have stopped.\n\n**What happens next.** The answer is the firewall with `status: \"applying\"` (or `installing` while the firewall is first set up on the server, a few minutes): the change reaches the server within seconds, then `status` is `active`. If it fails, `status` is `failed`: apply it again with `POST /sites/{siteId}/firewall/actions/apply`. Up to 60 changes a minute per account.\n\nThe site must be live and its server running.",
        "tags": [
          "Firewall"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FirewallSettingsInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteFirewall"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"mode\": \"protect\",\n  \"sensitivity\": \"standard\",\n  \"loginProtection\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"mode\": \"protect\",\n    \"sensitivity\": \"standard\",\n    \"loginProtection\": true\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.firewall.update({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  mode: \"protect\",\n  sensitivity: \"standard\",\n  loginProtection: true,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'mode' => 'protect',\n        'sensitivity' => 'standard',\n        'loginProtection' => true,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"mode\": \"protect\",\n        \"sensitivity\": \"standard\",\n        \"loginProtection\": True,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/firewall/addresses": {
      "post": {
        "operationId": "sitesFirewallAddressesAdd",
        "summary": "Allow or block an IP address on a site",
        "description": "Adds an IP address or range to the site's blocked addresses (`kind: \"block\"`: refused on every page of the site, whatever the mode) or allowed addresses (`kind: \"allow\"`: its requests skip the firewall's checks; only for addresses you trust, like your office). A range is stored from its first address (203.0.113.7/24 is 203.0.113.0/24).\n\nThe answer is `201` with the firewall. `Location` is the new rule's path, `/v1/sites/{siteId}/firewall/rules/{ruleId}`: its id is the rule's `id` in `rules`, and `DELETE` there removes it. The answer is the firewall with `status: \"applying\"` (or `installing` while the firewall is first set up on the server, a few minutes): the change reaches the server within seconds, then `status` is `active`. If it fails, `status` is `failed`: apply it again with `POST /sites/{siteId}/firewall/actions/apply`. Up to 60 changes a minute per account.\n\n**Limits.** Up to 500 blocked and 100 allowed addresses per site. An address can be on the lists once (`409 conflict`), and the server's own addresses can't be blocked (`409 own_address`): WordPress needs to reach itself for its health checks and the theme editor.",
        "tags": [
          "Firewall"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FirewallAddressInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteFirewall"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`own_address`: That address is one of your own, which can't be used here: a site's firewall can't block its server's own IP address (WordPress needs to reach itself), and the account's own email addresses can't be changed.\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`invalid_address`: The IP address or range isn't valid.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/addresses\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"kind\": \"block\",\n  \"address\": \"198.51.100.0/24\",\n  \"note\": \"Login attempts from a scanner\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/addresses\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"kind\": \"block\",\n    \"address\": \"198.51.100.0/24\",\n    \"note\": \"Login attempts from a scanner\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.firewall.addresses.add({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  kind: \"block\",\n  address: \"198.51.100.0/24\",\n  note: \"Login attempts from a scanner\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/addresses');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'kind' => 'block',\n        'address' => '198.51.100.0/24',\n        'note' => 'Login attempts from a scanner',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/addresses\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"kind\": \"block\",\n        \"address\": \"198.51.100.0/24\",\n        \"note\": \"Login attempts from a scanner\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/firewall/exceptions": {
      "post": {
        "operationId": "sitesFirewallExceptionsAdd",
        "summary": "Add a firewall exception for a false alarm",
        "description": "Turns off firewall rules that stopped something you or a plugin did on purpose (a false alarm), like saving a page in a page builder: name the rules by number, as the event's `matchedRules` lists them (`GET /sites/{siteId}/firewall/events`). With `path`, only on that page and the pages under it (the safest choice; the rest of the site stays fully protected); without, everywhere on the site.\n\nThe answer is `201` with the firewall. `Location` is the new rule's path, `/v1/sites/{siteId}/firewall/rules/{ruleId}`: its id is the rule's `id` in `rules`, and `DELETE` there removes it. The answer is the firewall with `status: \"applying\"` (or `installing` while the firewall is first set up on the server, a few minutes): the change reaches the server within seconds, then `status` is `active`. If it fails, `status` is `failed`: apply it again with `POST /sites/{siteId}/firewall/actions/apply`. Up to 60 changes a minute per account.\n\n**Limits.** Up to 30 exceptions per site; the same exception can't be added twice (`409 conflict`).",
        "tags": [
          "Firewall"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FirewallExceptionInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteFirewall"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/exceptions\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"ruleIds\": [\n    942270,\n    942360\n  ],\n  \"path\": \"/wp-admin/admin-ajax.php\",\n  \"note\": \"Page builder saves\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/exceptions\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"ruleIds\": [\n      942270,\n      942360\n    ],\n    \"path\": \"/wp-admin/admin-ajax.php\",\n    \"note\": \"Page builder saves\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.firewall.exceptions.add({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  ruleIds: [942270, 942360],\n  path: \"/wp-admin/admin-ajax.php\",\n  note: \"Page builder saves\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/exceptions');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'ruleIds' => [\n            942270,\n            942360,\n        ],\n        'path' => '/wp-admin/admin-ajax.php',\n        'note' => 'Page builder saves',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/exceptions\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"ruleIds\": [\n            942270,\n            942360,\n        ],\n        \"path\": \"/wp-admin/admin-ajax.php\",\n        \"note\": \"Page builder saves\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/firewall/rules/{ruleId}": {
      "delete": {
        "operationId": "sitesFirewallRulesDelete",
        "summary": "Remove an address or exception from a firewall",
        "description": "Removes an allowed or blocked address, or an exception, from the site's firewall; the answer is the firewall without it. The answer is the firewall with `status: \"applying\"` (or `installing` while the firewall is first set up on the server, a few minutes): the change reaches the server within seconds, then `status` is `active`. If it fails, `status` is `failed`: apply it again with `POST /sites/{siteId}/firewall/actions/apply`. Up to 60 changes a minute per account.",
        "tags": [
          "Firewall"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "description": "The rule's id, from the firewall's `rules`.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteFirewall"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/rules/f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/rules/f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.firewall.rules.delete({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  ruleId: \"f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/rules/f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/rules/f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/firewall/actions/apply": {
      "post": {
        "operationId": "sitesFirewallApply",
        "summary": "Apply a site's firewall settings again",
        "description": "Sends the firewall's current settings and rules to the site's server again: the way to try again after `status` is `failed` (the reason is in `lastError`). The answer is `202` with `status: \"applying\"` (or `installing`); follow it on `GET /sites/{siteId}/firewall`. The site must be live and its server running. Up to 60 changes a minute per account.",
        "tags": [
          "Firewall"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteFirewall"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/actions/apply\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/actions/apply\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.firewall.apply({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/actions/apply');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/actions/apply\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/firewall/events": {
      "get": {
        "operationId": "sitesFirewallEventsList",
        "summary": "List the requests a site's firewall stopped",
        "description": "Lists the latest requests the site's firewall blocked or flagged, newest first: up to 100 of each, with the address they came from, the page they asked for, the kind of attack and the rules they matched. Filter by `blocked`. Flagged requests are the ones Monitor mode let through.\n\nThey're read from the site's server (kept 20 seconds), so this can take a few seconds; when the server can't be reached it answers `502 server_unreachable`. Up to 30 reads a minute per account.",
        "tags": [
          "Firewall"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "occurredAt"
              ],
              "default": "occurredAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "blocked",
            "in": "query",
            "required": false,
            "description": "`true`: only blocked requests. `false`: only flagged ones.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FirewallEvent"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/events?blocked=true\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/events?blocked=true\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.sites.firewall.events.list({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  blocked: true,\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/events?blocked=true');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/events\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"blocked\": \"true\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/protection": {
      "get": {
        "operationId": "sitesProtectionGet",
        "summary": "Get a site's Cloudflare protection",
        "description": "Returns the site's Cloudflare protection: whether it's on, the site's name at Cloudflare (`edge`), and each of its domains with where it stands and the DNS record that sends it through Cloudflare.\n\nWho changes a domain's DNS depends on where it is (`dnsBy`): Rabbitflare switches domains bought from Rabbitflare, and domains whose DNS is in a Cloudflare account you connected to Rabbitflare; for any other, set its `record` at its DNS company once its status is `ready`. Poll it to follow a change: what Rabbitflare knows about each domain's DNS is brought up to date in the background.\n\n**Deprecated** since 2026-11-28: Cloudflare protection was removed from Rabbitflare on 28 November 2026: this operation answers `403 feature_unavailable` for every site, and goes in v2.",
        "tags": [
          "Cloudflare protection"
        ],
        "deprecated": true,
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.protection.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "put": {
        "operationId": "sitesProtectionUpdate",
        "summary": "Turn a site's Cloudflare protection on or off",
        "description": "Turns Cloudflare protection on (`on: true`) or off (`on: false`). Turning it on needs a live site with its SSL certificate, its server running, and a domain of your own as its primary domain (`409 needs_domain`); not for staging copies.\n\n**What happens next.** The answer is `202` with `status: \"applying\"`. Turning on: the site's domains are added to Cloudflare, which checks each one and makes its certificate while the site keeps answering as before; each domain then goes through Cloudflare once its DNS points at `edge` (see `domains`). An hour after a domain starts coming through Cloudflare, the server refuses visitors who skip Cloudflare on it. Turning off takes up to 15 minutes; domains still pointed at `edge` keep working (`stillPointed`). If it fails, `status` is `failed` with the reason in `error`: send the same again to retry. Asking for what's already in place answers `200` as it is.\n\nUp to 30 changes a minute per account.\n\n**Deprecated** since 2026-11-28: Cloudflare protection was removed from Rabbitflare on 28 November 2026: this operation answers `403 feature_unavailable` for every site, and goes in v2.",
        "tags": [
          "Cloudflare protection"
        ],
        "deprecated": true,
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProtectionSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"on\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"on\": true\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.protection.update({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  on: true,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'on' => true,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"on\": True,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/protection/events": {
      "get": {
        "operationId": "sitesProtectionEventsList",
        "summary": "List requests Cloudflare stopped on a site",
        "description": "Lists the requests Cloudflare blocked or challenged on the site's protected domains over the last 24 hours, newest first (up to 200), with what stopped each one. Empty while protection is off.\n\nThey're read from Cloudflare (kept 30 seconds); when its log can't be read just now it answers `502 bad_gateway`: try again in a minute.\n\n**Deprecated** since 2026-11-28: Cloudflare protection was removed from Rabbitflare on 28 November 2026: this operation answers `403 feature_unavailable` for every site, and goes in v2.",
        "tags": [
          "Cloudflare protection"
        ],
        "deprecated": true,
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "occurredAt"
              ],
              "default": "occurredAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProtectionEvent"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`bad_gateway`: Something on our side didn't answer properly.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection/events\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection/events\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.sites.protection.events.list({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection/events');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection/events\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security": {
      "get": {
        "operationId": "serversSecurityGet",
        "summary": "Get a server's security",
        "description": "Returns Imunify360 on the server: whether it's on (`status`) and can run there (`available`), each site's malware protection and what it costs, the server's figures, its settings, ports, rules turned off, recent scans, KernelCare, blacklist checks, the WordPress plugin, and the search engines its bot checks let through.\n\nIt answers at once with the figures kept (`checkedAt` says when they're from); when they're over 30 seconds old, newer ones are fetched from the server in the background (`refreshing` is true): read again in a few seconds. The address lists and the attacks of the last 24 hours have operations of their own (`GET /servers/{serverId}/security/addresses`, `…/incidents`); a site's threats are `GET /sites/{siteId}/malware-protection/threats`.\n\nThe panel's own limit applies too: 120 looks a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.get({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/actions/enable": {
      "post": {
        "operationId": "serversSecurityEnable",
        "summary": "Turn on a server's security",
        "description": "Turns Imunify360 on for the server. It's free: Imunify360 comes with servers Rabbitflare creates (Intel or AMD processors, 2 GB of memory or more), and the server's oldest site gets malware protection included (unless a site has it already). It uses about 300 MB of the server's memory, and its web application firewall rules take the place of Rabbitflare's own for the server's sites.\n\n**What happens next.** The answer is `202` with `status: \"installing\"`. A few minutes later it's `on` (`server.security_enabled`), or `failed` (`server.security_failed`; turn it on again to retry). Sent again while it's still installing, it answers `202` again; `200` once it's on.\n\n**Refusals.** `409 not_supported` when the server can't run it (`available: false` says why), `409 busy` while it's being turned off. After a failure, sites that had malware protection keep it, so turning it back on would restart each extra site's charge ($2.99 a month): while more than one site has it, the API refuses that (`409 invalid_state`): do it in the panel, or turn it off for the server.\n\nThe panel's own limit applies too: 10 switches a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_supported`: The server's cloud doesn't offer this (for example, whole-server snapshots on Amazon EC2 and Google Cloud), or the server's kind or size doesn't allow it (Imunify360 on a server of your own, or under 2 GB of memory).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/enable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/enable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.enable({ serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/enable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/enable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/actions/disable": {
      "post": {
        "operationId": "serversSecurityDisable",
        "summary": "Turn off a server's security",
        "description": "Turns Imunify360 off for the server. Every site's malware protection goes off with it (their charges end), and the server's address lists, ports, rules turned off, settings and the copies kept for undoing clean-ups are removed. The sites' web application firewalls go back to Rabbitflare's own rules.\n\n**What happens next.** The answer is `202` with `status: \"removing\"`, then `server.security_disabled` (or `server.security_failed`). Sent again while it's still being removed, it answers `202` again; `200` once it's off. It's never turned on again by itself: `…/actions/enable` turns it on.\n\nThe panel's own limit applies too: 10 switches a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.disable({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/settings": {
      "patch": {
        "operationId": "serversSecurityUpdateSettings",
        "summary": "Change a server's security settings",
        "description": "Changes Imunify360's settings on the server: malware scanning and what happens to what it finds, denial-of-service and password-guessing protection, intrusion detection, the port list's mode, the web application firewall's rules, bot checks, daily blacklist checks, and which emails the account's owner gets. Settings left out stay as they are; at least one is needed (`422`).\n\nThe answer is the server's security with the change in it (its figures asked for again). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 60 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServerSecuritySettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/settings\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"cleanMode\": \"alert\",\n  \"scanInterval\": \"week\",\n  \"scanDay\": 0,\n  \"alerts\": {\n    \"cleaned\": false\n  }\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/settings\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"cleanMode\": \"alert\",\n    \"scanInterval\": \"week\",\n    \"scanDay\": 0,\n    \"alerts\": {\n      \"cleaned\": false\n    }\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.updateSettings({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  cleanMode: \"alert\",\n  scanInterval: \"week\",\n  scanDay: 0,\n  alerts: {\n    cleaned: false,\n  },\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/settings');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'cleanMode' => 'alert',\n        'scanInterval' => 'week',\n        'scanDay' => 0,\n        'alerts' => [\n            'cleaned' => false,\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/settings\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"cleanMode\": \"alert\",\n        \"scanInterval\": \"week\",\n        \"scanDay\": 0,\n        \"alerts\": {\n            \"cleaned\": False,\n        },\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/addresses": {
      "get": {
        "operationId": "serversSecurityAddressesList",
        "summary": "List a server's allowed and blocked addresses",
        "description": "Lists the addresses, ranges and countries on the server's lists: `allow` (never blocked), `block` (refused by every site on the server, whatever a site's own firewall allows) and `challenge` (a CAPTCHA first). Imunify360 adds some itself (`automatic`), most for a day. The server keeps at most 1000; the list is empty while Imunify360 isn't on.\n\nThe panel's own limit applies too: 120 looks a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "addedAt",
                "key"
              ],
              "default": "addedAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Only this list: `allow`, `block` or `challenge`.",
            "schema": {
              "type": "string",
              "enum": [
                "allow",
                "block",
                "challenge"
              ]
            }
          },
          {
            "name": "automatic",
            "in": "query",
            "required": false,
            "description": "`true`: only entries Imunify360 added itself. `false`: only yours.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SecurityAddress"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses?kind=block\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses?kind=block\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.servers.security.addresses.list({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  kind: \"block\",\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses?kind=block');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"kind\": \"block\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "serversSecurityAddressesAdd",
        "summary": "Allow, block or challenge an address on a server",
        "description": "Adds an IP address or range, or a whole country, to one of the server's lists: `allow`, `block` or `challenge` (addresses only). It applies to every site on the server. With `expiresInMinutes` it comes off by itself.\n\nThe answer is `201` with the server's security. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 60 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityAddressInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"kind\": \"block\",\n  \"ip\": \"185.191.171.0/24\",\n  \"comment\": \"SSH password guessing\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"kind\": \"block\",\n    \"ip\": \"185.191.171.0/24\",\n    \"comment\": \"SSH password guessing\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.addresses.add({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  kind: \"block\",\n  ip: \"185.191.171.0/24\",\n  comment: \"SSH password guessing\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'kind' => 'block',\n        'ip' => '185.191.171.0/24',\n        'comment' => 'SSH password guessing',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"kind\": \"block\",\n        \"ip\": \"185.191.171.0/24\",\n        \"comment\": \"SSH password guessing\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/addresses/actions/remove": {
      "post": {
        "operationId": "serversSecurityAddressesRemove",
        "summary": "Take an address off a server's list",
        "description": "Takes an entry off one of the server's lists, by its `kind` and `key` (in the body: a range's key has a `/`).\n\nThe answer is the server's security with the change in it (its figures asked for again). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 60 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityAddressRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses/actions/remove\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"kind\": \"block\",\n  \"key\": \"185.191.171.0/24\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses/actions/remove\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"kind\": \"block\",\n    \"key\": \"185.191.171.0/24\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.addresses.remove({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  kind: \"block\",\n  key: \"185.191.171.0/24\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses/actions/remove');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'kind' => 'block',\n        'key' => '185.191.171.0/24',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses/actions/remove\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"kind\": \"block\",\n        \"key\": \"185.191.171.0/24\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/addresses/actions/move": {
      "post": {
        "operationId": "serversSecurityAddressesMove",
        "summary": "Move an address to another of a server's lists",
        "description": "Moves an entry from one of the server's lists to another, keeping its note: to block an address Imunify360 only challenged, for example. A country can't go to `challenge`.\n\nThe answer is the server's security with the change in it (its figures asked for again). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 60 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityAddressMoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses/actions/move\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"key\": \"45.146.165.10\",\n  \"from\": \"challenge\",\n  \"to\": \"block\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses/actions/move\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"key\": \"45.146.165.10\",\n    \"from\": \"challenge\",\n    \"to\": \"block\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.addresses.move({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  key: \"45.146.165.10\",\n  from: \"challenge\",\n  to: \"block\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses/actions/move');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'key' => '45.146.165.10',\n        'from' => 'challenge',\n        'to' => 'block',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/addresses/actions/move\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"key\": \"45.146.165.10\",\n        \"from\": \"challenge\",\n        \"to\": \"block\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/ports": {
      "post": {
        "operationId": "serversSecurityPortsAdd",
        "summary": "Add a port to a server's port list",
        "description": "Adds a port to the server's port list: closed while `settings.portsMode` is `open_except`, open while it's `closed_except`. TCP ports 22, 22022, 80 and 443 always stay open (`422`): Rabbitflare reaches the server through them, and visitors the sites.\n\nThe answer is `201` with the server's security. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 60 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityPortInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/ports\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"port\": 3306,\n  \"protocol\": \"tcp\",\n  \"comment\": \"Database: only the office\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/ports\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"port\": 3306,\n    \"protocol\": \"tcp\",\n    \"comment\": \"Database: only the office\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.ports.add({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  port: 3306,\n  protocol: \"tcp\",\n  comment: \"Database: only the office\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/ports');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'port' => 3306,\n        'protocol' => 'tcp',\n        'comment' => 'Database: only the office',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/ports\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"port\": 3306,\n        \"protocol\": \"tcp\",\n        \"comment\": \"Database: only the office\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/ports/{protocol}/{port}": {
      "delete": {
        "operationId": "serversSecurityPortsRemove",
        "summary": "Take a port off a server's port list",
        "description": "Takes a port off the server's port list.\n\nThe answer is the server's security with the change in it (its figures asked for again). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 60 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "protocol",
            "in": "path",
            "required": true,
            "description": "`tcp` or `udp`.",
            "schema": {
              "type": "string",
              "enum": [
                "tcp",
                "udp"
              ]
            }
          },
          {
            "name": "port",
            "in": "path",
            "required": true,
            "description": "The port, 1 to 65535.",
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,4}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/ports/tcp/3306\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/ports/tcp/3306\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.ports.remove({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  protocol: \"tcp\",\n  port: \"3306\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/ports/tcp/3306');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/ports/tcp/3306\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/incidents": {
      "get": {
        "operationId": "serversSecurityIncidentsGet",
        "summary": "Get the attacks stopped on a server",
        "description": "Returns the attacks Imunify360 stopped (or only logged) on the server in the last 24 hours, newest first: web application firewall rules, attacks the WordPress plugin stopped inside a site, password guessing, denial of service, bots, port scans and addresses known for attacks. The server keeps at most 500. They aren't paged: an incident's id isn't kept from one look to the next, so look again for newer ones.\n\nA site's own are also in `GET /sites/{siteId}/malware-protection` (`incidents`), for a token with `sites:read`.\n\nThe panel's own limit applies too: 120 looks a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "siteId",
            "in": "query",
            "required": false,
            "description": "Only attacks on this site.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Only this kind of attack.",
            "schema": {
              "type": "string",
              "enum": [
                "waf",
                "wordpress",
                "brute_force",
                "dos",
                "bot",
                "port_scan",
                "blocklist",
                "malware",
                "other"
              ]
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "description": "Only this severity.",
            "schema": {
              "type": "string",
              "enum": [
                "critical",
                "high",
                "medium",
                "low"
              ]
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "description": "Only what Imunify360 did this: `blocked`, `challenged` or `logged`.",
            "schema": {
              "type": "string",
              "enum": [
                "blocked",
                "challenged",
                "logged"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurityIncidents"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/incidents?action=challenged\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/incidents?action=challenged\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.incidents.get({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  action: \"challenged\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/incidents?action=challenged');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/incidents\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"action\": \"challenged\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/actions/scan": {
      "post": {
        "operationId": "serversSecurityScan",
        "summary": "Scan a server's sites for malware",
        "description": "Scans every site of the server with malware protection on, now: their files, and their databases with `database: true`. What's found shows in each site's threats, and as `malware.found` or `malware.cleaned` events. One site alone: `POST /sites/{siteId}/malware-protection/actions/scan`.\n\nThe answer is `202` with the server's security (the scan in `scans`). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running. At least one site needs malware protection on (`409 malware_protection_off`).\n\n**A long request.** The answer waits for the server to finish, up to 8 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 10 scans a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityScanInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`malware_protection_off`: Malware protection is off for the site (or, for a server-wide change, for the sites it needs).\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/scan\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"database\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/scan\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"database\": true\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.scan({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  database: true,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/scan');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'database' => true,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/scan\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"database\": True,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/rules/actions/disable": {
      "post": {
        "operationId": "serversSecurityRulesDisable",
        "summary": "Turn off a security rule for false alarms",
        "description": "Turns a rule off that stops something a site needs, named by `ruleId` in the body: a web application firewall rule by its number, or a WordPress plugin rule by its name (an incident's `ruleId`, or a firewall event's rule). With `siteIds` it's off for those sites only (each needs malware protection on: `409 malware_protection_off`); without, for every site on the server. `servers.security.rules.enable` turns it back on.\n\nThe answer is the server's security with the change in it (its figures asked for again). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityRuleDisableInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`malware_protection_off`: Malware protection is off for the site (or, for a server-wide change, for the sites it needs).\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/rules/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"ruleId\": \"77350218\",\n  \"siteIds\": [\n    \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\"\n  ],\n  \"note\": \"Turned off for the shop'\\''s page builder\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/rules/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"ruleId\": \"77350218\",\n    \"siteIds\": [\n      \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\"\n    ],\n    \"note\": \"Turned off for the shop's page builder\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.rules.disable({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  ruleId: \"77350218\",\n  siteIds: [\"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\"],\n  note: \"Turned off for the shop's page builder\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/rules/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'ruleId' => '77350218',\n        'siteIds' => [\n            '8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d',\n        ],\n        'note' => 'Turned off for the shop\\'s page builder',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/rules/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"ruleId\": \"77350218\",\n        \"siteIds\": [\n            \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n        ],\n        \"note\": \"Turned off for the shop's page builder\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/rules/actions/enable": {
      "post": {
        "operationId": "serversSecurityRulesEnable",
        "summary": "Turn a security rule back on",
        "description": "Turns a rule back on (`ruleId` in the body, as `disabledRules` names it), everywhere it was off: for every site it was turned off for, or the whole server. A WordPress plugin rule that isn't off on the server (see `disabledRules`) is `404`; a web application firewall rule is passed to the server as it is: one that isn't off changes nothing, or the server refuses it (`422 security_refused`).\n\nThe answer is the server's security with the change in it (its figures asked for again). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityRuleEnableInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/rules/actions/enable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"ruleId\": \"77350218\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/rules/actions/enable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"ruleId\": \"77350218\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.rules.enable({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  ruleId: \"77350218\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/rules/actions/enable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'ruleId' => '77350218',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/rules/actions/enable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"ruleId\": \"77350218\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/kernel-patching/actions/enable": {
      "post": {
        "operationId": "serversSecurityKernelPatchingEnable",
        "summary": "Install KernelCare on a server",
        "description": "Installs KernelCare: the server's kernel gets security patches without a restart. It's free with Imunify360.\n\nThe answer is `202` with the server's security while `kernelPatching.status` is `installing`, `200` once it's `installed`. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\n**A long request.** The answer waits for the server to finish, up to 13 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 10 switches a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/kernel-patching/actions/enable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/kernel-patching/actions/enable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.kernelPatching.enable({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/kernel-patching/actions/enable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/kernel-patching/actions/enable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/kernel-patching/actions/disable": {
      "post": {
        "operationId": "serversSecurityKernelPatchingDisable",
        "summary": "Remove KernelCare from a server",
        "description": "Removes KernelCare from the server: its kernel then gets security patches only with a restart.\n\nThe answer is the server's security with the change in it (its figures asked for again). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\n**A long request.** The answer waits for the server to finish, up to 13 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 10 switches a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/kernel-patching/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/kernel-patching/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.kernelPatching.disable({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/kernel-patching/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/kernel-patching/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/reputation/actions/check": {
      "post": {
        "operationId": "serversSecurityReputationCheck",
        "summary": "Check a server's domains against blacklists",
        "description": "Starts a check of the server's sites' domains against blacklists, now (it also runs daily while `settings.reputation` is on). Results show within the hour: watch `reputation.checkedAt`. A domain newly on a blacklist sends `malware.warning`.\n\nThe answer is `202` with the server's security as it is. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 5 checks a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/reputation/actions/check\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/reputation/actions/check\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.reputation.check({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/reputation/actions/check');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/reputation/actions/check\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/wordpress-plugin/actions/enable": {
      "post": {
        "operationId": "serversSecurityWordpressPluginEnable",
        "summary": "Turn on Imunify360's WordPress plugin",
        "description": "Turns Imunify360's WordPress plugin (Imunify Security) on for the server: it goes onto every site with malware protection on, one after another (about a minute each), and onto each site that gets malware protection later. Inside each site it stops attacks on known holes in WordPress, its plugins and themes, and limits AI bots. `PATCH /sites/{siteId}/malware-protection/wordpress-plugin` changes it per site.\n\nThe answer is `202` with the server's security (each site's `status` is `adding` until it's in). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\n**A long request.** The answer waits for the server to finish, up to 8 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 10 switches a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/wordpress-plugin/actions/enable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/wordpress-plugin/actions/enable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.wordpressPlugin.enable({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/wordpress-plugin/actions/enable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/wordpress-plugin/actions/enable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/wordpress-plugin/actions/disable": {
      "post": {
        "operationId": "serversSecurityWordpressPluginDisable",
        "summary": "Turn off Imunify360's WordPress plugin",
        "description": "Turns Imunify360's WordPress plugin off for the server: it's taken off every site, with its data (its settings in each site).\n\nThe answer is `202` with the server's security. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\n**A long request.** The answer waits for the server to finish, up to 8 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 10 switches a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/wordpress-plugin/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/wordpress-plugin/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.wordpressPlugin.disable({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/wordpress-plugin/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/wordpress-plugin/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/crawlers": {
      "post": {
        "operationId": "serversSecurityCrawlersAdd",
        "summary": "Let a search engine through a server's bot checks",
        "description": "Adds a search engine the bot checks always let through: a visitor whose address's name ends with one of `domains` (checked both ways). Google, Bing, Yandex and Baidu are let through already.\n\nThe answer is `201` with the server's security. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityCrawlerInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/crawlers\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"DuckDuckGo\",\n  \"url\": \"https://duckduckgo.com/duckduckbot\",\n  \"domains\": [\n    \".duckduckgo.com\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/crawlers\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"name\": \"DuckDuckGo\",\n    \"url\": \"https://duckduckgo.com/duckduckbot\",\n    \"domains\": [\n      \".duckduckgo.com\"\n    ]\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.crawlers.add({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  name: \"DuckDuckGo\",\n  url: \"https://duckduckgo.com/duckduckbot\",\n  domains: [\".duckduckgo.com\"],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/crawlers');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'DuckDuckGo',\n        'url' => 'https://duckduckgo.com/duckduckbot',\n        'domains' => [\n            '.duckduckgo.com',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/crawlers\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"name\": \"DuckDuckGo\",\n        \"url\": \"https://duckduckgo.com/duckduckbot\",\n        \"domains\": [\n            \".duckduckgo.com\",\n        ],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/servers/{serverId}/security/crawlers/{crawlerId}": {
      "delete": {
        "operationId": "serversSecurityCrawlersRemove",
        "summary": "Stop letting a search engine through",
        "description": "Takes a search engine you added off the list the bot checks let through. Imunify360's own (`builtIn`) always stay (`409 invalid_state`); an id that isn't digits is `422`.\n\nThe answer is the server's security with the change in it (its figures asked for again). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the server running.\n\nThe panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Server security"
        ],
        "parameters": [
          {
            "name": "serverId",
            "in": "path",
            "required": true,
            "description": "The server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "crawlerId",
            "in": "path",
            "required": true,
            "description": "The search engine's `id`, from `crawlers`.",
            "schema": {
              "type": "string",
              "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9._:@+-]{1,128}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ServerSecurity"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "servers:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/crawlers/12\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/crawlers/12\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.servers.security.crawlers.remove({\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  crawlerId: \"12\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/crawlers/12');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/crawlers/12\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection": {
      "get": {
        "operationId": "sitesMalwareProtectionGet",
        "summary": "Get a site's malware protection",
        "description": "Returns the site's malware protection: whether it's on, whether it's the server's included site and what it costs, the server's Imunify360 status, recent scans, files and folders scans skip, what the site has installed with known security holes, Imunify360's WordPress plugin in the site, and the attacks on the site in the last 24 hours with the rules turned off for it. Its threats are a list of their own: `GET /sites/{siteId}/malware-protection/threats`.\n\nA staging copy can't have malware protection (`available: false`).\n\nThe panel's own limit applies too: 120 looks a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.get({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/actions/enable": {
      "post": {
        "operationId": "sitesMalwareProtectionEnable",
        "summary": "Turn on a site's malware protection",
        "description": "Turns malware protection on for the site: Imunify360 scans it, cleans what it finds and watches what it has installed for known security holes. The server's included site costs nothing; each other site with malware protection on is $2.99 a month, by the days it's on, billed after the month (from the wallet first, then the saved card). Up to 30 sites a server can have it (`409 limit_reached`).\n\n**Paying.** It's treated as spending money whether or not this site would be the included one (the price depends on the server's other sites, which can change between a look and this call): it needs `billing:write`, an `Idempotency-Key`, and the account's agreement to card charges (`403 charges_not_authorized`, given once in the panel's Billing). Nothing is charged now. An extra site needs a saved card even when the wallet has money (`402 payment_method_required`): the month's bill goes to the card when the wallet can't pay it.\n\nThe answer is the site's malware protection with the change in it. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing), and the site live (a staging copy: `409 staging_copy`). `malware_protection.enabled` follows.\n\nThe panel's own limit applies too: 20 switches a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: this operation spends money. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of paying twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "`payment_method_required`: There's no money in the wallet and no saved card to pay with.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`charges_not_authorized`: The account hasn't agreed to card charges yet.\n\n`feature_unavailable`: This product isn't open to the account.\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`all_servers_required`: The token is limited to some servers, and this operation needs a token for all servers: it changes domains or Cloudflare, or reaches Mail or billing, none of which is tied to one server.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write",
          "billing:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": true,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/enable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Idempotency-Key: $KEY\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/enable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Idempotency-Key\": idempotencyKey,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.malwareProtection.enable({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/enable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/enable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/actions/disable": {
      "post": {
        "operationId": "sitesMalwareProtectionDisable",
        "summary": "Turn off a site's malware protection",
        "description": "Turns malware protection off for the site: an extra site's charge ends; turning off the included site gives its place to the next site with it on. The server's firewall still guards the site. `malware_protection.disabled` follows.\n\nThe answer is the site's malware protection with the change in it. Imunify360 must be on for the server (`409 security_off`; while it's failed, turn it off for the server instead: that turns it off for every site). A site whose protection is off already is answered `200` as it is, whatever the server's security is doing.\n\nThe panel's own limit applies too: 20 switches a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.disable({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/settings": {
      "patch": {
        "operationId": "sitesMalwareProtectionUpdateSettings",
        "summary": "Change a site's malware protection emails",
        "description": "Turns the emails about this site on or off: threats found, clean-ups, its domain on a blacklist and known security holes (the server's own settings choose which kinds are sent). `alerts` is required.\n\nThe answer is the site's malware protection with the change in it.\n\nThe panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MalwareProtectionSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/settings\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"alerts\": false\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/settings\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"alerts\": false\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.updateSettings({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  alerts: false,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/settings');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'alerts' => false,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/settings\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"alerts\": False,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/threats": {
      "get": {
        "operationId": "sitesMalwareProtectionThreatsList",
        "summary": "List a site's malware threats",
        "description": "Lists the malware and other threats found on the site: open ones to clean or ignore, and those cleaned or ignored (kept while the server keeps them, at most 1000 a server). Empty while Imunify360 isn't on.\n\nThe panel's own limit applies too: 120 looks a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "foundAt"
              ],
              "default": "foundAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only threats in this state.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "cleaned",
                "ignored"
              ]
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "description": "Only this severity.",
            "schema": {
              "type": "string",
              "enum": [
                "critical",
                "high",
                "medium",
                "low"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Only in files, or only in the database.",
            "schema": {
              "type": "string",
              "enum": [
                "file",
                "database"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MalwareThreat"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats?status=open\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats?status=open\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.sites.malwareProtection.threats.list({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  status: \"open\",\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats?status=open');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"status\": \"open\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/threats/actions/clean": {
      "post": {
        "operationId": "sitesMalwareProtectionThreatsClean",
        "summary": "Clean a site's malware threats",
        "description": "Cleans the threats: the malicious code is taken out of each file (or the database), and a copy of each file as it was is kept for `keepCopiesDays`, so the clean-up can be undone (`…/actions/undo-clean`). An id that isn't one of this site's threats now is `404`.\n\nThe answer is the site's malware protection with the change in it. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing) and malware protection on for the site (`409 malware_protection_off`).\n\n**A long request.** The answer waits for the server to finish, up to 15 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MalwareThreatIdsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`malware_protection_off`: Malware protection is off for the site (or, for a server-wide change, for the sites it needs).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/clean\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"threatIds\": [\n    \"1\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/clean\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"threatIds\": [\n      \"1\"\n    ]\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.threats.clean({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  threatIds: [\"1\"],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/clean');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'threatIds' => [\n            '1',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/clean\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"threatIds\": [\n            \"1\",\n        ],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/threats/actions/undo-clean": {
      "post": {
        "operationId": "sitesMalwareProtectionThreatsUndoClean",
        "summary": "Undo a clean-up of a site's threats",
        "description": "Puts the files back as they were before the clean-up, while the threat's `canUndo` is true (the copy is kept for `keepCopiesDays`).\n\nThe answer is the site's malware protection with the change in it. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing) and malware protection on for the site (`409 malware_protection_off`).\n\n**A long request.** The answer waits for the server to finish, up to 15 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MalwareThreatIdsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`malware_protection_off`: Malware protection is off for the site (or, for a server-wide change, for the sites it needs).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/undo-clean\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"threatIds\": [\n    \"1\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/undo-clean\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"threatIds\": [\n      \"1\"\n    ]\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.threats.undoClean({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  threatIds: [\"1\"],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/undo-clean');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'threatIds' => [\n            '1',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/undo-clean\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"threatIds\": [\n            \"1\",\n        ],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/threats/actions/ignore": {
      "post": {
        "operationId": "sitesMalwareProtectionThreatsIgnore",
        "summary": "Mark a site's threats as not malware",
        "description": "Marks the threats as not malware: they're left as they are and no longer count as open. To have scans skip a file or folder from now on, add it to `ignoredPaths`.\n\nThe answer is the site's malware protection with the change in it. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing) and malware protection on for the site (`409 malware_protection_off`).\n\n**A long request.** The answer waits for the server to finish, up to 15 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MalwareThreatIdsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`malware_protection_off`: Malware protection is off for the site (or, for a server-wide change, for the sites it needs).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/ignore\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"threatIds\": [\n    \"1\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/ignore\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"threatIds\": [\n      \"1\"\n    ]\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.threats.ignore({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  threatIds: [\"1\"],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/ignore');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'threatIds' => [\n            '1',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/threats/actions/ignore\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"threatIds\": [\n            \"1\",\n        ],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/ignored-paths": {
      "post": {
        "operationId": "sitesMalwareProtectionIgnoredPathsAdd",
        "summary": "Have malware scans skip a path on a site",
        "description": "Adds a file or folder inside the site's folder for scans to skip: a tool you trust that looks like malware, for example.\n\nThe answer is `201` with the site's malware protection. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing) and malware protection on for the site (`409 malware_protection_off`).\n\nThe panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MalwareIgnoredPathInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`malware_protection_off`: Malware protection is off for the site (or, for a server-wide change, for the sites it needs).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/ignored-paths\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"path\": \"wp-content/plugins/my-backup-tool/restore.php\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/ignored-paths\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"path\": \"wp-content/plugins/my-backup-tool/restore.php\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.ignoredPaths.add({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"wp-content/plugins/my-backup-tool/restore.php\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/ignored-paths');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'path' => 'wp-content/plugins/my-backup-tool/restore.php',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/ignored-paths\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"path\": \"wp-content/plugins/my-backup-tool/restore.php\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/ignored-paths/{ignoredPathId}": {
      "delete": {
        "operationId": "sitesMalwareProtectionIgnoredPathsRemove",
        "summary": "Stop malware scans skipping a path",
        "description": "Takes a file or folder off the paths scans skip, by its `id` in `ignoredPaths` (digits; anything else is `422`).\n\nThe answer is the site's malware protection with the change in it. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing) and malware protection on for the site (`409 malware_protection_off`).\n\nThe panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "ignoredPathId",
            "in": "path",
            "required": true,
            "description": "The entry's `id`, from `ignoredPaths`.",
            "schema": {
              "type": "string",
              "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9._:@+-]{1,128}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`malware_protection_off`: Malware protection is off for the site (or, for a server-wide change, for the sites it needs).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/ignored-paths/3\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/ignored-paths/3\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.ignoredPaths.remove({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  ignoredPathId: \"3\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/ignored-paths/3');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/ignored-paths/3\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/actions/scan": {
      "post": {
        "operationId": "sitesMalwareProtectionScan",
        "summary": "Scan a site for malware",
        "description": "Scans the site now: its files, and its database with `database: true`. What's found shows in its threats, and as `malware.found` or `malware.cleaned` events.\n\nThe answer is `202` with the site's malware protection (the scan in `scans`). Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing) and malware protection on for the site (`409 malware_protection_off`).\n\n**A long request.** The answer waits for the server to finish, up to 8 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 10 scans a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityScanInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`malware_protection_off`: Malware protection is off for the site (or, for a server-wide change, for the sites it needs).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/scan\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"database\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/scan\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"database\": true\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.scan({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  database: true,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/scan');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'database' => true,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/scan\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"database\": True,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/malware-protection/wordpress-plugin": {
      "patch": {
        "operationId": "sitesMalwareProtectionWordpressPluginUpdate",
        "summary": "Change Imunify360's WordPress plugin in a site",
        "description": "Changes Imunify360's WordPress plugin in the site: adds it (about a minute) or takes it off, and turns its firewall and AI bot protection on or off. The plugin must be on for the server (`409 wordpress_plugin_off`: `servers.security.wordpressPlugin.enable`).\n\nThe answer is `202` with the site's malware protection while the plugin is being added (`wordpressPlugin.status` is `adding`), `200` otherwise. Imunify360 must be on for the server (`409 security_off`; `409 not_ready` while it's still installing) and malware protection on for the site (`409 malware_protection_off`).\n\n**A long request.** The answer waits for the server to finish, up to 14 minutes (the change and Imunify360's figures read again): give your HTTP client a timeout that long. If the connection is cut first, the work still goes on; look at the view again for the result. The panel's own limit applies too: 30 changes a minute per person, shared with the panel (`429 rate_limited`).",
        "tags": [
          "Malware protection"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MalwareWordpressPluginInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMalwareProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`security_off`: Imunify360 is off for the server (or failed), and this needs it on.\n\n`not_ready`: Something this needs isn't ready yet (for example, the server has no IP address yet).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_busy`: The server's current change hasn't finished yet.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`malware_protection_off`: Malware protection is off for the site (or, for a server-wide change, for the sites it needs).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`wordpress_plugin_off`: Imunify360's WordPress plugin is off for the server.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`security_refused`: Imunify360 on the server refused the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/wordpress-plugin\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"installed\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/wordpress-plugin\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"installed\": true\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.malwareProtection.wordpressPlugin.update({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  installed: true,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/wordpress-plugin');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'installed' => true,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/wordpress-plugin\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"installed\": True,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/resources": {
      "get": {
        "operationId": "sitesResourcesGet",
        "summary": "Get a site's resources",
        "description": "Returns how much of its server the site may use: its CPU, memory and process limits, its CPU priority and its PHP settings (`settings`), whether they're in place on the server (`status`), what the server has (`server`), and the server's other sites with limits of their own (`otherSites`). `blockedReason` says when the site can't have settings of its own.",
        "tags": [
          "Resources"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteResources"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.resources.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "put": {
        "operationId": "sitesResourcesUpdate",
        "summary": "Set a site's resources",
        "description": "Sets every one of the site's resource settings at once: a setting left out (or null) goes back to its default, so send `{}` to remove them all. A CPU, memory or process limit, or a priority other than `normal`, gives the site a PHP of its own, which holds it to them; the PHP settings apply either way.\n\n**What happens next.** The answer is `202` with the settings and `status: \"applying\"`: the site's server applies them shortly, then `status` is `applied`. If the server can't apply them, `status` is `failed` and the site keeps its previous settings.\n\n**Limits.** The memory limit is at most the server's `maxMemoryMb`, and at least room for one request (`phpMemoryMb` + 128 MB); the process limit leaves room for the PHP workers and scheduled tasks. The site must be live, its server running, and not a staging copy (`409 site_unavailable` says why). Up to 30 changes a minute. If per-site resources are no longer open to your account, a site's settings can still be removed (`{}`); anything else answers `403 feature_unavailable`.",
        "tags": [
          "Resources"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteResourcesUpdateInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteResources"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"cpuPercent\": 50,\n  \"memoryMb\": 1024,\n  \"workers\": 8,\n  \"phpMemoryMb\": 512,\n  \"uploadMb\": 128\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"cpuPercent\": 50,\n    \"memoryMb\": 1024,\n    \"workers\": 8,\n    \"phpMemoryMb\": 512,\n    \"uploadMb\": 128\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.resources.update({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  cpuPercent: 50,\n  memoryMb: 1024,\n  workers: 8,\n  phpMemoryMb: 512,\n  uploadMb: 128,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'cpuPercent' => 50,\n        'memoryMb' => 1024,\n        'workers' => 8,\n        'phpMemoryMb' => 512,\n        'uploadMb' => 128,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"cpuPercent\": 50,\n        \"memoryMb\": 1024,\n        \"workers\": 8,\n        \"phpMemoryMb\": 512,\n        \"uploadMb\": 128,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/resources/usage": {
      "get": {
        "operationId": "sitesResourcesUsage",
        "summary": "Get what a site uses of its server now",
        "description": "Measures what the site uses of its server right now, over one second: processor, memory and processes (its PHP and scheduled tasks; database work is shared by all sites and isn't counted). It's read from the site's server, so it takes a second or two; a reading is kept 4 seconds. Live sites with the standard setup only (`409 site_unavailable` otherwise).",
        "tags": [
          "Resources"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteUsage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources/usage\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources/usage\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.resources.usage({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources/usage');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources/usage\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cron-jobs": {
      "get": {
        "operationId": "sitesCronJobsList",
        "summary": "List a site's cron jobs",
        "description": "Lists the site's cron jobs, oldest first (the order the panel shows), with what each runs and when. Whether each is running now, and how its latest run went, comes from `GET /sites/{siteId}/cron-status`; its runs, with their output, from `GET /sites/{siteId}/cron-jobs/{jobId}/runs`. A job's command or address can hold a password or a key, so every call is written to the token's request log.",
        "tags": [
          "Cron jobs"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "name"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only jobs of this type.",
            "schema": {
              "type": "string",
              "enum": [
                "wp_cli",
                "php",
                "url",
                "command"
              ]
            }
          },
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "description": "`true`: only jobs that run on their schedule. `false`: only paused ones.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CronJob"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs?enabled=true\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs?enabled=true\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.sites.cronJobs.list({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  enabled: true,\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs?enabled=true');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"enabled\": \"true\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "sitesCronJobsCreate",
        "summary": "Add a cron job to a site",
        "description": "Adds a scheduled task to the site: a WP-CLI command, a PHP script of the site, a call to an address, or a shell command, run on a cron schedule in UTC. It runs on the site's server as the site's own user, in the site's folder, and is stopped when it takes longer than `timeoutSeconds`. A run is skipped while the job's previous run is still going.\n\n**Limits.** Up to 25 jobs per site (`409 limit_reached`). The site must have finished installing and its server be running (`409 site_unavailable`, `409 server_unavailable`). The schedule on the server changes in the same step: when the server can't be reached (`502 server_unreachable`), nothing is changed.",
        "tags": [
          "Cron jobs"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CronJobInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronJob"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"Nightly clean-up\",\n  \"type\": \"wp_cli\",\n  \"target\": \"transient delete --expired\",\n  \"schedule\": \"0 3 * * *\",\n  \"timeoutSeconds\": 900\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"name\": \"Nightly clean-up\",\n    \"type\": \"wp_cli\",\n    \"target\": \"transient delete --expired\",\n    \"schedule\": \"0 3 * * *\",\n    \"timeoutSeconds\": 900\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cronJobs.create({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  name: \"Nightly clean-up\",\n  type: \"wp_cli\",\n  target: \"transient delete --expired\",\n  schedule: \"0 3 * * *\",\n  timeoutSeconds: 900,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Nightly clean-up',\n        'type' => 'wp_cli',\n        'target' => 'transient delete --expired',\n        'schedule' => '0 3 * * *',\n        'timeoutSeconds' => 900,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"name\": \"Nightly clean-up\",\n        \"type\": \"wp_cli\",\n        \"target\": \"transient delete --expired\",\n        \"schedule\": \"0 3 * * *\",\n        \"timeoutSeconds\": 900,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cron-jobs/{jobId}": {
      "put": {
        "operationId": "sitesCronJobsUpdate",
        "summary": "Change a cron job",
        "description": "Replaces every setting of the job: send them all, as for adding one, with `timeoutSeconds` and `enabled` too (a paused job stays paused only with `enabled: false`). The same settings again are fine: the job is answered as it is.\n\nThe site must have finished installing and its server be running (`409 site_unavailable`, `409 server_unavailable`). The schedule on the server changes in the same step: when the server can't be reached (`502 server_unreachable`), nothing is changed.",
        "tags": [
          "Cron jobs"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The cron job's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CronJobUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronJob"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"Nightly clean-up\",\n  \"type\": \"wp_cli\",\n  \"target\": \"transient delete --expired\",\n  \"schedule\": \"30 2 * * *\",\n  \"timeoutSeconds\": 900,\n  \"enabled\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"name\": \"Nightly clean-up\",\n    \"type\": \"wp_cli\",\n    \"target\": \"transient delete --expired\",\n    \"schedule\": \"30 2 * * *\",\n    \"timeoutSeconds\": 900,\n    \"enabled\": true\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cronJobs.update({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  jobId: \"4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n  name: \"Nightly clean-up\",\n  type: \"wp_cli\",\n  target: \"transient delete --expired\",\n  schedule: \"30 2 * * *\",\n  timeoutSeconds: 900,\n  enabled: true,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Nightly clean-up',\n        'type' => 'wp_cli',\n        'target' => 'transient delete --expired',\n        'schedule' => '30 2 * * *',\n        'timeoutSeconds' => 900,\n        'enabled' => true,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"name\": \"Nightly clean-up\",\n        \"type\": \"wp_cli\",\n        \"target\": \"transient delete --expired\",\n        \"schedule\": \"30 2 * * *\",\n        \"timeoutSeconds\": 900,\n        \"enabled\": True,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "delete": {
        "operationId": "sitesCronJobsDelete",
        "summary": "Delete a cron job",
        "description": "Deletes the job and its runs. A run under way isn't stopped. The site must have finished installing and its server be running (`409 site_unavailable`, `409 server_unavailable`). The schedule on the server changes in the same step: when the server can't be reached (`502 server_unreachable`), nothing is changed.",
        "tags": [
          "Cron jobs"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The cron job's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. There's no answer body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nawait rf.sites.cronJobs.delete({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  jobId: \"4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n});"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()"
          }
        ]
      }
    },
    "/sites/{siteId}/cron-jobs/{jobId}/actions/enable": {
      "post": {
        "operationId": "sitesCronJobsEnable",
        "summary": "Resume a paused cron job",
        "description": "Puts the job back on its schedule. A job that already runs on its schedule is answered as it is. The site must have finished installing and its server be running (`409 site_unavailable`, `409 server_unavailable`). The schedule on the server changes in the same step: when the server can't be reached (`502 server_unreachable`), nothing is changed.",
        "tags": [
          "Cron jobs"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The cron job's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronJob"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/enable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/enable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cronJobs.enable({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  jobId: \"4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/enable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/enable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cron-jobs/{jobId}/actions/disable": {
      "post": {
        "operationId": "sitesCronJobsDisable",
        "summary": "Pause a cron job",
        "description": "Takes the job off its schedule; it keeps its settings and runs, and can still be run by hand. A run under way isn't stopped. A paused job is answered as it is. The site must have finished installing and its server be running (`409 site_unavailable`, `409 server_unavailable`). The schedule on the server changes in the same step: when the server can't be reached (`502 server_unreachable`), nothing is changed.",
        "tags": [
          "Cron jobs"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The cron job's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronJob"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cronJobs.disable({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  jobId: \"4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cron-jobs/{jobId}/actions/run": {
      "post": {
        "operationId": "sitesCronJobsRun",
        "summary": "Run a cron job now",
        "description": "Starts a run of the job at once, besides its schedule (a paused job too). The answer is `202` while the run goes on (`running: true`), or `200` when it already ended; either way it's the first of the job's runs (`GET /sites/{siteId}/cron-jobs/{jobId}/runs`), with `trigger: \"manual\"`.\n\nOne run of a job at a time: while one runs, from its schedule or by hand, this answers `409 already_running`. The site must have finished installing and its server be running.",
        "tags": [
          "Cron jobs"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The cron job's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronJobRunStarted"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronJobRunStarted"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`already_running`: The cron job is running now, so it wasn't started again.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/run\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/run\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cronJobs.run({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  jobId: \"4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/run');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/actions/run\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cron-jobs/{jobId}/runs": {
      "get": {
        "operationId": "sitesCronJobsRunsList",
        "summary": "List a cron job's runs",
        "description": "Lists the job's last 20 runs, newest first, each with what it printed (the end of it, for long output). Skips in a row for the same reason are folded into one entry (`repeats`). They're read from the site's server, so it must be running. What a job prints can hold a password or a key, so every call is written to the token's request log.",
        "tags": [
          "Cron jobs"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "The cron job's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "startedAt"
              ],
              "default": "startedAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only runs that ended this way.",
            "schema": {
              "type": "string",
              "enum": [
                "success",
                "failed",
                "timeout",
                "skipped"
              ]
            }
          },
          {
            "name": "trigger",
            "in": "query",
            "required": false,
            "description": "Only runs started this way.",
            "schema": {
              "type": "string",
              "enum": [
                "schedule",
                "manual"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CronRun"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/runs?status=success\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/runs?status=success\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.sites.cronJobs.runs.list({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  jobId: \"4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n  status: \"success\",\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/runs?status=success');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-jobs/4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/runs\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"status\": \"success\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/cron-status": {
      "get": {
        "operationId": "sitesCronStatusGet",
        "summary": "Get which of a site's cron jobs are running",
        "description": "Reads from the site's server which of its cron jobs are running now, and how each one's latest run went (without its output), with the server's time. Poll it to follow a run started with `POST …/actions/run`. The site must have finished installing and its server be running.",
        "tags": [
          "Cron jobs"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronStatus"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-status\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-status\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.cronStatus.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-status');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cron-status\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files": {
      "get": {
        "operationId": "sitesFilesList",
        "summary": "List a folder of a site",
        "description": "Lists what a folder of the site holds, in one answer: folders first, then files, each by name, as the panel's File Manager shows them. A folder of more than 5,000 entries lists 5,000 of them, with `truncated: true`: list the folders inside it instead.\n\nPaths are the site's own: they start with `/` at the site's folder (where wp-config.php is), and nothing outside it can be reached. A path with `.` or `..` parts, a backslash, a control character or a percent-encoded `/` or `.` is refused before anything runs.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "description": "The folder's path in the site. Left out: the site's own folder (`/`).",
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileList"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`bad_path`: The path isn't one the site's server can use.\n\n`not_a_folder`: The path is a file, where a folder is needed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files?path=%2Fwp-content\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files?path=%2Fwp-content\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.list({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"/wp-content\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files?path=%2Fwp-content');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"path\": \"/wp-content\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/content": {
      "get": {
        "operationId": "sitesFilesRead",
        "summary": "Read a text file of a site",
        "description": "Answers a text file's content (UTF-8, up to 2 MB) with its `version`: send that as `expectedVersion` when writing the file back, so a change made in the meantime isn't overwritten. Larger files (`413 too_large`) and files that aren't text (`415 binary`) are downloaded instead.\n\nFiles can hold secrets (wp-config.php holds the database password), so every read is written to the token's request log.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "The file's path in the site, like `/robots.txt`.",
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileContent"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`bad_path`: The path isn't one the site's server can use.\n\n`not_a_file`: The path is a folder (or something other than a file), where a file is needed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`too_large`: It's too large for this: a file over 2 MB to read as text, an upload over the limit, or an archive that holds more than 60,000 files or 4 GB.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "`binary`: The file isn't text, so it can't be read as text.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/content?path=%2Frobots.txt\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/content?path=%2Frobots.txt\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.read({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"/robots.txt\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/content?path=%2Frobots.txt');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/content\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"path\": \"/robots.txt\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "put": {
        "operationId": "sitesFilesWrite",
        "summary": "Write a text file of a site",
        "description": "Writes a text file's whole content, making the file when it isn't there (its folder must exist). It's written in one step: readers see the old file or the new one, never half of it.\n\n**Safe saves.** With `expectedVersion` (the `version` a read answered), nothing is written if the file changed since (`409 conflict`); `new` writes only a file that isn't there yet. **PHP files** are checked first: a syntax error isn't saved (`422 lint_error`, with PHP's words) unless `force` is true.\n\nThe body is at most 1 MB; upload larger files. Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`). The site's CDN forgets its old copy of the file.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileWriteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileEntry"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_path`: The path isn't one the site's server can use.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`is_folder`: A folder with that name is already there, so a file can't be written in its place.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: The body is larger than the operation accepts (1 MB for JSON).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).\n\n`lint_error`: The PHP file has a syntax error, so it wasn't saved. `message` gives PHP's own words, with the line.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/content\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"path\": \"/robots.txt\",\n  \"content\": \"User-agent: *\\nDisallow: /wp-admin/\\nAllow: /wp-admin/admin-ajax.php\\n\",\n  \"expectedVersion\": \"1795017600000000000:67\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/content\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"path\": \"/robots.txt\",\n    \"content\": \"User-agent: *\\nDisallow: /wp-admin/\\nAllow: /wp-admin/admin-ajax.php\\n\",\n    \"expectedVersion\": \"1795017600000000000:67\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.write({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"/robots.txt\",\n  content: \"User-agent: *\\nDisallow: /wp-admin/\\nAllow: /wp-admin/admin-ajax.php\\n\",\n  expectedVersion: \"1795017600000000000:67\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/content');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'path' => '/robots.txt',\n        'content' => 'User-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php\n',\n        'expectedVersion' => '1795017600000000000:67',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/content\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"path\": \"/robots.txt\",\n        \"content\": \"User-agent: *\\nDisallow: /wp-admin/\\nAllow: /wp-admin/admin-ajax.php\\n\",\n        \"expectedVersion\": \"1795017600000000000:67\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/actions/create-folder": {
      "post": {
        "operationId": "sitesFilesCreateFolder",
        "summary": "Make a folder in a site",
        "description": "Makes a folder, and the folders on its path that aren't there yet. Refused when something with that name is there (`409 exists`). `Location` is the new folder's listing. Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`).",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileEntry"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_path`: The path isn't one the site's server can use.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`exists`: Something with that name is already there.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/create-folder\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"path\": \"/wp-content/uploads/reports\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/create-folder\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"path\": \"/wp-content/uploads/reports\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.createFolder({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"/wp-content/uploads/reports\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/create-folder');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'path' => '/wp-content/uploads/reports',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/create-folder\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"path\": \"/wp-content/uploads/reports\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/actions/create-file": {
      "post": {
        "operationId": "sitesFilesCreateFile",
        "summary": "Make an empty file in a site",
        "description": "Makes an empty file (its folder must exist), to write with `PUT /sites/{siteId}/files/content`. Refused when something with that name is there (`409 exists`). `Location` is the new file's download address (a folder's: its listing). Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`).",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileEntry"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_path`: The path isn't one the site's server can use.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`exists`: Something with that name is already there.\n\n`is_folder`: A folder with that name is already there, so a file can't be written in its place.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/create-file\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"path\": \"/wp-content/uploads/reports/notes.txt\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/create-file\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"path\": \"/wp-content/uploads/reports/notes.txt\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.createFile({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"/wp-content/uploads/reports/notes.txt\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/create-file');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'path' => '/wp-content/uploads/reports/notes.txt',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/create-file\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"path\": \"/wp-content/uploads/reports/notes.txt\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/actions/move": {
      "post": {
        "operationId": "sitesFilesMove",
        "summary": "Move or rename a file or folder",
        "description": "Moves a file or folder to another path, or renames it in its folder (`to` names the new path, name included; its folder must exist). A file already at `to` is replaced only with `overwrite: true`; a folder never is. The site's folder itself can't be moved (`403 protected`). Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`).",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileMoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileEntry"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_path`: The path isn't one the site's server can use.\n\n`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.\n\n`protected`: The site's folder itself can't be moved, replaced, deleted or given other permissions.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`exists`: Something with that name is already there.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/move\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"from\": \"/wp-content/uploads/old-logo.png\",\n  \"to\": \"/wp-content/uploads/2026/11/logo.png\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/move\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"from\": \"/wp-content/uploads/old-logo.png\",\n    \"to\": \"/wp-content/uploads/2026/11/logo.png\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.move({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  from: \"/wp-content/uploads/old-logo.png\",\n  to: \"/wp-content/uploads/2026/11/logo.png\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/move');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'from' => '/wp-content/uploads/old-logo.png',\n        'to' => '/wp-content/uploads/2026/11/logo.png',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/move\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"from\": \"/wp-content/uploads/old-logo.png\",\n        \"to\": \"/wp-content/uploads/2026/11/logo.png\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/actions/copy": {
      "post": {
        "operationId": "sitesFilesCopy",
        "summary": "Copy a file or folder",
        "description": "Copies a file, or a folder with everything in it, to another path (name included; its folder must exist). A file already at `to` is replaced only with `overwrite: true`; a folder never is. A large folder can take minutes. `Location` is the new file's download address (a folder's: its listing). Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`).",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileMoveInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileEntry"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_path`: The path isn't one the site's server can use.\n\n`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.\n\n`protected`: The site's folder itself can't be moved, replaced, deleted or given other permissions.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`exists`: Something with that name is already there.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/copy\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"from\": \"/wp-content/themes/bakery\",\n  \"to\": \"/wp-content/themes/bakery-backup\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/copy\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"from\": \"/wp-content/themes/bakery\",\n    \"to\": \"/wp-content/themes/bakery-backup\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.copy({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  from: \"/wp-content/themes/bakery\",\n  to: \"/wp-content/themes/bakery-backup\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/copy');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'from' => '/wp-content/themes/bakery',\n        'to' => '/wp-content/themes/bakery-backup',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/copy\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"from\": \"/wp-content/themes/bakery\",\n        \"to\": \"/wp-content/themes/bakery-backup\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/actions/delete": {
      "post": {
        "operationId": "sitesFilesDelete",
        "summary": "Delete files and folders of a site",
        "description": "Deletes up to 500 files and folders, each folder with everything in it, in the order given. It can't be undone. A path that isn't there stops the delete with `404 not_found` naming it, after the paths before it were deleted: after a failure, list the folder to see what's left.\n\nThe site's folder itself can't be deleted (`403 protected`). Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`).",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileDeleteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FilesDeleted"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_path`: The path isn't one the site's server can use.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.\n\n`protected`: The site's folder itself can't be moved, replaced, deleted or given other permissions.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/delete\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"paths\": [\n    \"/wp-content/uploads/old-logo.png\",\n    \"/wp-content/upgrade\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/delete\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"paths\": [\n      \"/wp-content/uploads/old-logo.png\",\n      \"/wp-content/upgrade\"\n    ]\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.delete({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  paths: [\"/wp-content/uploads/old-logo.png\", \"/wp-content/upgrade\"],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/delete');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'paths' => [\n            '/wp-content/uploads/old-logo.png',\n            '/wp-content/upgrade',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/delete\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"paths\": [\n            \"/wp-content/uploads/old-logo.png\",\n            \"/wp-content/upgrade\",\n        ],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/actions/chmod": {
      "post": {
        "operationId": "sitesFilesChmod",
        "summary": "Change a file's or folder's permissions",
        "description": "Sets a file's or folder's permissions (not of what a folder holds). The permissions it already has are fine: it's answered as it is. Only what the site's own user owns can be changed. Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`).",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileChmodInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileEntry"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_path`: The path isn't one the site's server can use.\n\n`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.\n\n`protected`: The site's folder itself can't be moved, replaced, deleted or given other permissions.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/chmod\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"path\": \"/wp-config.php\",\n  \"mode\": \"600\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/chmod\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"path\": \"/wp-config.php\",\n    \"mode\": \"600\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.chmod({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"/wp-config.php\",\n  mode: \"600\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/chmod');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'path' => '/wp-config.php',\n        'mode' => '600',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/chmod\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"path\": \"/wp-config.php\",\n        \"mode\": \"600\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/actions/extract": {
      "post": {
        "operationId": "sitesFilesExtract",
        "summary": "Extract a .zip archive in a site",
        "description": "Extracts a .zip archive of the site into a folder of it (the folder must exist); files already there with the same names are replaced. Links in the archive are left out, and an archive with a path leading outside the folder is refused (`422 unsafe_archive`).\n\nAt most 60,000 files and 4 GB once extracted (`413 too_large`); a large archive can take minutes. Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`).",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileExtractInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FilesExtracted"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_path`: The path isn't one the site's server can use.\n\n`not_a_folder`: The path is a file, where a folder is needed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`too_large`: It's too large for this: a file over 2 MB to read as text, an upload over the limit, or an archive that holds more than 60,000 files or 4 GB.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).\n\n`bad_archive`: The file isn't a valid .zip archive.\n\n`unsafe_archive`: The archive holds a path that would land outside the folder it's extracted to (`message` names it), so extracting it was stopped.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/extract\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"path\": \"/wp-content/uploads/theme.zip\",\n  \"destination\": \"/wp-content/themes\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/extract\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"path\": \"/wp-content/uploads/theme.zip\",\n    \"destination\": \"/wp-content/themes\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.extract({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"/wp-content/uploads/theme.zip\",\n  destination: \"/wp-content/themes\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/extract');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'path' => '/wp-content/uploads/theme.zip',\n        'destination' => '/wp-content/themes',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/extract\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"path\": \"/wp-content/uploads/theme.zip\",\n        \"destination\": \"/wp-content/themes\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/actions/compress": {
      "post": {
        "operationId": "sitesFilesCompress",
        "summary": "Make a .zip archive in a site",
        "description": "Puts files and folders of the site (each folder with everything in it; links left out) into a new .zip archive in the site. Nothing may be at `destination` yet (`409 exists`). A large folder can take minutes. `Location` is the new file's download address (a folder's: its listing). Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`).",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileCompressInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileEntry"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_path`: The path isn't one the site's server can use.\n\n`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`exists`: Something with that name is already there.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/compress\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"paths\": [\n    \"/wp-content/themes/bakery\"\n  ],\n  \"destination\": \"/wp-content/uploads/bakery-theme.zip\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/compress\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"paths\": [\n      \"/wp-content/themes/bakery\"\n    ],\n    \"destination\": \"/wp-content/uploads/bakery-theme.zip\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.compress({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  paths: [\"/wp-content/themes/bakery\"],\n  destination: \"/wp-content/uploads/bakery-theme.zip\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/compress');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'paths' => [\n            '/wp-content/themes/bakery',\n        ],\n        'destination' => '/wp-content/uploads/bakery-theme.zip',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/actions/compress\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"paths\": [\n            \"/wp-content/themes/bakery\",\n        ],\n        \"destination\": \"/wp-content/uploads/bakery-theme.zip\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/upload": {
      "put": {
        "operationId": "sitesFilesUpload",
        "summary": "Upload a file to a site",
        "description": "Uploads a file to the site: send its bytes as the body, with `Content-Type: application/octet-stream` and its size in `Content-Length` (`400 length_required` without it). The bytes are passed on to the site's server as they arrive, and the file appears whole once they all have: an upload cut short leaves nothing behind (`422 incomplete`).\n\nUp to the File Manager's upload limit of 100 MB (`413 payload_too_large`). A file already at `path` is replaced only with `overwrite=true`. The folder must exist. `Location` is the file's download address. An `Idempotency-Key` is accepted, but an upload's answer isn't kept: a key can be sent again once its upload has finished. Not while a staging operation copies, pushes or puts back the site (`409 staging_busy`).\n\n**Time.** The whole upload must arrive within 5 minutes of the request's start: a slower one is cut off (the connection is closed, often with a plain `408` that isn't JSON), and nothing is kept. A 100 MB file needs about 350 KB a second.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "The file's path in the site, name included, like `/wp-content/uploads/2026/11/report.pdf`.",
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "overwrite",
            "in": "query",
            "required": false,
            "description": "`true`: replace a file already at `path` (never a folder). Left out or `false`: refused if something is there (`409 exists`).",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileEntry"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`length_required`: An upload was sent without a Content-Length header.\n\n`bad_path`: The path isn't one the site's server can use.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`exists`: Something with that name is already there.\n\n`is_folder`: A folder with that name is already there, so a file can't be written in its place.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: The body is larger than the operation accepts (1 MB for JSON).\n\n`too_large`: It's too large for this: a file over 2 MB to read as text, an upload over the limit, or an archive that holds more than 60,000 files or 4 GB.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: The body isn't sent as application/json (or application/octet-stream for uploads).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).\n\n`incomplete`: The upload ended before every byte its Content-Length announced arrived, so nothing was saved.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/upload?path=%2Fwp-content%2Fuploads%2F2026%2F11%2Fteam-photo.jpg&overwrite=true\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/octet-stream\" \\\n  --data-binary \"@upload.bin\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { readFile } from \"node:fs/promises\";\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/upload?path=%2Fwp-content%2Fuploads%2F2026%2F11%2Fteam-photo.jpg&overwrite=true\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/octet-stream\",\n  },\n  body: await readFile(\"upload.bin\"),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { readFile } from \"node:fs/promises\";\nimport { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.files.upload({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"/wp-content/uploads/2026/11/team-photo.jpg\",\n  overwrite: true,\n  body: await readFile(\"upload.bin\"),\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/upload?path=%2Fwp-content%2Fuploads%2F2026%2F11%2Fteam-photo.jpg&overwrite=true');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 360,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/octet-stream',\n    ],\n    CURLOPT_POSTFIELDS => file_get_contents('upload.bin'),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/upload\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Content-Type\": \"application/octet-stream\",\n    },\n    params={\n        \"path\": \"/wp-content/uploads/2026/11/team-photo.jpg\",\n        \"overwrite\": \"true\",\n    },\n    data=open(\"upload.bin\", \"rb\"),\n    timeout=360,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/files/download": {
      "get": {
        "operationId": "sitesFilesDownload",
        "summary": "Download a file or folder of a site",
        "description": "Downloads a file as it is (`Content-Type: application/octet-stream`, with its `Content-Length`), or a folder with everything in it as a .zip archive (`application/zip`, made as it's sent, so without a length), as an attachment named after it. The bytes are passed on from the site's server as they come, never held whole.\n\nFiles can hold secrets, so every download is written to the token's request log.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "The file's or folder's path in the site. `/` downloads the whole site's folder.",
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`bad_path`: The path isn't one the site's server can use.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.\n\n`outside_root`: The path leads outside the site's folder (through a link), which files can't reach.\n\n`permission_denied`: The site's server refused access to a file or folder: its permissions don't let the site's own user do this. `message` names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`io_error`: The site's server couldn't complete the file operation (its disk or file system refused).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.\n\n`file_error`: The site's server didn't complete the file operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/download?path=%2Fwp-content%2Fuploads%2F2026%2F11%2Fteam-photo.jpg\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -OJ"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { writeFile } from \"node:fs/promises\";\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/download?path=%2Fwp-content%2Fuploads%2F2026%2F11%2Fteam-photo.jpg\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nawait writeFile(\"download\", Buffer.from(await res.arrayBuffer()));"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { writeFile } from \"node:fs/promises\";\nimport { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst res = await rf.sites.files.download({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  path: \"/wp-content/uploads/2026/11/team-photo.jpg\",\n});\nawait writeFile(\"download\", Buffer.from(await res.arrayBuffer()));"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/download?path=%2Fwp-content%2Fuploads%2F2026%2F11%2Fteam-photo.jpg');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nfile_put_contents('download', $body);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/files/download\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"path\": \"/wp-content/uploads/2026/11/team-photo.jpg\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nwith open(\"download\", \"wb\") as f:\n    f.write(response.content)"
          }
        ]
      }
    },
    "/sites/{siteId}/backup": {
      "get": {
        "operationId": "sitesBackupGet",
        "summary": "Get a site's backups",
        "description": "Returns the site's backups at a glance: where they go and how often (`settings`: null while backups are off), what Rabbitflare Backup would cost the site in each region (`prices`), the newest backup (`latestBackup`) and the latest restore from the last 24 hours (`restore`). Every change of this group answers the same object; while a backup or a restore runs, read it again every few seconds to follow it.\n\nThe backups themselves are a list of their own: `GET /sites/{siteId}/backups`. These are backups of one site, its files and its database; whole-server snapshots are the server's (`GET /servers/{serverId}/snapshots`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteBackup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.backup.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/backups": {
      "get": {
        "operationId": "sitesBackupsList",
        "summary": "List a site's backups",
        "description": "Lists the site's backups, newest first (its 60 newest): running, completed and failed ones, and ones being deleted. Filter by `status` and `trigger`.\n\nA completed backup can be restored (`POST /sites/{siteId}/backups/{backupId}/actions/restore`, where `canRestore`) and its parts downloaded (`GET /sites/{siteId}/backups/{backupId}/download`, where `canDownload`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "startedAt"
              ],
              "default": "startedAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only backups with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "running",
                "completed",
                "failed",
                "deleting"
              ]
            }
          },
          {
            "name": "trigger",
            "in": "query",
            "required": false,
            "description": "Only backups made this way.",
            "schema": {
              "type": "string",
              "enum": [
                "scheduled",
                "manual",
                "before_restore"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Backup"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups?status=completed\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups?status=completed\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.sites.backups.list({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  status: \"completed\",\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups?status=completed');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"status\": \"completed\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "sitesBackupsCreate",
        "summary": "Back a site up now",
        "description": "Starts a backup of the site's files and database now, besides the scheduled ones, to where its backups go (`settings`). The answer is `202` with the object, the new backup in `latestBackup` (`running`); follow it on `GET /sites/{siteId}/backup` until it's `completed` or `failed`. A backup takes from a minute to an hour or more, by the site's size, and waits its turn while another backup or a staging operation runs on the server.\n\n**Limits.** Backups must be on for the site (`409 conflict` while `settings` is null: choose where they go first). One backup of a site at a time (`409 conflict`), at most 10 started this way per site in a day and 12 in an hour (`429 rate_limited`). The site must have finished installing and its server be running; not for a staging copy (`409 staging_copy`), nor while a staging operation runs on the site (`409 staging_busy`). While a Rabbitflare Backup bill has been unpaid for two weeks, new backups to Rabbitflare Backup wait for it (`402 payment_required`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteBackup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "`payment_required`: An unpaid bill must be settled first (for example, the Own servers plan's).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.backups.create({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/backup/settings": {
      "put": {
        "operationId": "sitesBackupUpdateSettings",
        "summary": "Choose where and how often a site is backed up",
        "description": "Turns the site's backups on, or changes them: where they go (`rabbitflare` and a region, or the id of your storage from `GET /backup-destinations`), how often (`daily` or `weekly` at an hour, UTC, or `manual`), and how many are kept. The settings are saved whole; sending the ones the site already has answers the object as it is. The answer is the object with the new `settings` and `nextRunAt`.\n\n**Payment.** Backups to storage of your own cost nothing. Rabbitflare Backup is billed by use, after each month: $2.00 a month for the site, counted by the days it's backed up there (no fee for sites on Amazon EC2 and Google Cloud servers), plus the space its backups take up, per GB per month at the region's price (`prices`). The month's bill is paid from the wallet first, then the account's saved card; a total under $0.50 is carried to the next month. Choosing Rabbitflare Backup needs a saved card (`402 payment_method_required`) and, when the site isn't on it already, the account's agreement to card charges, given once in the panel's Billing (`403 charges_not_authorized`). An `Idempotency-Key` header is required.\n\n**Scopes.** Settings whose `destination` is Rabbitflare Backup (turning it on, or changing its settings while the site is on it) can start a monthly charge, so they need `billing:write` as well as `sites:write` (`403 insufficient_scope` without it; `billing:write` is for tokens for all servers only, so a token limited to some servers is refused with `403 all_servers_required`), and nothing changes. Storage of your own, moving away from Rabbitflare Backup and `removeStored` need `sites:write` only.\n\n**Moving away from Rabbitflare Backup.** The site's backups there stay (and their space stays billed) until they're deleted: send `removeStored: true` to delete them with the move, or delete them one by one. Only finished backups are deleted, so `removeStored: true` is refused while a backup to Rabbitflare Backup is running or waiting its turn (`409 conflict`): cancel it first (`POST /sites/{siteId}/backups/{backupId}/actions/cancel`), or wait for it to finish.\n\n**Limits.** Keep 1 to 60 backups. Only for a site that has finished installing, never a staging copy (`409 staging_copy`: back up its live site). Storage of your own must have been checked first (`status` not `pending`). 30 changes per site an hour.",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: this operation spends money. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of paying twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteBackup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "`payment_method_required`: There's no money in the wallet and no saved card to pay with.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks a scope this operation needs (`missingScopes`).\n\n`all_servers_required`: The token is limited to some servers, and this operation needs a token for all servers: it changes domains or Cloudflare, or reaches Mail or billing, none of which is tied to one server.\n\n`feature_unavailable`: This product isn't open to the account.\n\n`charges_not_authorized`: The account hasn't agreed to card charges yet.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": true,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/settings\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $KEY\" \\\n  -d '{\n  \"destination\": \"rabbitflare\",\n  \"region\": \"frankfurt\",\n  \"frequency\": \"daily\",\n  \"hour\": 3,\n  \"keep\": 14\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/settings\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify({\n    \"destination\": \"rabbitflare\",\n    \"region\": \"frankfurt\",\n    \"frequency\": \"daily\",\n    \"hour\": 3,\n    \"keep\": 14\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.backup.updateSettings({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  destination: \"rabbitflare\",\n  region: \"frankfurt\",\n  frequency: \"daily\",\n  hour: 3,\n  keep: 14,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/settings');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'destination' => 'rabbitflare',\n        'region' => 'frankfurt',\n        'frequency' => 'daily',\n        'hour' => 3,\n        'keep' => 14,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/settings\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json={\n        \"destination\": \"rabbitflare\",\n        \"region\": \"frankfurt\",\n        \"frequency\": \"daily\",\n        \"hour\": 3,\n        \"keep\": 14,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/backup/actions/disable": {
      "post": {
        "operationId": "sitesBackupDisable",
        "summary": "Turn a site's backups off",
        "description": "Stops backing the site up: no more scheduled backups (`settings` becomes null). Its backups stay where they are, and can still be restored and downloaded, unless `removeStored: true`, which also deletes its backups in Rabbitflare Backup (their space is billed until they're deleted). Backups in storage of your own are never deleted this way. A backup already running finishes.\n\nOnly finished backups are deleted, so `removeStored: true` is refused while a backup to Rabbitflare Backup is running or waiting its turn (`409 conflict`): cancel it first (`POST /sites/{siteId}/backups/{backupId}/actions/cancel`), or wait for it to finish.\n\nThe answer is the object. Turning off backups that are already off answers it as it is.",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupDisableInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteBackup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"removeStored\": false\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"removeStored\": false\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.backup.disable({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  removeStored: false,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'removeStored' => false,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"removeStored\": False,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/backups/{backupId}/actions/restore": {
      "post": {
        "operationId": "sitesBackupsRestore",
        "summary": "Restore a site from a backup",
        "description": "Puts the site's files, its database, or both, back as they were in the backup. **What the site has now is replaced**, so by default the site is first backed up as it is (`backupFirst`), to where its backups go: restoring that backup undoes the restore.\n\nThe answer is `202` with the object, the restore in `restore` (`waiting`, then `running`); follow it on `GET /sites/{siteId}/backup` until it's `completed` or `failed`. While it runs the site's `pendingAction` is `restore`; afterwards the site's domains are applied to it again. A failed restore leaves the site as it was.\n\n**Limits.** Only a backup with `canRestore`, and only the parts it has. One restore of a site at a time, 10 an hour. The site and its server must be running, with nothing else under way on the site: another change (`409 conflict`), a staging operation (`409 staging_busy`) or a clone (`409 clone_busy`). Not for a staging copy (`409 staging_copy`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "backupId",
            "in": "path",
            "required": true,
            "description": "The backup's id, from the site's backups.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupRestoreInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteBackup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`staging_copy`: This site is a staging copy, which can't do this.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/actions/restore\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"parts\": \"all\",\n  \"backupFirst\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/actions/restore\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"parts\": \"all\",\n    \"backupFirst\": true\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.backups.restore({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  backupId: \"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\",\n  parts: \"all\",\n  backupFirst: true,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/actions/restore');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'parts' => 'all',\n        'backupFirst' => true,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/actions/restore\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"parts\": \"all\",\n        \"backupFirst\": True,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/backups/{backupId}/actions/cancel": {
      "post": {
        "operationId": "sitesBackupsCancel",
        "summary": "Cancel a running backup",
        "description": "Stops a backup that's running or waiting its turn. One still waiting stops at once, as `failed` with `error` saying it was cancelled; one under way on the server stops within seconds. The answer is the object. A backup that isn't running can't be cancelled (`409 conflict`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "backupId",
            "in": "path",
            "required": true,
            "description": "The backup's id, from the site's backups.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteBackup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/actions/cancel\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/actions/cancel\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.backups.cancel({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  backupId: \"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/actions/cancel');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/actions/cancel\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/backups/{backupId}": {
      "delete": {
        "operationId": "sitesBackupsDelete",
        "summary": "Delete a backup",
        "description": "Deletes the backup from where it's kept (Rabbitflare Backup, or your storage). It's listed as `deleting` until it's gone, then leaves the list; it can't be restored or downloaded any more. Not while it runs (cancel it first), nor while the site is being restored from it (`409 conflict`). The answer is `204`.",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "backupId",
            "in": "path",
            "required": true,
            "description": "The backup's id, from the site's backups.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. There's no answer body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nawait rf.sites.backups.delete({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  backupId: \"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\",\n});"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()"
          }
        ]
      }
    },
    "/sites/{siteId}/backups/{backupId}/download": {
      "get": {
        "operationId": "sitesBackupsDownload",
        "summary": "Download a backup's files or database",
        "description": "Sends one part of a completed backup as a file: `part=files`, the site's files (a .tar.gz archive), or `part=database`, its database (a gzipped SQL dump). The file comes from the API whichever storage the backup is in, sent as it's read; its name is in `Content-Disposition`. Every download is written to the token's request log.\n\n**Limits.** Only a backup with `canDownload`: one on an SFTP server is downloaded from that server, and one in Google Drive from its folder there (`409 conflict`, with the folder's link). Also `409 conflict`: the storage refuses the file or no longer has it, or it has no IPv4 address (the API downloads only over IPv4). 60 downloads an hour per account, and 50 GB a day: once an account has downloaded that much today, a download answers `429 rate_limited` until the day ends at 00:00 UTC (one that starts under it finishes).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "backupId",
            "in": "path",
            "required": true,
            "description": "The backup's id, from the site's backups.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "part",
            "in": "query",
            "required": true,
            "description": "The part to download: `files` (a .tar.gz archive) or `database` (a gzipped SQL dump).",
            "schema": {
              "type": "string",
              "enum": [
                "files",
                "database"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/gzip": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/gzip"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`bad_gateway`: Something on our side didn't answer properly.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/download?part=database\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -OJ"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { writeFile } from \"node:fs/promises\";\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/download?part=database\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nawait writeFile(\"download\", Buffer.from(await res.arrayBuffer()));"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { writeFile } from \"node:fs/promises\";\nimport { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst res = await rf.sites.backups.download({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  backupId: \"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\",\n  part: \"database\",\n});\nawait writeFile(\"download\", Buffer.from(await res.arrayBuffer()));"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/download?part=database');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nfile_put_contents('download', $body);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/download\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"part\": \"database\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nwith open(\"download\", \"wb\") as f:\n    f.write(response.content)"
          }
        ]
      }
    },
    "/backup-destinations": {
      "get": {
        "operationId": "backupDestinationsList",
        "summary": "List your backup storage",
        "description": "Lists the storage of your own that sites can be backed up to, newest first: buckets, SFTP servers, Google Drive and Dropbox. A site's backups go to one of them when its settings name its `id` as `destination`. Keys and passwords are never answered. Filter by `kind` and `status`.\n\nRabbitflare Backup isn't listed: it's always there, as `destination: \"rabbitflare\"`.\n\nStorage belongs to the whole account, as in the panel, not to a server: a token limited to some servers sees and manages all of it too, with where it points (`detail`) and the count of sites on every server that back up to it (`siteCount`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "name"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Only storage of this kind.",
            "schema": {
              "type": "string",
              "enum": [
                "s3",
                "spaces",
                "vultr",
                "b2",
                "r2",
                "s3compat",
                "gdrive",
                "dropbox",
                "sftp"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only storage with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "ok",
                "error",
                "pending"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BackupDestination"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/backup-destinations?status=ok\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/backup-destinations?status=ok\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.backupDestinations.list({ status: \"ok\" })) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/backup-destinations?status=ok');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/backup-destinations\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"status\": \"ok\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "backupDestinationsCreate",
        "summary": "Connect backup storage",
        "description": "Connects storage of your own for site backups: an Amazon S3 bucket (`s3`), a DigitalOcean Space (`spaces`), Vultr Object Storage (`vultr`), a Cloudflare R2 bucket (`r2`), any other storage that speaks S3 (`s3compat`), or an SFTP server (`sftp`). Google Drive and Dropbox are connected in the panel, by signing in to them.\n\nIt's checked before it's saved, from Rabbitflare's side: a small file is written and deleted (`400 bad_request` with the reason when that fails). So an S3-compatible endpoint or an SFTP server must be on the public internet: a name whose IPv4 addresses are all public, or a public IPv4 address (`422 validation_failed` otherwise, or `503 try_again` when its DNS doesn't answer). An SFTP server signing in with Rabbitflare's key (`auth: \"key\"`, the default) is saved as `pending`: add the answer's `publicKey` to the user's `~/.ssh/authorized_keys` on the server, then check it (`POST /backup-destinations/{destinationId}/actions/check`).\n\nKeys and passwords are kept encrypted and never answered. The answer is `201` with the storage; `Location` is its path, `/v1/backup-destinations/{destinationId}`, where `GET` reads it, `PATCH` renames it and `DELETE` removes it. **Limits.** 20 per account, 20 connected an hour.\n\nStorage belongs to the whole account, as in the panel, not to a server: a token limited to some servers sees and manages all of it too, with where it points (`detail`) and the count of sites on every server that back up to it (`siteCount`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupDestinationCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BackupDestination"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`try_again`: It couldn't be started just now; nothing was changed.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/backup-destinations\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"kind\": \"s3\",\n  \"accessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n  \"secretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n  \"bucket\": \"shop-backups\",\n  \"folder\": \"sites\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/backup-destinations\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"kind\": \"s3\",\n    \"accessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n    \"secretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n    \"bucket\": \"shop-backups\",\n    \"folder\": \"sites\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.backupDestinations.create({\n  kind: \"s3\",\n  accessKeyId: \"AKIAIOSFODNN7EXAMPLE\",\n  secretAccessKey: \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n  bucket: \"shop-backups\",\n  folder: \"sites\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/backup-destinations');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'kind' => 's3',\n        'accessKeyId' => 'AKIAIOSFODNN7EXAMPLE',\n        'secretAccessKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',\n        'bucket' => 'shop-backups',\n        'folder' => 'sites',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/backup-destinations\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"kind\": \"s3\",\n        \"accessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n        \"secretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n        \"bucket\": \"shop-backups\",\n        \"folder\": \"sites\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/backup-destinations/{destinationId}": {
      "get": {
        "operationId": "backupDestinationsGet",
        "summary": "Get backup storage",
        "description": "One storage of your own, as the list shows it: its kind, its name, where it points (`detail`), its status after its last check (`lastError` says what went wrong), and how many sites back up to it. Keys and passwords are never answered.\n\nStorage belongs to the whole account, as in the panel, not to a server: a token limited to some servers sees and manages all of it too, with where it points (`detail`) and the count of sites on every server that back up to it (`siteCount`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "The storage's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BackupDestination"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.backupDestinations.get({\n  destinationId: \"8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "patch": {
        "operationId": "backupDestinationsRename",
        "summary": "Rename backup storage",
        "description": "Gives the storage a new name. Backups already made keep the name it had then (their `location`). The answer is the storage.\n\nStorage belongs to the whole account, as in the panel, not to a server: a token limited to some servers sees and manages all of it too, with where it points (`detail`) and the count of sites on every server that back up to it (`siteCount`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "The storage's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupDestinationRenameInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BackupDestination"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"Shop backups (S3)\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"name\": \"Shop backups (S3)\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.backupDestinations.rename({\n  destinationId: \"8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\",\n  name: \"Shop backups (S3)\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Shop backups (S3)',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"name\": \"Shop backups (S3)\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "delete": {
        "operationId": "backupDestinationsDelete",
        "summary": "Remove backup storage",
        "description": "Disconnects the storage. The backups in it stay there, but they can't be restored or downloaded through Rabbitflare any more, and they leave the sites' lists. Only storage no site backs up to (`409 conflict`: choose other storage for those sites first), and not while a backup to it runs. The answer is `204`.\n\nStorage belongs to the whole account, as in the panel, not to a server: a token limited to some servers sees and manages all of it too, with where it points (`detail`) and the count of sites on every server that back up to it (`siteCount`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "The storage's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. There's no answer body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nawait rf.backupDestinations.delete({ destinationId: \"8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\" });"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/backup-destinations/8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()"
          }
        ]
      }
    },
    "/backup-destinations/{destinationId}/actions/check": {
      "post": {
        "operationId": "backupDestinationsCheck",
        "summary": "Check backup storage",
        "description": "Tests the storage again by writing a small file and deleting it: the answer is the storage, `ok`, or `error` with what went wrong in `lastError`. Use it after adding Rabbitflare's key to an SFTP server (whose identity, its host key, is noted at the first successful check and expected from then on), or after changing the storage's keys or permissions. An S3-compatible endpoint or an SFTP server that isn't on the public internet (any more) isn't tried (`409 conflict`: connect the storage again with another address; `503 try_again` when its DNS doesn't answer). 30 checks an hour per account.\n\nStorage belongs to the whole account, as in the panel, not to a server: a token limited to some servers sees and manages all of it too, with where it points (`detail`) and the count of sites on every server that back up to it (`siteCount`).",
        "tags": [
          "Backups"
        ],
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "description": "The storage's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BackupDestination"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`try_again`: It couldn't be started just now; nothing was changed.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/backup-destinations/9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c23/actions/check\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/backup-destinations/9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c23/actions/check\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.backupDestinations.check({\n  destinationId: \"9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c23\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/backup-destinations/9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c23/actions/check');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/backup-destinations/9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c23/actions/check\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/tickets": {
      "get": {
        "operationId": "ticketsList",
        "summary": "List support tickets",
        "description": "Lists the account's support tickets, the most recently active first (by `lastMessageAt`), without their conversations: `GET /tickets/{ticketRef}` has a ticket's messages. The 200 most recently active tickets are listed; an older one is read by its id.\n\nA token limited to some servers lists the account's general tickets and those about its servers.",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "lastMessageAt",
                "createdAt"
              ],
              "default": "lastMessageAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only tickets in this status: `open` (waiting for support), `answered` (waiting for you) or `closed`.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "answered",
                "closed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TicketSummary"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/tickets?status=answered\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/tickets?status=answered\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.tickets.list({ status: \"answered\" })) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets?status=answered');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/tickets\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"status\": \"answered\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "ticketsCreate",
        "summary": "Open a support ticket",
        "description": "Opens a support ticket with your first message, about the account in general or about one of its sites or servers (`siteId` or `serverId`). Support is told at once, and their answer comes by email to the account's address, in the panel, and here. The account's address also gets an email saying the ticket was received.\n\nTo send files with it, upload each one first (`PUT /tickets/uploads`), then name them in `fileIds`: up to 5 files, together up to 25 MB. Up to 10 new tickets an hour (`429 rate_limited`). `Location` is the new ticket's address.",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TicketInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ticket"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`files_too_large`: The files of one message can add up to 25 MB.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`message_too_short`: A new ticket's message needs at least 10 characters of text (for a formatted message, the text of its `html`).\n\n`message_too_long`: The message is longer than 10,000 characters (for a formatted message, the text of its `html`).\n\n`file_missing`: A file named in `fileIds` isn't waiting to be sent any more: it was sent with another message, removed, or uploaded more than a day ago.\n\n`too_many_files`: One message can carry up to 5 files.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/tickets\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"subject\": \"Checkout page shows a 502 error\",\n  \"topic\": \"server\",\n  \"priority\": \"high\",\n  \"siteId\": \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  \"message\": \"Since this morning the checkout page of the shop shows a 502 error. The screenshot shows what customers see.\",\n  \"fileIds\": [\n    \"5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/tickets\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"subject\": \"Checkout page shows a 502 error\",\n    \"topic\": \"server\",\n    \"priority\": \"high\",\n    \"siteId\": \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n    \"message\": \"Since this morning the checkout page of the shop shows a 502 error. The screenshot shows what customers see.\",\n    \"fileIds\": [\n      \"5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\"\n    ]\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.tickets.create({\n  subject: \"Checkout page shows a 502 error\",\n  topic: \"server\",\n  priority: \"high\",\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  message: \"Since this morning the checkout page of the shop shows a 502 error. The screenshot shows what customers see.\",\n  fileIds: [\"5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\"],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'subject' => 'Checkout page shows a 502 error',\n        'topic' => 'server',\n        'priority' => 'high',\n        'siteId' => '8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d',\n        'message' => 'Since this morning the checkout page of the shop shows a 502 error. The screenshot shows what customers see.',\n        'fileIds' => [\n            '5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/tickets\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"subject\": \"Checkout page shows a 502 error\",\n        \"topic\": \"server\",\n        \"priority\": \"high\",\n        \"siteId\": \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n        \"message\": \"Since this morning the checkout page of the shop shows a 502 error. The screenshot shows what customers see.\",\n        \"fileIds\": [\n            \"5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\",\n        ],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/tickets/{ticketRef}": {
      "get": {
        "operationId": "ticketsGet",
        "summary": "Get a support ticket",
        "description": "Answers a ticket with its whole conversation, oldest message first, each message with its files (`GET /tickets/{ticketRef}/files/{fileId}` downloads one), and its history: reminders, closing and reopening.",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "ticketRef",
            "in": "path",
            "required": true,
            "description": "The ticket's id: its reference, like `RF-7KQ2MX` (any case).",
            "schema": {
              "type": "string",
              "pattern": "^[Rr][Ff]-[A-Za-z0-9]{6}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ticket"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.tickets.get({ ticketRef: \"RF-7KQ2MX\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/tickets/{ticketRef}/messages": {
      "post": {
        "operationId": "ticketsReply",
        "summary": "Reply to a support ticket",
        "description": "Adds your message to the ticket's conversation. Support is told at once, and their answer comes by email to the account's address, in the panel, and here. The ticket goes back to support's queue (`status` becomes `open`), and a closed ticket is reopened.\n\nTo send files with it, upload each one first (`PUT /tickets/uploads`), then name them in `fileIds`: up to 5 files, together up to 25 MB. Up to 60 replies an hour (`429 rate_limited`). Answers the ticket as it is now, your message last; `Location` is the ticket's address.",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "ticketRef",
            "in": "path",
            "required": true,
            "description": "The ticket's id: its reference, like `RF-7KQ2MX` (any case).",
            "schema": {
              "type": "string",
              "pattern": "^[Rr][Ff]-[A-Za-z0-9]{6}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TicketReplyInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ticket"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`files_too_large`: The files of one message can add up to 25 MB.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.\n\n`message_too_long`: The message is longer than 10,000 characters (for a formatted message, the text of its `html`).\n\n`file_missing`: A file named in `fileIds` isn't waiting to be sent any more: it was sent with another message, removed, or uploaded more than a day ago.\n\n`too_many_files`: One message can carry up to 5 files.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/messages\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"message\": \"Orders go through again. Thank you!\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/messages\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"message\": \"Orders go through again. Thank you!\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.tickets.reply({\n  ticketRef: \"RF-7KQ2MX\",\n  message: \"Orders go through again. Thank you!\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/messages');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'message' => 'Orders go through again. Thank you!',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/messages\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"message\": \"Orders go through again. Thank you!\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/tickets/{ticketRef}/actions/close": {
      "post": {
        "operationId": "ticketsClose",
        "summary": "Close a support ticket",
        "description": "Closes the ticket when you need nothing more on it. A ticket already closed is answered as it is. A new message, yours or support's, reopens it.",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "ticketRef",
            "in": "path",
            "required": true,
            "description": "The ticket's id: its reference, like `RF-7KQ2MX` (any case).",
            "schema": {
              "type": "string",
              "pattern": "^[Rr][Ff]-[A-Za-z0-9]{6}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ticket"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/close\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/close\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.tickets.close({ ticketRef: \"RF-7KQ2MX\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/close');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/close\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/tickets/{ticketRef}/actions/reopen": {
      "post": {
        "operationId": "ticketsReopen",
        "summary": "Reopen a support ticket",
        "description": "Reopens a closed ticket: it goes back to support's queue (`status` becomes `open`). A ticket that isn't closed is answered as it is. Replying (`POST /tickets/{ticketRef}/messages`) reopens one too.",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "ticketRef",
            "in": "path",
            "required": true,
            "description": "The ticket's id: its reference, like `RF-7KQ2MX` (any case).",
            "schema": {
              "type": "string",
              "pattern": "^[Rr][Ff]-[A-Za-z0-9]{6}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ticket"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/reopen\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/reopen\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.tickets.reopen({ ticketRef: \"RF-7KQ2MX\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/reopen');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/reopen\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/tickets/{ticketRef}/actions/rate": {
      "post": {
        "operationId": "ticketsRate",
        "summary": "Rate the help on a support ticket",
        "description": "\"How did we do?\": rates the help you got on the ticket, `great`, `okay` or `not_good`, with a few words if you like (the emails about a closed ticket ask the same). A new rating replaces the one given before.",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "ticketRef",
            "in": "path",
            "required": true,
            "description": "The ticket's id: its reference, like `RF-7KQ2MX` (any case).",
            "schema": {
              "type": "string",
              "pattern": "^[Rr][Ff]-[A-Za-z0-9]{6}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TicketRatingInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ticket"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/rate\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"rating\": \"great\",\n  \"comment\": \"Fixed within the hour, thank you!\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/rate\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"rating\": \"great\",\n    \"comment\": \"Fixed within the hour, thank you!\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.tickets.rate({\n  ticketRef: \"RF-7KQ2MX\",\n  rating: \"great\",\n  comment: \"Fixed within the hour, thank you!\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/rate');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'rating' => 'great',\n        'comment' => 'Fixed within the hour, thank you!',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/actions/rate\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"rating\": \"great\",\n        \"comment\": \"Fixed within the hour, thank you!\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/tickets/uploads": {
      "put": {
        "operationId": "ticketsUploadsCreate",
        "summary": "Upload a file for a ticket message",
        "description": "Uploads a file to send with a message: send its bytes as the body, with `Content-Type: application/octet-stream` and its size in `Content-Length` (`400 length_required` without it), and its name in `filename`. Then name its `id` in `fileIds` when you open a ticket or reply.\n\nScreenshots (PNG, JPEG, GIF or WebP), PDFs and text files named .txt or .log, up to 10 MB each (`413 payload_too_large`). What a file is comes from its bytes, not its name (`422 unsupported_file`). An upload not sent with a message within a day is removed; up to 20 can wait at once (`409 too_many_uploads`), and up to 60 can be made an hour (`429 rate_limited`). `Location` is the upload's address, to remove it. An `Idempotency-Key` is accepted, but an upload's answer isn't kept: a key can be sent again once its upload has finished.\n\n**Time.** The whole upload must arrive within 5 minutes of the request's start: a slower one is cut off (the connection is closed, often with a plain `408` that isn't JSON), and nothing is kept.",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "filename",
            "in": "query",
            "required": true,
            "description": "The file's name, like `checkout-error.png`, up to 200 characters. A text file's name must end in .txt or .log.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TicketFile"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`length_required`: An upload was sent without a Content-Length header.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`too_many_uploads`: Twenty uploads already wait to be sent with a message.\n\n`attachments_unavailable`: Files can't be attached right now.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: The body is larger than the operation accepts (1 MB for JSON).\n\n`file_too_large`: The file is larger than one attachment may be (10 MB).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: The body isn't sent as application/json (or application/octet-stream for uploads).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`empty_file`: The file is empty.\n\n`unsupported_file`: The file isn't one that can be attached: screenshots (PNG, JPEG, GIF or WebP), PDFs and text files. What a file is comes from its bytes, not its name.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/tickets/uploads?filename=checkout-error.png\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/octet-stream\" \\\n  --data-binary \"@upload.bin\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { readFile } from \"node:fs/promises\";\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/tickets/uploads?filename=checkout-error.png\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/octet-stream\",\n  },\n  body: await readFile(\"upload.bin\"),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { readFile } from \"node:fs/promises\";\nimport { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.tickets.uploads.create({\n  filename: \"checkout-error.png\",\n  body: await readFile(\"upload.bin\"),\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets/uploads?filename=checkout-error.png');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 360,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/octet-stream',\n    ],\n    CURLOPT_POSTFIELDS => file_get_contents('upload.bin'),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/tickets/uploads\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Content-Type\": \"application/octet-stream\",\n    },\n    params={\n        \"filename\": \"checkout-error.png\",\n    },\n    data=open(\"upload.bin\", \"rb\"),\n    timeout=360,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/tickets/uploads/{uploadId}": {
      "delete": {
        "operationId": "ticketsUploadsDelete",
        "summary": "Remove an upload that wasn't sent",
        "description": "Removes a file uploaded for a message that hasn't been sent with one yet. A file already sent stays with its message (`404 not_found`).",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "description": "The upload's id (the `id` its upload answered).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. There's no answer body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/tickets/uploads/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/tickets/uploads/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nawait rf.tickets.uploads.delete({ uploadId: \"5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\" });"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets/uploads/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/tickets/uploads/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()"
          }
        ]
      }
    },
    "/tickets/{ticketRef}/files/{fileId}": {
      "get": {
        "operationId": "ticketsFilesDownload",
        "summary": "Download a file of a support ticket",
        "description": "Downloads a file sent with one of the ticket's messages, as it is: its type in `Content-Type`, its size in `Content-Length` and its name in `Content-Disposition` (always as an attachment).",
        "tags": [
          "Support tickets"
        ],
        "parameters": [
          {
            "name": "ticketRef",
            "in": "path",
            "required": true,
            "description": "The ticket's id: its reference, like `RF-7KQ2MX` (any case).",
            "schema": {
              "type": "string",
              "pattern": "^[Rr][Ff]-[A-Za-z0-9]{6}$"
            }
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "description": "The file's id (in the message's `files`).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`bad_gateway`: Something on our side didn't answer properly.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "support:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/files/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -OJ"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { writeFile } from \"node:fs/promises\";\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/files/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nawait writeFile(\"download\", Buffer.from(await res.arrayBuffer()));"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { writeFile } from \"node:fs/promises\";\nimport { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst res = await rf.tickets.files.download({\n  ticketRef: \"RF-7KQ2MX\",\n  fileId: \"5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\",\n});\nawait writeFile(\"download\", Buffer.from(await res.arrayBuffer()));"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/files/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nfile_put_contents('download', $body);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/tickets/RF-7KQ2MX/files/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nwith open(\"download\", \"wb\") as f:\n    f.write(response.content)"
          }
        ]
      }
    },
    "/sites/{siteId}/staging": {
      "get": {
        "operationId": "sitesStagingGet",
        "summary": "Get a site's staging",
        "description": "Returns the live site's staging: its copy (with its address, certificate and settings), the staging operation in progress (`activeRun`), the restore point kept from its last push (or undo), the last operations, and why a copy can't be created if it can't (`blockers`).\n\nPoll it to follow an operation in progress. It works whether or not staging is open to the account (`features.staging` in `GET /account`), so a push can always be undone.",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteStaging"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.staging.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "post": {
        "operationId": "sitesStagingCreate",
        "summary": "Create a staging copy",
        "description": "Makes a private copy of the live site on the same server (its files and its database), on its own address with a certificate, password protected, with outgoing email held and scheduled tasks paused. One copy per live site, included with the site.\n\n**What happens next.** The answer is `201` with the copy `installing` and the `create` operation in `activeRun`. It usually takes a few minutes, depending on the site's size. Poll `GET /sites/{siteId}/staging` every 10 seconds until `activeRun` is null; the operation is then first in `recentRuns`, `completed`, or `failed` with the reason in `lastError`.\n\n**Limits.** The site must be installed and its server running, with no other operation in progress. A site's copy can be created 3 times a week (`createsLeftThisWeek`), and an account's copies a few times a day: past that, `409 limit_reached` says when to try again. `blockers` in `GET /sites/{siteId}/staging` says what stands in the way.",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteStaging"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`not_supported`: The server's cloud doesn't offer this (for example, whole-server snapshots on Amazon EC2 and Google Cloud), or the server's kind or size doesn't allow it (Imunify360 on a server of your own, or under 2 GB of memory).\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.staging.create({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "delete": {
        "operationId": "sitesStagingDelete",
        "summary": "Delete the staging copy",
        "description": "Deletes the staging copy with its files, database and address. This can't be undone. The live site isn't changed, and the restore point of its last push stays until it expires.\n\nAnswers `202` with the copy `deleting` while it's removed from the server (usually under a minute; `copy` is then null). The server must be running, and no staging operation may be in progress (cancel it first).",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteStaging"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.staging.delete({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/staging/password-protection": {
      "get": {
        "operationId": "sitesStagingPasswordProtectionGet",
        "summary": "Get the staging copy's password",
        "description": "Returns the username and password visitors enter to see the staging copy while its password protection is on (`settings.protect`). It isn't the WordPress login: the copy's WordPress users and passwords are the live site's. Change them with `PUT /sites/{siteId}/staging/settings`. Every call is written to the token's activity.",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StagingPasswordProtection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`no_staging`: The site has no staging copy.\n\n`staging_unavailable`: The staging copy can't be used for this now: it's still being created, or it's being removed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:files"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/password-protection\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/password-protection\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.staging.passwordProtection.get({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/password-protection');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/password-protection\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/staging/settings": {
      "put": {
        "operationId": "sitesStagingUpdateSettings",
        "summary": "Change the staging copy's settings",
        "description": "Changes the copy's password protection (on or off, its username, a new password), whether its outgoing email is held, and whether its scheduled tasks run. Settings left out stay as they are.\n\nThe answer is the staging with `copy.settings.status: \"applying\"`; they're in place on the server within seconds (`applied`). Sending the settings it already has changes nothing and answers the staging as it is.",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StagingSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteStaging"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`no_staging`: The site has no staging copy.\n\n`staging_unavailable`: The staging copy can't be used for this now: it's still being created, or it's being removed.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/settings\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"protect\": true,\n  \"holdEmail\": true,\n  \"tasks\": false,\n  \"regeneratePassword\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/settings\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"protect\": true,\n    \"holdEmail\": true,\n    \"tasks\": false,\n    \"regeneratePassword\": true\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.staging.updateSettings({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  protect: true,\n  holdEmail: true,\n  tasks: false,\n  regeneratePassword: true,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/settings');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'protect' => true,\n        'holdEmail' => true,\n        'tasks' => false,\n        'regeneratePassword' => true,\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/settings\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"protect\": True,\n        \"holdEmail\": True,\n        \"tasks\": False,\n        \"regeneratePassword\": True,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/staging/actions/refresh": {
      "post": {
        "operationId": "sitesStagingRefresh",
        "summary": "Refresh the staging copy from the live site",
        "description": "Copies the live site into the staging copy again: everything, or only its files or its database (`parts`). What was on the copy is replaced, and can't be had back; the copy's settings stay as they are. The live site isn't changed.\n\n**What happens next.** The answer is `202` with the `refresh` operation in `activeRun`. It usually takes a few minutes. Poll `GET /sites/{siteId}/staging` every 10 seconds until `activeRun` is null; the operation is then first in `recentRuns`, `completed`, or `failed` with the reason in `lastError`. A refresh that fails leaves the copy as it was.",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StagingRefreshInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteStaging"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`no_staging`: The site has no staging copy.\n\n`staging_unavailable`: The staging copy can't be used for this now: it's still being created, or it's being removed.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/refresh\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"parts\": \"database\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/refresh\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"parts\": \"database\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.staging.refresh({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  parts: \"database\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/refresh');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'parts' => 'database',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/refresh\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"parts\": \"database\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/staging/preview": {
      "get": {
        "operationId": "sitesStagingPreview",
        "summary": "Check what a staging operation would do",
        "description": "Asks the server what an operation would do and need, before you start it (it takes a few seconds): the room it needs, what stands in the way (`blockers`), and for a push of the database what changed on the live site since the copy and which tables it would copy; for a push of the code, what's newer on the live site (`downgrades`, which the push needs in its `allowDowngrade`) and what it would remove.\n\nNothing is changed. Up to 10 previews a minute; not while a staging operation is running (`409 staging_busy`). When the server couldn't check, the answer is `503 try_again`.\n\nWhile staging is closed to the account (`features.staging` in `GET /account`), only an undo's preview works, so a push can always be checked and undone; the others answer `403 feature_unavailable`.",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "operation",
            "in": "query",
            "required": true,
            "description": "The operation to check: `create`, `refresh`, `push` or `undo`.",
            "schema": {
              "type": "string",
              "enum": [
                "create",
                "refresh",
                "push",
                "undo"
              ]
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "For a push: what it would copy, `code` (WordPress itself, plugins, themes, must-use plugins and languages), `database` (the database, and media added on the copy) or `everything` (both). Default `code`.",
            "schema": {
              "type": "string",
              "enum": [
                "code",
                "database",
                "everything"
              ]
            }
          },
          {
            "name": "parts",
            "in": "query",
            "required": false,
            "description": "For a refresh: what it would copy, `all` (the default), `files` or `database`.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "files",
                "database"
              ]
            }
          },
          {
            "name": "runId",
            "in": "query",
            "required": false,
            "description": "For an undo (and needed there): the restore point's `runId`.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "tables",
            "in": "query",
            "required": false,
            "description": "For a push of the database: the only tables it would copy, separated by commas.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_$]{1,64}(,[A-Za-z0-9_$]{1,64}){0,499}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StagingPreview"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`no_staging`: The site has no staging copy.\n\n`staging_unavailable`: The staging copy can't be used for this now: it's still being created, or it's being removed.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`staging_refused`: The site's server found something that stops this staging operation. `message` says what.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`server_unreachable`: The server didn't answer, or didn't finish the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`try_again`: It couldn't be started just now; nothing was changed.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/preview?operation=push&scope=everything\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/preview?operation=push&scope=everything\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.staging.preview({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  operation: \"push\",\n  scope: \"everything\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/preview?operation=push&scope=everything');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/preview\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"operation\": \"push\",\n        \"scope\": \"everything\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/staging/actions/push": {
      "post": {
        "operationId": "sitesStagingPush",
        "summary": "Push the staging copy to the live site",
        "description": "Copies the staging copy to the live site: its code (the default), its database with the media added on it, or everything (`scope`). What it replaces on the live site is kept as a restore point for 7 days, so the push can be undone with `POST /sites/{siteId}/staging/actions/undo-push`. A site keeps only its newest restore point: the next push or undo replaces it (and it's deleted by itself 7 days after it was made).\n\n**Idempotency-Key required.** A push or an undo done twice would discard the first one's restore point, so each needs an `Idempotency-Key` (`400 idempotency_key_required` without one): the same request sent again with the same key gets the first answer, and nothing is done twice.\n\nPushing the database replaces the live site's orders, users and posts made since the copy: check with `GET /sites/{siteId}/staging/preview?operation=push&scope=database` first. Plugins, themes or WordPress itself that are newer on the live site are put back to the copy's version only when named in `allowDowngrade`; otherwise the push fails, changing nothing.\n\n**What happens next.** The answer is `202` with the `push` operation in `activeRun`. It prepares everything first, while the live site keeps working (it can be cancelled then), and then switches the live site over in seconds. Poll `GET /sites/{siteId}/staging` every 10 seconds until `activeRun` is null; the operation is then first in `recentRuns`, `completed`, or `failed` with the reason in `lastError`. A push that fails leaves the live site as it was.",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: doing this twice isn't the same as doing it once. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StagingPushInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteStaging"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).\n\n`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`no_staging`: The site has no staging copy.\n\n`staging_unavailable`: The staging copy can't be used for this now: it's still being created, or it's being removed.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/push\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $KEY\" \\\n  -d '{\n  \"scope\": \"code\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/push\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify({\n    \"scope\": \"code\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.staging.push({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  scope: \"code\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/push');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'scope' => 'code',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/push\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json={\n        \"scope\": \"code\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/staging/actions/undo-push": {
      "post": {
        "operationId": "sitesStagingUndoPush",
        "summary": "Undo a push to the live site",
        "description": "Puts the live site back to its restore point: what the last push (or undo) replaced, kept for 7 days (`restorePoints` in `GET /sites/{siteId}/staging`). What changed on the live site since then is replaced; the undo keeps a restore point of its own, which takes the place of the one it used, so it can be undone too. A site keeps only its newest restore point: the next push or undo replaces it (and it's deleted by itself 7 days after it was made).\n\n**Idempotency-Key required.** A push or an undo done twice would discard the first one's restore point, so each needs an `Idempotency-Key` (`400 idempotency_key_required` without one): the same request sent again with the same key gets the first answer, and nothing is done twice.\n\n**What happens next.** The answer is `202` with the `undo` operation in `activeRun`. Poll `GET /sites/{siteId}/staging` every 10 seconds until `activeRun` is null; the operation is then first in `recentRuns`, `completed`, or `failed` with the reason in `lastError`. An undo that fails leaves the live site as it was. It works whether or not staging is open to the account.",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: doing this twice isn't the same as doing it once. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StagingUndoInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteStaging"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`bad_request`: The request can't be carried out as sent. `message` says why (for example, a site's built-in domain can't be removed).\n\n`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/undo-push\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $KEY\" \\\n  -d '{\n  \"runId\": \"7f1e2d3c-4b5a-4968-8776-655443322110\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/undo-push\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify({\n    \"runId\": \"7f1e2d3c-4b5a-4968-8776-655443322110\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.staging.undoPush({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  runId: \"7f1e2d3c-4b5a-4968-8776-655443322110\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/undo-push');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'runId' => '7f1e2d3c-4b5a-4968-8776-655443322110',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/undo-push\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json={\n        \"runId\": \"7f1e2d3c-4b5a-4968-8776-655443322110\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/staging/actions/cancel": {
      "post": {
        "operationId": "sitesStagingCancel",
        "summary": "Cancel the staging operation in progress",
        "description": "Stops the staging operation in progress while it's still waiting or preparing (`cancellable` on `activeRun`): nothing has been changed then. Once it's switching over (seconds), it can't be cancelled (`409 not_cancellable`). The answer is the staging; the operation ends as `cancelled` within moments.",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteStaging"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`not_cancellable`: It can't be cancelled now: it's being switched over (which takes seconds), or our team is putting it right.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/cancel\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/cancel\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.staging.cancel({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/cancel');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/actions/cancel\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/staging/restore-points/{runId}": {
      "delete": {
        "operationId": "sitesStagingRestorePointsDelete",
        "summary": "Delete a restore point",
        "description": "Deletes a restore point before it expires, freeing the room it takes on the server's disk. The push that made it can't be undone after this. The answer is the staging, with the restore point `discarding` until it's gone from the server. One being used by an undo, or kept while our team puts the site right, can't be deleted (`409 conflict`).",
        "tags": [
          "Staging"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The live site's id (never the staging copy's).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "The restore point's `runId`, from `restorePoints` in `GET /sites/{siteId}/staging`.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteStaging"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`staging_copy`: This site is a staging copy, which can't do this.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/restore-points/7f1e2d3c-4b5a-4968-8776-655443322110\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/restore-points/7f1e2d3c-4b5a-4968-8776-655443322110\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.staging.restorePoints.delete({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  runId: \"7f1e2d3c-4b5a-4968-8776-655443322110\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/restore-points/7f1e2d3c-4b5a-4968-8776-655443322110');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/restore-points/7f1e2d3c-4b5a-4968-8776-655443322110\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/clone": {
      "get": {
        "operationId": "sitesCloneOptions",
        "summary": "Get what cloning a site needs",
        "description": "Returns whether the site can be cloned (`blockers`), its size, the servers it can be cloned to (its own first) with the room on its own server, a name for the new site, the clone in progress and the latest clones.\n\nIt asks the site's server to measure the site, which takes a few seconds. A token limited to some servers sees only those as destinations, and only the clones into them (`active`, `recent`).",
        "tags": [
          "Cloning"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The id of the site to clone.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CloneSetup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.clone.options({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "post": {
        "operationId": "sitesCloneStart",
        "summary": "Clone a site",
        "description": "Copies the site (every file and its whole database) into a new site of its own, on the same server or another server of the account. The new site has the original's WordPress users, and keeps its own built-in address. The site you clone isn't changed. By default its PHP and resource settings, its firewall and its cron jobs (paused) are copied too (`options`).\n\n**What happens next.** The answer is `201` with the new site and the clone (`queued`), and the new site's address in `Location`. The new site is installed first, then the copy is made into it, usually in a few minutes. Poll `GET /sites/{siteId}/clone/status` with the new site's id every 10 seconds until `status` is `done`, `failed` (the reason in `lastError`) or `cancelled`.\n\n**Limits.** One clone of a site at a time. Not for staging copies, or sites still installing or busy; the destination server must be running, and the token must reach both servers. It counts as one of the hour's new sites (see [Rate limits](https://rabbitflare.com/docs/api/rate-limits)). Cloning a site that has Media Offload counts as setting Media Offload up (the clone gets it too if the site keeps some of its media only in storage when the copy is done): 200 a day per account (`429 rate_limited`; a day ends at 00:00 UTC).\n\n**Idempotency-Key required.** A request sent again (after a timeout, say) must never make a second site or start a second copy: each needs an `Idempotency-Key` (`400 idempotency_key_required` without one), the same request sent again with the same key gets the first answer, and nothing is made twice; while the first is still running, the same key answers `409 idempotency_in_progress` (try again in a moment).\n\n**Media Offload.** When the site being copied has Media Offload on (on, being set up, being turned off, or failed), the new site gets it too, billed by use after each month like turning it on (`POST /sites/{siteId}/media-offload/actions/enable`): so this also needs `billing:write` (`403 insufficient_scope` without it; `billing:write` is for tokens for all servers only, so a token limited to some servers is refused with `403 all_servers_required`) and the account's agreement to card charges, given once in the panel's Billing (`403 charges_not_authorized`). Nothing is made or changed then.",
        "tags": [
          "Cloning"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The id of the site to clone.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: doing this twice isn't the same as doing it once. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloneStartInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CloneStarted"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.\n\n`insufficient_scope`: The token lacks a scope this operation needs (`missingScopes`).\n\n`all_servers_required`: The token is limited to some servers, and this operation needs a token for all servers: it changes domains or Cloudflare, or reaches Mail or billing, none of which is tied to one server.\n\n`charges_not_authorized`: The account hasn't agreed to card charges yet.\n\n`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`cannot_clone`: The site can't be cloned right now. `message` says why (a staging copy, still installing, its server off, another operation running…).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`media_in_storage`: The site keeps some of its media only in Media Offload's storage, which a server of your own doesn't have.\n\n`clone_busy`: A clone of this site, or of a site on this server, is being made.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:create",
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $KEY\" \\\n  -d '{\n  \"name\": \"Shop copy\",\n  \"serverId\": \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  \"options\": {\n    \"noindex\": true\n  }\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify({\n    \"name\": \"Shop copy\",\n    \"serverId\": \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n    \"options\": {\n      \"noindex\": true\n    }\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.clone.start({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  name: \"Shop copy\",\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  options: {\n    noindex: true,\n  },\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Shop copy',\n        'serverId' => '3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d',\n        'options' => [\n            'noindex' => true,\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json={\n        \"name\": \"Shop copy\",\n        \"serverId\": \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n        \"options\": {\n            \"noindex\": True,\n        },\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/clone/room": {
      "get": {
        "operationId": "sitesCloneCheckRoom",
        "summary": "Check a server's room for a clone",
        "description": "Asks a destination server how much room it has for a clone of the site. Give the site's size from `GET /sites/{siteId}/clone` (`filesBytes`, `databaseBytes`) to have the room needed worked out and `fits` answered. A clone to another server needs more room there, as the site is packed and downloaded first. When the server doesn't answer, `unknown` is true; the clone checks again before copying.",
        "tags": [
          "Cloning"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The id of the site to clone.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "serverId",
            "in": "query",
            "required": true,
            "description": "The destination server's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "filesBytes",
            "in": "query",
            "required": false,
            "description": "The site's files in bytes (`sizes.filesBytes` in `GET /sites/{siteId}/clone`), to work out the room needed. Default 0.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10995116277760
            }
          },
          {
            "name": "databaseBytes",
            "in": "query",
            "required": false,
            "description": "The site's database in bytes (`sizes.databaseBytes`). Default 0.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10995116277760
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CloneRoom"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`trial_locked`: The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:create",
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone/room?serverId=3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d&filesBytes=48000000&databaseBytes=6400000\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone/room?serverId=3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d&filesBytes=48000000&databaseBytes=6400000\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.clone.checkRoom({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  serverId: \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n  filesBytes: 48000000,\n  databaseBytes: 6400000,\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone/room?serverId=3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d&filesBytes=48000000&databaseBytes=6400000');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone/room\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"serverId\": \"3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d\",\n        \"filesBytes\": \"48000000\",\n        \"databaseBytes\": \"6400000\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/clone/status": {
      "get": {
        "operationId": "sitesCloneStatus",
        "summary": "Get the clone of a new site",
        "description": "Returns the clone made into this new site: how far it has got, and once it's done, the notes, the check of the new site's pages and the files left out. `{siteId}` is the new site (a site that isn't a clone answers 404). Poll it to follow a clone in progress. For a token that can't reach the server of the site it was cloned from, `source` is null.",
        "tags": [
          "Cloning"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The id of the new site the clone is made into (`target.id`, or `site.id` in the answer that started it).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteClone"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/status\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/status\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.clone.status({ siteId: \"6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/status');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/status\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/clone/actions/cancel": {
      "post": {
        "operationId": "sitesCloneCancel",
        "summary": "Cancel a clone",
        "description": "Stops the clone being made into this new site, until it's being switched into it (`cancellable`). The answer is the clone; it ends as `cancelled` within moments, and the new site is then deleted. The site that was being copied isn't changed.",
        "tags": [
          "Cloning"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The id of the new site the clone is made into (`target.id`, or `site.id` in the answer that started it).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteClone"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`not_cancellable`: It can't be cancelled now: it's being switched over (which takes seconds), or our team is putting it right.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:create",
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/cancel\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/cancel\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.clone.cancel({ siteId: \"6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/cancel');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/cancel\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/clone/actions/retry": {
      "post": {
        "operationId": "sitesCloneRetry",
        "summary": "Try a failed clone again",
        "description": "Starts a failed clone again, into the same new site, from the original as it is now. The new site must be active and the original still there; otherwise delete the new site and clone again. The token must reach the original's server too, as starting the clone needed (`404 not_found` otherwise). Trying again a clone of a site that has Media Offload counts as setting Media Offload up, 200 a day per account (`429 rate_limited`).\n\n**What happens next.** The answer is `202` with the clone `queued`. Poll `GET /sites/{siteId}/clone/status` with the new site's id every 10 seconds until `status` is `done`, `failed` (the reason in `lastError`) or `cancelled`.\n\n**Idempotency-Key required.** A request sent again (after a timeout, say) must never make a second site or start a second copy: each needs an `Idempotency-Key` (`400 idempotency_key_required` without one), the same request sent again with the same key gets the first answer, and nothing is made twice; while the first is still running, the same key answers `409 idempotency_in_progress` (try again in a moment).\n\n**Media Offload.** When the site being copied has Media Offload on (on, being set up, being turned off, or failed), the new site gets it too, billed by use after each month like turning it on (`POST /sites/{siteId}/media-offload/actions/enable`): so this also needs `billing:write` (`403 insufficient_scope` without it; `billing:write` is for tokens for all servers only, so a token limited to some servers is refused with `403 all_servers_required`) and the account's agreement to card charges, given once in the panel's Billing (`403 charges_not_authorized`). Nothing is made or changed then.",
        "tags": [
          "Cloning"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The id of the new site the clone is made into (`target.id`, or `site.id` in the answer that started it).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: doing this twice isn't the same as doing it once. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteClone"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.\n\n`insufficient_scope`: The token lacks a scope this operation needs (`missingScopes`).\n\n`all_servers_required`: The token is limited to some servers, and this operation needs a token for all servers: it changes domains or Cloudflare, or reaches Mail or billing, none of which is tied to one server.\n\n`charges_not_authorized`: The account hasn't agreed to card charges yet.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`try_again`: It couldn't be started just now; nothing was changed.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:create",
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/retry\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Idempotency-Key: $KEY\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/retry\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Idempotency-Key\": idempotencyKey,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.clone.retry({ siteId: \"6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/retry');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/retry\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/rabbitpress": {
      "get": {
        "operationId": "sitesRabbitpressGet",
        "summary": "Get RabbitPress Cache on a site",
        "description": "Returns whether RabbitPress Cache, Rabbitflare's WordPress cache plugin, is installed on the site and which version (`version`, and `latestVersion`, the newest), whether the web server sends the site's cached pages itself (`serving`, or why not in `notServingReason`), whether an install or removal is running (`busy`), and whether the site needs one of your licences (`licenseRequired`: sites on servers of your own do). It's read from the site's server each time, so it takes a second or two and counts as a heavy request; `blockedReason` says when it can't be installed or removed here.",
        "tags": [
          "RabbitPress Cache"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteRabbitPress"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.rabbitpress.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "put": {
        "operationId": "sitesRabbitpressInstall",
        "summary": "Install or update RabbitPress Cache on a site",
        "description": "Installs RabbitPress Cache on the site, or updates it to the newest version, and activates it. It's included on servers Rabbitflare creates. A site on a server of your own needs one of your RabbitPress Cache licences: pass its `licenseId` (bought in the panel), or leave it out to keep the licence the site used before.\n\n**What happens next.** The answer is `202` with `busy: true`: the plugin is installed on the site's server, usually within a minute or two. Poll `GET /sites/{siteId}/rabbitpress` until `busy` is false: `installed` and `version` then show it, and `lastError` says why if it didn't finish. If the newest version is installed already (with the same licence), nothing is done and the answer is `200`.\n\n**Limits.** Live sites only, not staging copies (`409 site_unavailable`), on a running server (`409 server_unavailable`); one change at a time per site (`409 busy`). An account installs or updates up to 20 times an hour (`429 rate_limited`: `Retry-After` says when the hour's window ends).",
        "tags": [
          "RabbitPress Cache"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RabbitPressInstallInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteRabbitPress"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteRabbitPress"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "`license_required`: The site is on a server of your own, so RabbitPress Cache needs one of your licences there.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({}),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.rabbitpress.install({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode(new stdClass()),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={},\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "delete": {
        "operationId": "sitesRabbitpressRemove",
        "summary": "Remove RabbitPress Cache from a site",
        "description": "Deactivates RabbitPress Cache and deletes it from the site: its pages are no longer cached. A site on a server of your own keeps its licence for a later install (release it in the panel to use it on another website).\n\n**What happens next.** The answer is `202` with `busy: true`: the plugin is removed on the site's server, usually within a minute. Poll `GET /sites/{siteId}/rabbitpress` until `busy` is false. When the site's server says the plugin isn't installed and it serves none of the site's pages from the cache (`serving: false`), nothing is done and the answer is `200`.\n\n**Limits.** Live sites only, not staging copies (`409 site_unavailable`), on a running server (`409 server_unavailable`); one change at a time per site (`409 busy`).",
        "tags": [
          "RabbitPress Cache"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteRabbitPress"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteRabbitPress"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_unavailable`: The server isn't in a state that allows this (for example, it's off or still being set up).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`conflict`: This clashes with something that exists, or is already done (for example, a domain already connected to a site).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.rabbitpress.remove({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/rabbitpress\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/media-offload": {
      "get": {
        "operationId": "sitesMediaOffloadGet",
        "summary": "Get Media Offload on a site",
        "description": "Returns Media Offload on the site: whether it's on (`status`, or why it can't be in `blockedReason`), its settings, what storage holds (`stored`, by kind in `kinds`), files waiting to be copied or kept on the server, the delivery check, the operation running now (`run`) and earlier ones, and the storage included with the site's server (`allowance`; this month's amount so far needs `billing:read`). Figures are as the site's server last reported them (`reportedAt`), every few minutes. It can be read while Media Offload isn't open to the account too, so a site that has it can still be turned off.",
        "tags": [
          "Media Offload"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.mediaOffload.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/media-offload/actions/inspect": {
      "post": {
        "operationId": "sitesMediaOffloadInspect",
        "summary": "See what turning on Media Offload would move",
        "description": "Reads the site's media library on its server and says what turning Media Offload on (with the settings given) would move to storage, by kind of file; what would stay on the server, by reason, with the largest folders kept; the server's disk; and anything that stands in the way (`problems`, and other media offload plugins in `conflictingPlugins`). It changes nothing. A large library takes a while (up to a few minutes); an inspection with the same settings is kept 5 minutes (`fresh: true` reads it again). Up to 10 a minute.",
        "tags": [
          "Media Offload"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaOffloadInspectInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaOffloadInspection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/inspect\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/inspect\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({}),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.mediaOffload.inspect({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/inspect');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode(new stdClass()),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/inspect\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={},\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/media-offload/actions/enable": {
      "post": {
        "operationId": "sitesMediaOffloadEnable",
        "summary": "Turn on Media Offload for a site",
        "description": "Turns Media Offload on: the site's media library is kept in Rabbitflare's cloud storage, and every file keeps its address, so visitors and WordPress see no change. Each server Rabbitflare creates includes storage shared by its sites (`allowance`).\n\n**Payment.** Storage beyond what the server includes is billed by use after each month ends, at the price in `allowance.extraCentsPerGbMonth`: the month's bill is paid from the wallet first, then the account's saved card, with no one on a page. So turning it on needs `billing:write` as well as `sites:write` (`403 insufficient_scope` without it, and nothing changes; `billing:write` is for tokens for all servers only: `403 all_servers_required`), the account's agreement to card charges, given once in the panel's Billing (`403 charges_not_authorized`), and an `Idempotency-Key` header.\n\n**What happens next.** The answer is `202` with `status: \"setting_up\"`: storage is readied, the site's server is set up and its delivery checked, then the whole library is copied. Poll `GET /sites/{siteId}/media-offload` until `status` is `active`. If setting up fails, `status` is `failed` with the reason in `lastError`: try again (`POST …/actions/retry-setup`) or cancel it (`POST …/actions/cancel-setup`). On already with these settings: nothing changes and the answer is `200`. To change the settings of a site where it's on, use `PUT …/media-offload/settings`.\n\n**Limits.** Sites on servers Rabbitflare creates, not trial servers, staging copies or sites still installing (`409 site_unavailable`: `blockedReason` says why). Not while a Media Offload bill is unpaid (`402 unpaid`). `POST …/actions/inspect` shows first what would move. Up to 20 changes a minute on the account (`429 rate_limited`). Setting Media Offload up for a site and taking it away (turning it on or off, a setup tried again or cancelled, a restore that turns it off after, cloning a site that has it) is limited to 200 a day per account (`429 rate_limited`; a day ends at 00:00 UTC).",
        "tags": [
          "Media Offload"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: this operation spends money. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of paying twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaOffloadEnableInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "`unpaid`: A Media Offload bill is unpaid, so it can't be turned on for a site.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.\n\n`charges_not_authorized`: The account hasn't agreed to card charges yet.\n\n`all_servers_required`: The token is limited to some servers, and this operation needs a token for all servers: it changes domains or Cloudflare, or reaches Mail or billing, none of which is tied to one server.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`already_on`: Media Offload is on for the site already (or being turned off).\n\n`purging`: The files the site had in storage before are still being removed.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write",
          "billing:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": true,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/enable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $KEY\" \\\n  -d '{}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/enable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify({}),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.mediaOffload.enable({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/enable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n    CURLOPT_POSTFIELDS => json_encode(new stdClass()),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/enable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json={},\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/media-offload/settings": {
      "put": {
        "operationId": "sitesMediaOffloadUpdateSettings",
        "summary": "Set Media Offload's settings for a site",
        "description": "Replaces the site's Media Offload settings: the mode (`copy`, or `free` to free up disk), how long new files stay on the server before that, the kinds of files kept in storage, and folders kept on the server. Every setting is required.\n\n**What happens next.** The answer is `202` with `settingsStatus: \"applying\"`: the site's server gets them within a minute, and files they newly include are copied. The settings it has already: nothing changes and the answer is `200` (settings that failed to apply are applied again).\n\n**Limits.** Media Offload must be on (`409 not_on`). Up to 20 changes a minute on the account (`429 rate_limited`).",
        "tags": [
          "Media Offload"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaOffloadSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_on`: Media Offload or Rabbitflare SMTP isn't on for the site, and this needs it.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/settings\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"mode\": \"free\",\n  \"freeAfterDays\": 14,\n  \"kinds\": [\n    \"image\",\n    \"video\",\n    \"document\"\n  ],\n  \"keep\": []\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/settings\", {\n  method: \"PUT\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"mode\": \"free\",\n    \"freeAfterDays\": 14,\n    \"kinds\": [\n      \"image\",\n      \"video\",\n      \"document\"\n    ],\n    \"keep\": []\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.mediaOffload.updateSettings({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  mode: \"free\",\n  freeAfterDays: 14,\n  kinds: [\"image\", \"video\", \"document\"],\n  keep: [],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/settings');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'mode' => 'free',\n        'freeAfterDays' => 14,\n        'kinds' => [\n            'image',\n            'video',\n            'document',\n        ],\n        'keep' => [],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/settings\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"mode\": \"free\",\n        \"freeAfterDays\": 14,\n        \"kinds\": [\n            \"image\",\n            \"video\",\n            \"document\",\n        ],\n        \"keep\": [],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/media-offload/runs": {
      "post": {
        "operationId": "sitesMediaOffloadRunsStart",
        "summary": "Start a Media Offload operation on a site",
        "description": "Starts an operation on the site's offloaded media: `sync` copies files that aren't in storage yet (new uploads are copied within a minute or two by themselves), `free` removes the server's copies of files storage holds (free up disk only), `verify` checks every file in storage and repairs what it can, `restore` brings every file back to the server, and `export` prepares one download of the whole media library (from the panel's Offload tab).\n\n**What happens next.** The answer is `202` with the operation in `run` (`status: \"queued\"`, then `running` with its progress). Poll `GET /sites/{siteId}/media-offload` until it's done: it then moves to `recentRuns`. A `restore` first switches the site to Copy mode, so files aren't removed again; with `turnOffAfter: true`, Media Offload is turned off once every file is back. A `restore` works while Media Offload isn't open to the account too, as it only brings files back.\n\n**Idempotency-Key required.** Doing one twice isn't doing it once: each `export` makes another copy of the whole library, kept 7 days in storage. So each request needs an `Idempotency-Key` (`400 idempotency_key_required` without one): the same request sent again with the same key gets the first answer, and nothing is started twice.\n\n**Limits.** Media Offload must be on (`409 not_on`), and one operation runs at a time per site (`409 busy`). `free` needs free up disk mode (`409 copy_mode`); `free` and `restore` wait for a staging operation on the site to finish (`409 staging_busy`). Up to 20 changes a minute on the account (`429 rate_limited`). Setting Media Offload up for a site and taking it away (turning it on or off, a setup tried again or cancelled, a restore that turns it off after, cloning a site that has it) is limited to 200 a day per account (`429 rate_limited`; a day ends at 00:00 UTC).",
        "tags": [
          "Media Offload"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: doing this twice isn't the same as doing it once. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaOffloadRunInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_on`: Media Offload or Rabbitflare SMTP isn't on for the site, and this needs it.\n\n`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`copy_mode`: Freeing up disk needs Media Offload's free up disk mode, and the site is in Copy mode.\n\n`staging_busy`: A staging operation is running on this site, or on a site of this server.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/runs\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $KEY\" \\\n  -d '{\n  \"operation\": \"verify\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/runs\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify({\n    \"operation\": \"verify\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.mediaOffload.runs.start({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  operation: \"verify\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/runs');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'operation' => 'verify',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/runs\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json={\n        \"operation\": \"verify\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/media-offload/runs/{runId}/actions/cancel": {
      "post": {
        "operationId": "sitesMediaOffloadRunsCancel",
        "summary": "Stop a Media Offload operation",
        "description": "Stops an operation that's queued or running: within a few seconds it's `cancelled` (`stage` says `Stopping…` until then), and what it did so far stays done. `409 not_running` when it has finished already; `404` when the site has no operation with that id. It works while Media Offload isn't open to the account too, as it only takes something away.",
        "tags": [
          "Media Offload"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "The operation's id (`run.id` in the view).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_running`: The Media Offload operation has finished already.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/runs/d5e6f7a8-9b0c-4d1e-8f2a-3b4c5d6e7f80/actions/cancel\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/runs/d5e6f7a8-9b0c-4d1e-8f2a-3b4c5d6e7f80/actions/cancel\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.mediaOffload.runs.cancel({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  runId: \"d5e6f7a8-9b0c-4d1e-8f2a-3b4c5d6e7f80\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/runs/d5e6f7a8-9b0c-4d1e-8f2a-3b4c5d6e7f80/actions/cancel');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/runs/d5e6f7a8-9b0c-4d1e-8f2a-3b4c5d6e7f80/actions/cancel\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/media-offload/actions/retry-setup": {
      "post": {
        "operationId": "sitesMediaOffloadRetrySetup",
        "summary": "Try setting up Media Offload again",
        "description": "Tries setting Media Offload up again after it failed (`status: \"failed\"`). The answer is `202` with `status: \"setting_up\"`; poll `GET /sites/{siteId}/media-offload` until it's `active`. `409 not_failed` when there's nothing to try again; `409 site_unavailable` when the site can't have it now (`blockedReason`). Up to 20 changes a minute on the account (`429 rate_limited`). Setting Media Offload up for a site and taking it away (turning it on or off, a setup tried again or cancelled, a restore that turns it off after, cloning a site that has it) is limited to 200 a day per account (`429 rate_limited`; a day ends at 00:00 UTC).\n\n**Scopes and card charges.** Set up, it's billed by use after each month, as turning it on is: it needs `billing:write` as well as `sites:write` (`403 insufficient_scope` without it; `billing:write` is for tokens for all servers only, so a token limited to some servers is refused with `403 all_servers_required`), and the account's agreement to card charges, given once in the panel's Billing (`403 charges_not_authorized`, and nothing changes).",
        "tags": [
          "Media Offload"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.\n\n`charges_not_authorized`: The account hasn't agreed to card charges yet.\n\n`all_servers_required`: The token is limited to some servers, and this operation needs a token for all servers: it changes domains or Cloudflare, or reaches Mail or billing, none of which is tied to one server.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_failed`: Setting up Media Offload didn't fail, so there's nothing to try again or cancel.\n\n`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write",
          "billing:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/retry-setup\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/retry-setup\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.mediaOffload.retrySetup({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/retry-setup');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/retry-setup\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/media-offload/actions/cancel-setup": {
      "post": {
        "operationId": "sitesMediaOffloadCancelSetup",
        "summary": "Cancel a Media Offload setup that failed",
        "description": "Gives up on a setup that failed (`status: \"failed\"`): what was set up is taken away, and Media Offload goes back to off. The answer is `202` with `status: \"turning_off\"`, then `off`. `409 not_failed` unless setting up failed. It works while Media Offload isn't open to the account too, as it only takes something away. Up to 20 changes a minute on the account (`429 rate_limited`). Setting Media Offload up for a site and taking it away (turning it on or off, a setup tried again or cancelled, a restore that turns it off after, cloning a site that has it) is limited to 200 a day per account (`429 rate_limited`; a day ends at 00:00 UTC).",
        "tags": [
          "Media Offload"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_failed`: Setting up Media Offload didn't fail, so there's nothing to try again or cancel.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/cancel-setup\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/cancel-setup\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.mediaOffload.cancelSetup({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/cancel-setup');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/cancel-setup\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/media-offload/actions/disable": {
      "post": {
        "operationId": "sitesMediaOffloadDisable",
        "summary": "Turn off Media Offload for a site",
        "description": "Turns Media Offload off: the site serves every file from its server again. Storage keeps the site's files 7 days, so turning it on again soon finds them there; then they're deleted. It works while Media Offload isn't open to the account too, as it only takes something away.\n\n**What happens next.** The answer is `202` with `status: \"turning_off\"`, then `off`. Off already (or being turned off): nothing changes and the answer is `200`.\n\n**Limits.** Every file must be on the server: with files only in storage (free up disk mode, `stored.freedFiles`), it's refused (`409 files_in_storage`). Start a `restore` operation with `turnOffAfter: true` instead: it brings them back, then turns Media Offload off. Not while an operation runs (`409 busy`). A setup that failed is cancelled with `POST …/actions/cancel-setup`. Up to 20 changes a minute on the account (`429 rate_limited`). Setting Media Offload up for a site and taking it away (turning it on or off, a setup tried again or cancelled, a restore that turns it off after, cloning a site that has it) is limited to 200 a day per account (`429 rate_limited`; a day ends at 00:00 UTC).",
        "tags": [
          "Media Offload"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteMediaOffload"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_on`: Media Offload or Rabbitflare SMTP isn't on for the site, and this needs it.\n\n`files_in_storage`: Some of the site's files are only in storage (free up disk), so Media Offload can't be turned off yet. `message` says how many.\n\n`busy`: Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): `message` says what.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.mediaOffload.disable({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/media-offload/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/smtp": {
      "get": {
        "operationId": "sitesSmtpGet",
        "summary": "Get Rabbitflare SMTP on a site",
        "description": "Returns Rabbitflare SMTP on the site: whether it's on (`status`, `enabled`) or stopped (`hold`), whether the account may turn it on (`eligible`), the sender recipients see (`from`), the limits and what the site sent against them (`usage`), its notice and reply addresses, and its latest emails with what happened to each (`recentEmails`). The emails' recipients and subjects and the team's sign-in addresses are people's details, so every call is written to the token's request log.",
        "tags": [
          "Rabbitflare SMTP"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.smtp.get({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/smtp/actions/enable": {
      "post": {
        "operationId": "sitesSmtpEnable",
        "summary": "Turn on Rabbitflare SMTP for a site",
        "description": "Turns Rabbitflare SMTP on: WordPress's own emails (password resets, new accounts, account changes, admin notices and order emails) are sent through Rabbitflare, from the address in `from`. Turning it on is included. Each site sends a number of emails a day included (`limits`); once the account has bought email credit in the panel, emails beyond the included ones are paid from it, and without credit they're refused (`no_credit` in `recentEmails`).\n\n**What happens next.** The answer is `202` with `status: \"setting_up\"`: the site's server is set up, usually within a minute. Poll `GET /sites/{siteId}/smtp` until `status` is `on`; `failed` comes with the reason in `lastError` (turn it on again to retry). On already: the answer is `200` as it is.\n\n**Limits.** The site's server must be paid and running, not a free trial, and the account's email address confirmed (`409 not_eligible`; `eligible` says why); not for staging copies or sites still installing (`409 site_unavailable`). A stop on the site is lifted only as `hold` says (`409 paused`, `checking` or `suspended`). A site's first 14 days have lower limits. Up to 30 changes a minute.\n\nThe answer is the site's view, as `GET /sites/{siteId}/smtp` gives it to a token with `sites:read`. Without `sites:read`, it leaves out people's details: whom the site's recent emails went to (`recentEmails` and `suggestedNoticeAddresses` are empty), the sign-in addresses of the account's owner and team (`addresses` holds only the ones added to the site) and what the site sent (`usage` is null). Every call is written to the token's request log.",
        "tags": [
          "Rabbitflare SMTP"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`site_unavailable`: The site isn't in a state that allows this (for example, it's still installing).\n\n`not_eligible`: The account can't use Rabbitflare SMTP for this site: it needs a paid, running server (not a free trial) and a confirmed account email address.\n\n`account_off`: Rabbitflare SMTP is switched off for this account for good.\n\n`paused`: Email from this site is paused, by an automatic safety check or by Rabbitflare's team.\n\n`checking`: The site's Rabbitflare SMTP plugin file is being checked, and its emails are stopped meanwhile.\n\n`suspended`: Email from this site is suspended.\n\n`temporary`: Something couldn't be checked just now.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`apply_failed`: Rabbitflare SMTP couldn't be started on the site's server just now.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/enable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/enable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.smtp.enable({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/enable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/enable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/smtp/actions/disable": {
      "post": {
        "operationId": "sitesSmtpDisable",
        "summary": "Turn off Rabbitflare SMTP for a site",
        "description": "Turns Rabbitflare SMTP off: its plugin is removed from the site, and WordPress sends emails as it did before. A stop on the site (`hold`) stays. The answer is `202` with `status: \"turning_off\"`, then `off`; off already, the answer is `200` as it is. It works while Rabbitflare SMTP isn't open to the account too, as it only takes something away (then a site where it's off already answers `409 not_on`). Up to 30 changes a minute.\n\nThe answer is the site's view, as `GET /sites/{siteId}/smtp` gives it to a token with `sites:read`. Without `sites:read`, it leaves out people's details: whom the site's recent emails went to (`recentEmails` and `suggestedNoticeAddresses` are empty), the sign-in addresses of the account's owner and team (`addresses` holds only the ones added to the site) and what the site sent (`usage` is null). Every call is written to the token's request log.",
        "tags": [
          "Rabbitflare SMTP"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work goes on after this answer. Follow it by reading the resource again.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_on`: Media Offload or Rabbitflare SMTP isn't on for the site, and this needs it.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`apply_failed`: Rabbitflare SMTP couldn't be started on the site's server just now.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": true,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/disable\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/disable\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.smtp.disable({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/disable');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/disable\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/smtp/actions/resume": {
      "post": {
        "operationId": "sitesSmtpResume",
        "summary": "Turn Rabbitflare SMTP on again after a pause",
        "description": "Lifts a first automatic pause on the site's emails, once `hold.canResume` is true (an hour after the pause): check first what the site sends and to whom. Only a first pause can be lifted this way; others only by Rabbitflare support (`409 cannot_resume`, with the reason). `409 not_held` when the site's emails aren't stopped.\n\nThe answer is the site's view, as `GET /sites/{siteId}/smtp` gives it to a token with `sites:read`. Without `sites:read`, it leaves out people's details: whom the site's recent emails went to (`recentEmails` and `suggestedNoticeAddresses` are empty), the sign-in addresses of the account's owner and team (`addresses` holds only the ones added to the site) and what the site sent (`usage` is null). Every call is written to the token's request log.",
        "tags": [
          "Rabbitflare SMTP"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_held`: Email from the site isn't stopped.\n\n`cannot_resume`: The stop on the site's emails can't be lifted this way now. `message` says why: too soon after the pause, or only support can lift it.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/resume\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/resume\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.smtp.resume({ siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/resume');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/resume\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/smtp/addresses": {
      "post": {
        "operationId": "sitesSmtpAddressesAdd",
        "summary": "Add a notice or reply address to a site's SMTP",
        "description": "Adds an address to the site's Rabbitflare SMTP: a `notice` address admin notices may go to, or the `reply` address the site's emails carry. A confirmation email is sent to it, and it's used once its owner confirms it from the link.\n\nThe answer is `201` with the view, the new address in `addresses`; its `Location` is the address (`GET /sites/{siteId}/smtp/addresses/{addressId}`). An address the site has already that's still waiting for its owner gets its confirmation email again, with a new link, and nothing is added: the answer is `200`. One confirmed already (the account's own addresses are): nothing is sent and the answer is `200`.\n\n**Idempotency-Key required.** Each confirmation email has a new link (the one before stops working) and counts in the account's 3 a day, so a request sent again must not send another: each needs an `Idempotency-Key` (`400 idempotency_key_required` without one), and the same request sent again with the same key gets the first answer.\n\n**Limits.** Rabbitflare SMTP must have been turned on for the site (`409 not_on`). Up to 5 added notice addresses (`409 too_many_addresses`) and one reply address (`409 reply_exists`) per site. An account sends up to 3 confirmation emails in 24 hours (`429 rate_limited`: `Retry-After` says when the oldest of them is a day old).\n\n**Scopes.** It needs `sites:read` as well as `sites:write` (`403 insufficient_scope` without it): whether an address is new (`201`) or one the site has already (`200`), the account's own sign-in addresses included, is what `sites:read` shows. The answer is the site's whole view, and every call is written to the token's request log.",
        "tags": [
          "Rabbitflare SMTP"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: doing this twice isn't the same as doing it once. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmtpAddressInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`not_on`: Media Offload or Rabbitflare SMTP isn't on for the site, and this needs it.\n\n`too_many_addresses`: The site has as many notice addresses as it can have.\n\n`reply_exists`: The site has a reply address already.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`email_failed`: The email couldn't be sent just now.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write",
          "sites:read"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: $KEY\" \\\n  -d '{\n  \"kind\": \"notice\",\n  \"address\": \"shop.manager@example.com\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify({\n    \"kind\": \"notice\",\n    \"address\": \"shop.manager@example.com\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.smtp.addresses.add({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  kind: \"notice\",\n  address: \"shop.manager@example.com\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'kind' => 'notice',\n        'address' => 'shop.manager@example.com',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json={\n        \"kind\": \"notice\",\n        \"address\": \"shop.manager@example.com\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/smtp/addresses/{addressId}/actions/send-confirmation": {
      "post": {
        "operationId": "sitesSmtpAddressesSendConfirmation",
        "summary": "Send an address's confirmation email again",
        "description": "Sends the confirmation email to an address that isn't confirmed yet, with a new link (the one sent before stops working). `409 already_confirmed` when it's confirmed; the account's own addresses need none (`409 own_address`). An account sends up to 3 confirmation emails in 24 hours (`429 rate_limited`: `Retry-After` says when the oldest of them is a day old).\n\n**Idempotency-Key required.** A request sent again must not send another email: each needs an `Idempotency-Key` (`400 idempotency_key_required` without one), and the same request sent again with the same key gets the first answer.\n\nThe answer is the site's view, as `GET /sites/{siteId}/smtp` gives it to a token with `sites:read`. Without `sites:read`, it leaves out people's details: whom the site's recent emails went to (`recentEmails` and `suggestedNoticeAddresses` are empty), the sign-in addresses of the account's owner and team (`addresses` holds only the ones added to the site) and what the site sent (`usage` is null). Every call is written to the token's request log.",
        "tags": [
          "Rabbitflare SMTP"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "The address's id (`addresses[].id` in the view).",
            "schema": {
              "type": "string",
              "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9._:@+-]{1,128}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required: doing this twice isn't the same as doing it once. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`already_confirmed`: The address is confirmed already.\n\n`own_address`: That address is one of your own, which can't be used here: a site's firewall can't block its server's own IP address (WordPress needs to reach itself), and the account's own email addresses can't be changed.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`email_failed`: The email couldn't be sent just now.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nKEY=$(uuidgen)\ncurl -X POST \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e/actions/send-confirmation\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Idempotency-Key: $KEY\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "import { randomUUID } from \"node:crypto\";\n\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nconst idempotencyKey = randomUUID();\n\nconst res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e/actions/send-confirmation\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Idempotency-Key\": idempotencyKey,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\n// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.\nconst data = await rf.sites.smtp.addresses.sendConfirmation({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  addressId: \"7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n// Keep this key when you send the same request again (after a timeout, say), so it's only done once.\n$idempotencyKey = bin2hex(random_bytes(16));\n\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e/actions/send-confirmation');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Idempotency-Key: ' . $idempotencyKey,\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport uuid\n\nimport requests\n\n# Keep this key when you send the same request again (after a timeout, say), so it's only done once.\nidempotency_key = str(uuid.uuid4())\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e/actions/send-confirmation\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n        \"Idempotency-Key\": idempotency_key,\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/sites/{siteId}/smtp/addresses/{addressId}": {
      "delete": {
        "operationId": "sitesSmtpAddressesRemove",
        "summary": "Remove an address from a site's SMTP",
        "description": "Removes an address added to the site: admin notices stop going to it, and a reply address stops being used at once. Answers the view without it. The account's own addresses can't be removed (`409 own_address`): a team member's goes when they leave the team. It works while Rabbitflare SMTP isn't open to the account too, as it only takes something away.\n\nThe answer is the site's view, as `GET /sites/{siteId}/smtp` gives it to a token with `sites:read`. Without `sites:read`, it leaves out people's details: whom the site's recent emails went to (`recentEmails` and `suggestedNoticeAddresses` are empty), the sign-in addresses of the account's owner and team (`addresses` holds only the ones added to the site) and what the site sent (`usage` is null). Every call is written to the token's request log.",
        "tags": [
          "Rabbitflare SMTP"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "The address's id (`addresses[].id` in the view).",
            "schema": {
              "type": "string",
              "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9._:@+-]{1,128}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteSmtp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`own_address`: That address is one of your own, which can't be used here: a site's firewall can't block its server's own IP address (WordPress needs to reach itself), and the account's own email addresses can't be changed.\n\n`server_restoring`: The server is being restored, and nothing else can change it or its sites until that's done.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.smtp.addresses.remove({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  addressId: \"6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "get": {
        "operationId": "sitesSmtpAddressesGet",
        "summary": "Get an address of a site's SMTP",
        "description": "Returns one of the site's notice and reply addresses, as in `addresses` of the view: whether its owner confirmed it, and when its confirmation email was last sent. It's where `POST /sites/{siteId}/smtp/addresses` points (`Location`). An address that isn't the site's answers `404`. It holds a person's address, so every call is written to the token's request log.",
        "tags": [
          "Rabbitflare SMTP"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "description": "The site's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "The address's id (`addresses[].id` in the view).",
            "schema": {
              "type": "string",
              "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9._:@+-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SmtpAddress"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`feature_unavailable`: This product isn't open to the account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "sites:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.sites.smtp.addresses.get({\n  siteId: \"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n  addressId: \"7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/addresses/7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/events": {
      "get": {
        "operationId": "eventsList",
        "summary": "List events",
        "description": "Lists what happened on the account, newest first: the same events webhooks send, with the same ids. Use it to catch up after downtime, or instead of webhooks when polling suits you better.\n\nOnly public event types are listed (see `GET /webhooks/event-types`), and only those the token may see: each type needs its group's read scope (`servers:read` for server events, `sites:read` for site events, `account:read` for API events). A token limited to some servers sees the events of those servers, and events of the account as a whole.\n\nFilter by `type` (comma-separated; `server.*` for a family), `serverId`, `siteId`, `level`, and a time range with `since` and `until`. Pages are stable: an event that happens while you page never makes another one repeat. Events are ordered by when they started being recorded, so an event can appear a few seconds after newer ones.",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only events of these types: one or more, separated by commas. A type ending in `.*` matches its whole family (`server.*`).",
            "schema": {
              "type": "string",
              "maxLength": 1000,
              "pattern": "^[a-z_]+(\\.[a-z_]+|\\.\\*)?(,[a-z_]+(\\.[a-z_]+|\\.\\*)?)*$"
            }
          },
          {
            "name": "serverId",
            "in": "query",
            "required": false,
            "description": "Only events about this server (and its sites).",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "siteId",
            "in": "query",
            "required": false,
            "description": "Only events about this site.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "description": "Only events of this level.",
            "schema": {
              "type": "string",
              "enum": [
                "info",
                "success",
                "warning",
                "error"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only events from this time on (inclusive).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Only events before this time.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "events:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/events?type=site.*&limit=25\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/events?type=site.*&limit=25\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.events.list({ type: \"site.*\", limit: 25 })) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/events?type=site.*&limit=25');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/events\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"type\": \"site.*\",\n        \"limit\": \"25\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/events/{eventId}": {
      "get": {
        "operationId": "eventsGet",
        "summary": "Get an event",
        "description": "Returns one event, by the id a list or a webhook gave you.\n\nOnly public event types are listed (see `GET /webhooks/event-types`), and only those the token may see: each type needs its group's read scope (`servers:read` for server events, `sites:read` for site events, `account:read` for API events). A token limited to some servers sees the events of those servers, and events of the account as a whole. An event the token may not see answers `404 not_found`.",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "description": "The event's id (a webhook payload's `id`).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "events:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/events/5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/events/5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.events.get({ eventId: \"5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60\" });\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/events/5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/events/5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/webhooks/event-types": {
      "get": {
        "operationId": "webhooksEventTypesList",
        "summary": "List event types",
        "description": "Lists every event type that can be sent to a webhook endpoint (and listed by `GET /events`), with its group and what it means. Any valid token can read it.\n\nNew types are added over time; your receiver should accept, and may ignore, types it doesn't know.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "type",
                "category"
              ],
              "default": "type"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Only the types of this group.",
            "schema": {
              "type": "string",
              "enum": [
                "servers",
                "sites",
                "backups",
                "staging",
                "malware",
                "support",
                "api"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EventType"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/webhooks/event-types?category=sites\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/event-types?category=sites\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.webhooks.eventTypes.list({ category: \"sites\" })) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/event-types?category=sites');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/webhooks/event-types\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"category\": \"sites\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/webhooks/endpoints": {
      "get": {
        "operationId": "webhooksEndpointsList",
        "summary": "List webhook endpoints",
        "description": "Lists the account's webhook endpoints (at most 10), newest first. Never their signing secrets.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "url"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only endpoints with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "enabled",
                "disabled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookEndpoint"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/webhooks/endpoints\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/endpoints\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.webhooks.endpoints.list()) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/endpoints');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/webhooks/endpoints\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      },
      "post": {
        "operationId": "webhooksEndpointsCreate",
        "summary": "Add a webhook endpoint",
        "description": "Adds a URL of yours that events are sent to as they happen. The answer carries the endpoint's signing secret, **this once**: keep it where your receiver can read it, and check every call's `Rabbitflare-Signature` header with it.\n\nThe URL must be https on port 443 or 8443, with a domain name (not an IP address) whose addresses are on the public internet; it's checked now and again before every call. Events that happen from now on are sent; earlier ones are not. Test it with `POST /webhooks/endpoints/{endpointId}/actions/send-test`.\n\nAn endpoint made or changed with a token can only be sent event types the token may read: each type needs its group's read scope (`servers:read` for server events, `sites:read` for site events, `account:read` for API events), otherwise `403 insufficient_scope`. `[\"*\"]` needs the read scope of every group sent today (`servers:read`, `sites:read`, `support:read` and `account:read`); a type added later is sent to it only if its token may read it. A token limited to some servers can only make endpoints limited to those servers: send `serverIds` with only them (`serverIds` sent without `allServers` means `allServers` false).\n\nAn endpoint added through the API follows the token that added it until its URL is changed in the panel: it's sent only the events that token may read now, of the servers it reaches; only that token can change it, turn it on or rotate its secret (another token that reaches it may read it, send it a test event or a delivery again, turn it off or delete it, and gets `403 panel_only` for anything else); and it's turned off when the token no longer covers it, expires, revokes itself or is revoked by support, and when you revoke the token in the panel unless you choose to keep it on (it's then still sent only what the token could read).\n\n**Limits.** 10 endpoints per account.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks a scope this operation needs (`missingScopes`).\n\n`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`limit_reached`: A limit is reached: `message` says which (servers per account, snapshots per server, domains per site, …).\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/webhooks/endpoints\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"url\": \"https://hooks.example.com/rabbitflare\",\n  \"description\": \"Deploy notifications\",\n  \"events\": [\n    \"server.ready\",\n    \"site.ready\",\n    \"site.install_failed\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/endpoints\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"url\": \"https://hooks.example.com/rabbitflare\",\n    \"description\": \"Deploy notifications\",\n    \"events\": [\n      \"server.ready\",\n      \"site.ready\",\n      \"site.install_failed\"\n    ]\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.webhooks.endpoints.create({\n  url: \"https://hooks.example.com/rabbitflare\",\n  description: \"Deploy notifications\",\n  events: [\"server.ready\", \"site.ready\", \"site.install_failed\"],\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/endpoints');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'url' => 'https://hooks.example.com/rabbitflare',\n        'description' => 'Deploy notifications',\n        'events' => [\n            'server.ready',\n            'site.ready',\n            'site.install_failed',\n        ],\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/webhooks/endpoints\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"url\": \"https://hooks.example.com/rabbitflare\",\n        \"description\": \"Deploy notifications\",\n        \"events\": [\n            \"server.ready\",\n            \"site.ready\",\n            \"site.install_failed\",\n        ],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/webhooks/endpoints/{endpointId}": {
      "get": {
        "operationId": "webhooksEndpointsGet",
        "summary": "Get a webhook endpoint",
        "description": "Returns one webhook endpoint: its URL, events, servers, status, and how its deliveries have gone lately (`failingSince`, `lastSuccessAt`, `lastFailureAt`). Never its signing secret.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The endpoint's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.webhooks.endpoints.get({\n  endpointId: \"3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "patch": {
        "operationId": "webhooksEndpointsUpdate",
        "summary": "Change a webhook endpoint",
        "description": "Changes an endpoint's URL, note, events or servers, or turns it off and on (`status`). Only the fields sent change.\n\nTurning an endpoint on again (also one that was turned off because its deliveries kept failing) clears its failing streak; deliveries that already failed stay failed (send them again with `POST /webhooks/deliveries/{deliveryId}/actions/redeliver`).\n\nAn endpoint made or changed with a token can only be sent event types the token may read: each type needs its group's read scope (`servers:read` for server events, `sites:read` for site events, `account:read` for API events), otherwise `403 insufficient_scope`. `[\"*\"]` needs the read scope of every group sent today (`servers:read`, `sites:read`, `support:read` and `account:read`); a type added later is sent to it only if its token may read it. A token limited to some servers can only make endpoints limited to those servers: send `serverIds` with only them (`serverIds` sent without `allServers` means `allServers` false).\n\nAn endpoint added through the API follows the token that added it until its URL is changed in the panel: it's sent only the events that token may read now, of the servers it reaches; only that token can change it, turn it on or rotate its secret (another token that reaches it may read it, send it a test event or a delivery again, turn it off or delete it, and gets `403 panel_only` for anything else); and it's turned off when the token no longer covers it, expires, revokes itself or is revoked by support, and when you revoke the token in the panel unless you choose to keep it on (it's then still sent only what the token could read).",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The endpoint's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks a scope this operation needs (`missingScopes`).\n\n`panel_only`: This can only be done in the control panel: for example, rotating the signing secret of a webhook endpoint added in the panel or with another API token.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`: One or more fields are missing or wrong. `fields` names each one with what's wrong.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"status\": \"enabled\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\", {\n  method: \"PATCH\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"status\": \"enabled\"\n  }),\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.webhooks.endpoints.update({\n  endpointId: \"3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\",\n  status: \"enabled\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'status' => 'enabled',\n    ]),\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    json={\n        \"status\": \"enabled\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      },
      "delete": {
        "operationId": "webhooksEndpointsDelete",
        "summary": "Delete a webhook endpoint",
        "description": "Deletes an endpoint, with its deliveries. Nothing more is sent to it. This can't be undone.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The endpoint's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. There's no answer body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": true,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\", {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nawait rf.webhooks.endpoints.delete({ endpointId: \"3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\" });"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()"
          }
        ]
      }
    },
    "/webhooks/endpoints/{endpointId}/actions/rotate-secret": {
      "post": {
        "operationId": "webhooksEndpointsRotateSecret",
        "summary": "Rotate an endpoint's signing secret",
        "description": "Gives the endpoint a new signing secret, answered this once. The new secret signs every call from now on; for 24 hours each call's `Rabbitflare-Signature` header also carries a second `v1=` made with the old secret, so your receiver can switch over without missing an event.\n\nRotating again within the 24 hours ends the old secret at once.\n\nOnly for an endpoint added with this token: whoever holds a secret can sign calls its receiver takes for ours, so the secret of an endpoint added in the panel, or with another token, is rolled in the panel (`403 panel_only` here).",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The endpoint's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "`panel_only`: This can only be done in the control panel: for example, rotating the signing secret of a webhook endpoint added in the panel or with another API token.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/rotate-secret\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/rotate-secret\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.webhooks.endpoints.rotateSecret({\n  endpointId: \"3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/rotate-secret');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/rotate-secret\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/webhooks/endpoints/{endpointId}/actions/send-test": {
      "post": {
        "operationId": "webhooksEndpointsSendTest",
        "summary": "Send a test event",
        "description": "Sends a `ping` event to the endpoint, signed like any other, and answers the delivery: within about 12 seconds its first attempt has usually been made, so `state`, `lastStatus` and `responseExcerpt` show how your endpoint answered. Otherwise it answers while the delivery is still `pending`; read it again with `GET /webhooks/deliveries/{deliveryId}`.\n\nThe endpoint must be turned on (`409 invalid_state` otherwise). A test event goes to this endpoint only.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The endpoint's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookDeliveryDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:write"
        ],
        "x-rate-class": "heavy",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/send-test\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/send-test\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.webhooks.endpoints.sendTest({\n  endpointId: \"3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/send-test');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/send-test\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/webhooks/endpoints/{endpointId}/deliveries": {
      "get": {
        "operationId": "webhooksDeliveriesList",
        "summary": "List an endpoint's deliveries",
        "description": "Lists the deliveries to one endpoint from the last 30 days, newest first (`order=asc`: oldest first). Filter by `state` (to find failed ones to send again) or `eventType`. The payload and the attempts are in `GET /webhooks/deliveries/{deliveryId}`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "description": "The endpoint's id.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many items to return, from 1 to 100. Default 25.",
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page, exactly as it was given. Leave it out for the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The field to sort by. Each list names the fields it can be sorted by.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "`asc` (smallest or oldest first) or `desc`. Each list has its own default.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Only deliveries in this state.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "succeeded",
                "failed"
              ]
            }
          },
          {
            "name": "eventType",
            "in": "query",
            "required": false,
            "description": "Only deliveries of this event type.",
            "schema": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z_]+(\\.[a-z_]+)?$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      },
                      "description": "This page's items."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A query parameter is unknown or has a wrong value (`fields` names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.\n\n`invalid_cursor`: The cursor isn't one this list gave, or was made with other filters or another sort.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/deliveries?state=failed\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/deliveries?state=failed\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data, pagination } = await res.json();\nconsole.log(data, pagination.nextCursor);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nfor await (const item of rf.webhooks.deliveries.list({\n  endpointId: \"3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b\",\n  state: \"failed\",\n})) {\n  console.log(item);\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/deliveries?state=failed');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\n$answer = json_decode($body, true);\nprint_r($answer['data']);\necho $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL;"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/deliveries\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    params={\n        \"state\": \"failed\",\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nanswer = response.json()\nprint(answer[\"data\"], answer[\"pagination\"][\"nextCursor\"])"
          }
        ]
      }
    },
    "/webhooks/deliveries/{deliveryId}": {
      "get": {
        "operationId": "webhooksDeliveriesGet",
        "summary": "Get a delivery",
        "description": "Returns one delivery in full: the payload that was sent (the same bytes on every attempt), the first 1 KB of your endpoint's last answer, and the last 10 attempts.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "description": "The delivery's id (the `Rabbitflare-Delivery-Id` header).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookDeliveryDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:read"
        ],
        "x-rate-class": "read",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl \"https://api.rabbitflare.com/v1/webhooks/deliveries/8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/deliveries/8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a\", {\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.webhooks.deliveries.get({\n  deliveryId: \"8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/deliveries/8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a');\ncurl_setopt_array($ch, [\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.rabbitflare.com/v1/webhooks/deliveries/8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    },
    "/webhooks/deliveries/{deliveryId}/actions/redeliver": {
      "post": {
        "operationId": "webhooksDeliveriesRedeliver",
        "summary": "Send a delivery again",
        "description": "Sends a delivery again, now: the same payload, with a new signature. It becomes `pending` and its attempts keep counting; its history stays. Useful for a delivery that failed while your endpoint was down.\n\n**Limits.** 60 an hour per account. A delivery that is already waiting for its next attempt is sent at once; the endpoint must be turned on (`409 invalid_state` otherwise).",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "description": "The delivery's id (the `Rabbitflare-Delivery-Id` header).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A new unique key (a UUID) for each request: sending the same request again with the same key returns the first answer instead of doing the work twice.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[A-Za-z0-9_\\-:.]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookDeliveryDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: The resource doesn't exist, or isn't this account's.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_state`: The resource's status doesn't allow this now (for example, powering on a server that is running). `message` says why.\n\n`idempotency_in_progress`: A request with this Idempotency-Key is still running.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests. `scope` says which limit: token, account, create, operation or network.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Any other error. The errors guide lists every code: https://rabbitflare.com/docs/api/errors",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-scopes": [
          "webhooks:write"
        ],
        "x-rate-class": "write",
        "x-spends-money": false,
        "x-async": false,
        "x-destructive": false,
        "x-code-samples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.rabbitflare.com/v1/webhooks/deliveries/8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a/actions/redeliver\" \\\n  -H \"Authorization: Bearer $RABBITFLARE_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const res = await fetch(\"https://api.rabbitflare.com/v1/webhooks/deliveries/8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a/actions/redeliver\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,\n  },\n});\nif (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);\nconst { data } = await res.json();\nconsole.log(data);"
          },
          {
            "lang": "JavaScript",
            "label": "SDK",
            "source": "import { Rabbitflare } from \"@rabbitflare/api\";\n\nconst rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });\nconst data = await rf.webhooks.deliveries.redeliver({\n  deliveryId: \"8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a\",\n});\nconsole.log(data);"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/deliveries/8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a/actions/redeliver');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_TIMEOUT => 120,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),\n    ],\n]);\n$body = curl_exec($ch);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\nif ($body === false || $status >= 400) {\n    throw new RuntimeException(\"Rabbitflare API error $status: $body\");\n}\nprint_r(json_decode($body, true)['data']);"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.rabbitflare.com/v1/webhooks/deliveries/8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a/actions/redeliver\",\n    headers={\n        \"Authorization\": \"Bearer \" + os.environ[\"RABBITFLARE_TOKEN\"],\n    },\n    timeout=120,\n)\nresponse.raise_for_status()\nprint(response.json()[\"data\"])"
          }
        ]
      }
    }
  },
  "webhooks": {
    "server.created": {
      "post": {
        "summary": "server.created",
        "description": "A server was ordered, or your own server was added. Setting it up follows (server.ready).\n\nSent to the endpoints that want `server.created` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.ready": {
      "post": {
        "summary": "server.ready",
        "description": "A server finished setting up and can take sites.\n\nSent to the endpoints that want `server.ready` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.provisioning_failed": {
      "post": {
        "summary": "server.provisioning_failed",
        "description": "A server couldn't be set up, or connecting your own server stopped.\n\nSent to the endpoints that want `server.provisioning_failed` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.powered_on": {
      "post": {
        "summary": "server.powered_on",
        "description": "A server was powered on.\n\nSent to the endpoints that want `server.powered_on` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.powered_off": {
      "post": {
        "summary": "server.powered_off",
        "description": "A server was powered off, or was found powered off.\n\nSent to the endpoints that want `server.powered_off` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.rebooted": {
      "post": {
        "summary": "server.rebooted",
        "description": "A server was rebooted.\n\nSent to the endpoints that want `server.rebooted` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.resized": {
      "post": {
        "summary": "server.resized",
        "description": "A server moved to a new size.\n\nSent to the endpoints that want `server.resized` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.snapshot_created": {
      "post": {
        "summary": "server.snapshot_created",
        "description": "A snapshot of a server was made.\n\nSent to the endpoints that want `server.snapshot_created` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.snapshot_deleted": {
      "post": {
        "summary": "server.snapshot_deleted",
        "description": "A snapshot of a server was deleted.\n\nSent to the endpoints that want `server.snapshot_deleted` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.restored": {
      "post": {
        "summary": "server.restored",
        "description": "A server was restored from a snapshot or backup.\n\nSent to the endpoints that want `server.restored` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.unreachable": {
      "post": {
        "summary": "server.unreachable",
        "description": "Your own server couldn't be reached.\n\nSent to the endpoints that want `server.unreachable` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.missing": {
      "post": {
        "summary": "server.missing",
        "description": "A server can no longer be found at its cloud. Support has been told.\n\nSent to the endpoints that want `server.missing` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.suspended": {
      "post": {
        "summary": "server.suspended",
        "description": "A server and its sites were suspended because its billing stopped.\n\nSent to the endpoints that want `server.suspended` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.resumed": {
      "post": {
        "summary": "server.resumed",
        "description": "A suspended server is running again, with its sites back online.\n\nSent to the endpoints that want `server.resumed` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.deleted": {
      "post": {
        "summary": "server.deleted",
        "description": "A server was deleted (or your own server disconnected), with its sites.\n\nSent to the endpoints that want `server.deleted` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.security_enabled": {
      "post": {
        "summary": "server.security_enabled",
        "description": "Imunify360 is on for a server: it was turned on, or came with a new server once it was ready.\n\nSent to the endpoints that want `server.security_enabled` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.security_disabled": {
      "post": {
        "summary": "server.security_disabled",
        "description": "Imunify360 was turned off for a server, and with it every site's malware protection.\n\nSent to the endpoints that want `server.security_disabled` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "server.security_failed": {
      "post": {
        "summary": "server.security_failed",
        "description": "A change to the server's security didn't finish.\n\nSent to the endpoints that want `server.security_failed` or `*`. An API token needs `servers:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.created": {
      "post": {
        "summary": "site.created",
        "description": "A WordPress site was added to a server. Installing it follows (site.ready).\n\nSent to the endpoints that want `site.created` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.ready": {
      "post": {
        "summary": "site.ready",
        "description": "A site finished installing and is live.\n\nSent to the endpoints that want `site.ready` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.install_failed": {
      "post": {
        "summary": "site.install_failed",
        "description": "A site couldn't be installed.\n\nSent to the endpoints that want `site.install_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.deleted": {
      "post": {
        "summary": "site.deleted",
        "description": "A site was deleted, with its files and database.\n\nSent to the endpoints that want `site.deleted` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.delete_failed": {
      "post": {
        "summary": "site.delete_failed",
        "description": "Deleting a site didn't finish.\n\nSent to the endpoints that want `site.delete_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.domain_added": {
      "post": {
        "summary": "site.domain_added",
        "description": "A domain was added to a site.\n\nSent to the endpoints that want `site.domain_added` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.domain_verified": {
      "post": {
        "summary": "site.domain_verified",
        "description": "A site domain's DNS was verified.\n\nSent to the endpoints that want `site.domain_verified` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.domain_removed": {
      "post": {
        "summary": "site.domain_removed",
        "description": "A domain was removed from a site.\n\nSent to the endpoints that want `site.domain_removed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.primary_domain_changed": {
      "post": {
        "summary": "site.primary_domain_changed",
        "description": "A site's primary domain changed, or was set to change once its DNS is verified.\n\nSent to the endpoints that want `site.primary_domain_changed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.domains_updated": {
      "post": {
        "summary": "site.domains_updated",
        "description": "A site's domains were set up on its server, with their SSL certificates.\n\nSent to the endpoints that want `site.domains_updated` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.domains_failed": {
      "post": {
        "summary": "site.domains_failed",
        "description": "Setting up a site's domains on its server failed.\n\nSent to the endpoints that want `site.domains_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.cdn_enabled": {
      "post": {
        "summary": "site.cdn_enabled",
        "description": "The CDN is on for a site.\n\nSent to the endpoints that want `site.cdn_enabled` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.cdn_disabled": {
      "post": {
        "summary": "site.cdn_disabled",
        "description": "The CDN was turned off for a site.\n\nSent to the endpoints that want `site.cdn_disabled` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.cdn_failed": {
      "post": {
        "summary": "site.cdn_failed",
        "description": "Turning the CDN on for a site failed.\n\nSent to the endpoints that want `site.cdn_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.cdn_purged": {
      "post": {
        "summary": "site.cdn_purged",
        "description": "A site's CDN cache was cleared.\n\nSent to the endpoints that want `site.cdn_purged` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.cdn_purge_failed": {
      "post": {
        "summary": "site.cdn_purge_failed",
        "description": "Clearing a site's CDN cache failed.\n\nSent to the endpoints that want `site.cdn_purge_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.cdn_hostname_ready": {
      "post": {
        "summary": "site.cdn_hostname_ready",
        "description": "A site's CDN serves its files from its custom hostname.\n\nSent to the endpoints that want `site.cdn_hostname_ready` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.cdn_hostname_failed": {
      "post": {
        "summary": "site.cdn_hostname_failed",
        "description": "Setting up a custom hostname for a site's CDN stopped.\n\nSent to the endpoints that want `site.cdn_hostname_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.cloned": {
      "post": {
        "summary": "site.cloned",
        "description": "A site was copied to a new site (sent for both sites).\n\nSent to the endpoints that want `site.cloned` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.clone_failed": {
      "post": {
        "summary": "site.clone_failed",
        "description": "Copying a site to a new site failed.\n\nSent to the endpoints that want `site.clone_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.resources_updated": {
      "post": {
        "summary": "site.resources_updated",
        "description": "A site's resource limits or PHP settings changed.\n\nSent to the endpoints that want `site.resources_updated` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.resources_failed": {
      "post": {
        "summary": "site.resources_failed",
        "description": "A site's new resource limits or PHP settings couldn't be applied.\n\nSent to the endpoints that want `site.resources_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.firewall_updated": {
      "post": {
        "summary": "site.firewall_updated",
        "description": "A site's firewall was set up or its settings changed.\n\nSent to the endpoints that want `site.firewall_updated` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "site.firewall_failed": {
      "post": {
        "summary": "site.firewall_failed",
        "description": "A site's firewall couldn't be set up.\n\nSent to the endpoints that want `site.firewall_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "media_offload.enabled": {
      "post": {
        "summary": "media_offload.enabled",
        "description": "Media Offload is on for a site.\n\nSent to the endpoints that want `media_offload.enabled` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "media_offload.disabled": {
      "post": {
        "summary": "media_offload.disabled",
        "description": "Media Offload is off for a site: every file is served from the server.\n\nSent to the endpoints that want `media_offload.disabled` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "media_offload.failed": {
      "post": {
        "summary": "media_offload.failed",
        "description": "Media Offload couldn't be turned on or off for a site.\n\nSent to the endpoints that want `media_offload.failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "media_offload.run_completed": {
      "post": {
        "summary": "media_offload.run_completed",
        "description": "A Media Offload run finished: copying files to storage, freeing up disk space, checking every file, bringing files back or preparing a download.\n\nSent to the endpoints that want `media_offload.run_completed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "media_offload.run_failed": {
      "post": {
        "summary": "media_offload.run_failed",
        "description": "A Media Offload run didn't finish.\n\nSent to the endpoints that want `media_offload.run_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "smtp.enabled": {
      "post": {
        "summary": "smtp.enabled",
        "description": "Rabbitflare SMTP is on for a site.\n\nSent to the endpoints that want `smtp.enabled` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "smtp.disabled": {
      "post": {
        "summary": "smtp.disabled",
        "description": "Rabbitflare SMTP is off for a site.\n\nSent to the endpoints that want `smtp.disabled` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "smtp.paused": {
      "post": {
        "summary": "smtp.paused",
        "description": "Rabbitflare SMTP was paused for a site.\n\nSent to the endpoints that want `smtp.paused` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "smtp.resumed": {
      "post": {
        "summary": "smtp.resumed",
        "description": "Rabbitflare SMTP sends a site's emails again after a pause.\n\nSent to the endpoints that want `smtp.resumed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "rabbitpress.installed": {
      "post": {
        "summary": "rabbitpress.installed",
        "description": "RabbitPress Cache was installed on a site.\n\nSent to the endpoints that want `rabbitpress.installed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "rabbitpress.removed": {
      "post": {
        "summary": "rabbitpress.removed",
        "description": "RabbitPress Cache was removed from a site.\n\nSent to the endpoints that want `rabbitpress.removed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "rabbitpress.failed": {
      "post": {
        "summary": "rabbitpress.failed",
        "description": "RabbitPress Cache couldn't be installed on a site, or removed from it.\n\nSent to the endpoints that want `rabbitpress.failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "backup.started": {
      "post": {
        "summary": "backup.started",
        "description": "A backup of a site started.\n\nSent to the endpoints that want `backup.started` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "backup.completed": {
      "post": {
        "summary": "backup.completed",
        "description": "A backup of a site finished and was stored.\n\nSent to the endpoints that want `backup.completed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "backup.failed": {
      "post": {
        "summary": "backup.failed",
        "description": "A backup of a site failed.\n\nSent to the endpoints that want `backup.failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "backup.restore_started": {
      "post": {
        "summary": "backup.restore_started",
        "description": "Restoring a site from a backup started.\n\nSent to the endpoints that want `backup.restore_started` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "backup.restored": {
      "post": {
        "summary": "backup.restored",
        "description": "A site was restored from a backup.\n\nSent to the endpoints that want `backup.restored` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "backup.restore_failed": {
      "post": {
        "summary": "backup.restore_failed",
        "description": "Restoring a site from a backup failed; the site was left as it was.\n\nSent to the endpoints that want `backup.restore_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "backup.delete_failed": {
      "post": {
        "summary": "backup.delete_failed",
        "description": "A backup left the list but couldn't be deleted from its storage (its access was taken away, say): delete it there yourself.\n\nSent to the endpoints that want `backup.delete_failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "staging.created": {
      "post": {
        "summary": "staging.created",
        "description": "A staging copy of a site is ready.\n\nSent to the endpoints that want `staging.created` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "staging.refreshed": {
      "post": {
        "summary": "staging.refreshed",
        "description": "A staging copy was refreshed from its live site.\n\nSent to the endpoints that want `staging.refreshed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "staging.pushed": {
      "post": {
        "summary": "staging.pushed",
        "description": "A staging copy was pushed to its live site.\n\nSent to the endpoints that want `staging.pushed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "staging.push_undone": {
      "post": {
        "summary": "staging.push_undone",
        "description": "The last push to a live site was undone.\n\nSent to the endpoints that want `staging.push_undone` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "staging.failed": {
      "post": {
        "summary": "staging.failed",
        "description": "Making, refreshing, pushing or undoing a staging copy didn't complete.\n\nSent to the endpoints that want `staging.failed` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "staging.deleted": {
      "post": {
        "summary": "staging.deleted",
        "description": "A staging copy was deleted.\n\nSent to the endpoints that want `staging.deleted` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "staging.needs_attention": {
      "post": {
        "summary": "staging.needs_attention",
        "description": "An update of a site through its staging copy ran into a problem our team is fixing.\n\nSent to the endpoints that want `staging.needs_attention` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "malware_protection.enabled": {
      "post": {
        "summary": "malware_protection.enabled",
        "description": "Malware protection was turned on for a site. Follow server.security_* too: a server's security changes its sites' protection without an event per site.\n\nSent to the endpoints that want `malware_protection.enabled` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "malware_protection.disabled": {
      "post": {
        "summary": "malware_protection.disabled",
        "description": "Malware protection was turned off for a site. Turning it off for the server, or deleting the server, sends server.security_* or server.deleted only.\n\nSent to the endpoints that want `malware_protection.disabled` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "malware.found": {
      "post": {
        "summary": "malware.found",
        "description": "Malware was found on a site and not cleaned at once: clean or ignore it.\n\nSent to the endpoints that want `malware.found` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "malware.cleaned": {
      "post": {
        "summary": "malware.cleaned",
        "description": "Malware was found on a site and cleaned at once (the clean-up can be undone for a while).\n\nSent to the endpoints that want `malware.cleaned` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "malware.warning": {
      "post": {
        "summary": "malware.warning",
        "description": "Known security holes were found in what a site has installed, or one of its domains is on a blacklist.\n\nSent to the endpoints that want `malware.warning` or `*`. An API token needs `sites:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "ticket.opened": {
      "post": {
        "summary": "ticket.opened",
        "description": "A support ticket was opened.\n\nSent to the endpoints that want `ticket.opened` or `*`. An API token needs `support:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "ticket.answered": {
      "post": {
        "summary": "ticket.answered",
        "description": "Support answered a ticket.\n\nSent to the endpoints that want `ticket.answered` or `*`. An API token needs `support:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "api_token.created": {
      "post": {
        "summary": "api_token.created",
        "description": "An API token was made.\n\nSent to the endpoints that want `api_token.created` or `*`. An API token needs `account:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "api_token.revoked": {
      "post": {
        "summary": "api_token.revoked",
        "description": "An API token was revoked, or expired.\n\nSent to the endpoints that want `api_token.revoked` or `*`. An API token needs `account:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "webhook_endpoint.disabled": {
      "post": {
        "summary": "webhook_endpoint.disabled",
        "description": "A webhook endpoint was turned off because its deliveries kept failing (or it answered 410 Gone), or because support revoked the API token that added it.\n\nSent to the endpoints that want `webhook_endpoint.disabled` or `*`. An API token needs `account:read` to choose it for an endpoint.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    },
    "ping": {
      "post": {
        "summary": "ping",
        "description": "A test event, sent by “Send test event”.\n\nSent only to the endpoint the test was sent to.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookEventType"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryId"
          },
          {
            "$ref": "#/components/parameters/WebhookDeliveryAttempt"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "Gone: the endpoint is turned off at once, and its owner is emailed (at most once a day). A test event's 410 only fails that test."
          },
          "2XX": {
            "description": "Received. Answer within 10 seconds, and do the work after answering."
          },
          "default": {
            "description": "Any other answer (a redirect too), or none within 10 seconds: the event is sent again later, up to 8 attempts in all over about 45 hours."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The account's id."
          },
          "name": {
            "type": "string",
            "description": "The account holder's name."
          },
          "email": {
            "type": "string",
            "description": "The account's email address, where Rabbitflare writes to you."
          },
          "emailVerified": {
            "type": "boolean",
            "description": "Whether the email address is confirmed. New servers need a confirmed address."
          },
          "twoFactorEnabled": {
            "type": "boolean",
            "description": "Whether two-factor authentication is on for signing in to the panel."
          },
          "createdAt": {
            "type": "string",
            "description": "When the account was made.",
            "format": "date-time"
          },
          "clouds": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A cloud's id.",
              "x-known-values": [
                "digitalocean",
                "vultr",
                "hetzner",
                "linode",
                "gcp",
                "edge",
                "custom"
              ]
            },
            "description": "The clouds you can create servers on, in the order the panel shows them. `custom` is for servers you already have."
          },
          "features": {
            "type": "object",
            "properties": {
              "backups": {
                "type": "boolean",
                "description": "Site backups: automatic copies of sites, kept where you choose."
              },
              "wallet": {
                "type": "boolean",
                "description": "The wallet: funds you add ahead of time, used before your card."
              },
              "cloudflare": {
                "type": "boolean",
                "description": "Connecting your Cloudflare accounts to manage their DNS, SSL and cache."
              },
              "firewall": {
                "type": "boolean",
                "description": "The firewall that protects each site from attacks."
              },
              "protection": {
                "type": "boolean",
                "description": "Deprecated, always false: Cloudflare protection was removed from Rabbitflare on 28 November 2026."
              },
              "security": {
                "type": "boolean",
                "description": "Imunify360 on servers Rabbitflare creates: server security, and malware protection for sites."
              },
              "staging": {
                "type": "boolean",
                "description": "Staging copies of sites, to test changes before they go live."
              },
              "cloning": {
                "type": "boolean",
                "description": "Copying a site to a new site."
              },
              "logCleanup": {
                "type": "boolean",
                "description": "Cleaning up servers' logs, by hand or on a schedule."
              },
              "siteResources": {
                "type": "boolean",
                "description": "Choosing the CPU, memory, processes and PHP settings each site may use."
              },
              "rabbitpress": {
                "type": "boolean",
                "description": "RabbitPress Cache, the caching plugin for WordPress."
              },
              "mediaOffload": {
                "type": "boolean",
                "description": "Media Offload: keeping sites' media libraries in cloud storage."
              },
              "smtp": {
                "type": "boolean",
                "description": "Rabbitflare SMTP: sending sites' WordPress emails through Rabbitflare."
              },
              "mail": {
                "type": "boolean",
                "description": "Rabbitflare Mail: mailboxes on your own domains."
              },
              "domainRegistration": {
                "type": "boolean",
                "description": "Registering domain names."
              },
              "domainTransfers": {
                "type": "boolean",
                "description": "Transferring domain names in from another registrar."
              }
            },
            "required": [
              "backups",
              "wallet",
              "cloudflare",
              "firewall",
              "protection",
              "security",
              "staging",
              "cloning",
              "logCleanup",
              "siteResources",
              "rabbitpress",
              "mediaOffload",
              "smtp",
              "mail",
              "domainRegistration",
              "domainTransfers"
            ],
            "description": "Which products are open to the account. An operation of a product that isn't open answers 403 feature_unavailable."
          },
          "limits": {
            "type": "object",
            "properties": {
              "maxServers": {
                "type": "integer",
                "description": "How many servers the account can have. Your own servers don't count. Contact support to raise it."
              }
            },
            "required": [
              "maxServers"
            ],
            "description": "The account's limits."
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "emailVerified",
          "twoFactorEnabled",
          "createdAt",
          "clouds",
          "features",
          "limits"
        ],
        "description": "The account the token belongs to: who it is, the clouds and products open to it, and its limits.",
        "examples": [
          {
            "id": "0b9f2c1e-6d3a-4f7e-9a51-2c8e4b7d1f60",
            "name": "Jane Doe",
            "email": "you@example.com",
            "emailVerified": true,
            "twoFactorEnabled": true,
            "createdAt": "2026-03-02T09:15:27.000Z",
            "clouds": [
              "edge",
              "digitalocean",
              "vultr",
              "hetzner",
              "linode",
              "gcp",
              "custom"
            ],
            "features": {
              "backups": true,
              "wallet": true,
              "cloudflare": true,
              "firewall": true,
              "protection": false,
              "security": true,
              "staging": true,
              "cloning": true,
              "logCleanup": true,
              "siteResources": true,
              "rabbitpress": true,
              "mediaOffload": true,
              "smtp": true,
              "mail": true,
              "domainRegistration": true,
              "domainTransfers": true
            },
            "limits": {
              "maxServers": 10
            }
          }
        ]
      },
      "ApiIndex": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Always “Rabbitflare API”."
          },
          "version": {
            "type": "string",
            "description": "The API's major version, the one in the path: v1."
          },
          "documentationUrl": {
            "type": "string",
            "description": "Where the API's documentation is."
          },
          "openapiUrl": {
            "type": "string",
            "description": "The API's OpenAPI 3.1 document (GET /v1/openapi.json)."
          }
        },
        "required": [
          "name",
          "version",
          "documentationUrl",
          "openapiUrl"
        ],
        "description": "What the API is, and where its documentation and OpenAPI document are.",
        "examples": [
          {
            "name": "Rabbitflare API",
            "version": "v1",
            "documentationUrl": "https://rabbitflare.com/docs/api",
            "openapiUrl": "https://api.rabbitflare.com/v1/openapi.json"
          }
        ]
      },
      "ApiToken": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The token's id."
          },
          "name": {
            "type": "string",
            "description": "The name the token was given in the panel."
          },
          "tokenStart": {
            "type": "string",
            "description": "The token's first 8 characters (rfp_ and 4 more), to recognise it."
          },
          "tokenLast4": {
            "type": "string",
            "description": "The token's last 4 characters."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A scope: what the token may do.",
              "x-known-values": [
                "account:read",
                "servers:read",
                "servers:write",
                "servers:create",
                "servers:resize",
                "servers:delete",
                "sites:read",
                "sites:write",
                "sites:create",
                "sites:delete",
                "sites:files",
                "billing:read",
                "billing:write",
                "support:read",
                "support:write",
                "events:read",
                "webhooks:read",
                "webhooks:write"
              ]
            },
            "description": "What the token may do. Each operation lists the scopes it needs."
          },
          "allServers": {
            "type": "boolean",
            "description": "Whether the token reaches every server of the account, including servers added later."
          },
          "serverIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The only servers the token reaches (and their sites), when `allServers` is false. Empty when `allServers` is true."
          },
          "ipAllowlist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The IP addresses and ranges the token may be used from. Empty: any address."
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the token stops working. `null`: it doesn't expire.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the token stops working. `null`: it doesn't expire."
          },
          "createdAt": {
            "type": "string",
            "description": "When the token was made.",
            "format": "date-time"
          },
          "lastUsedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the token was last used (updated at most every few minutes). `null`: never.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the token was last used (updated at most every few minutes). `null`: never."
          },
          "rateLimits": {
            "$ref": "#/components/schemas/ApiTokenRateLimits"
          }
        },
        "required": [
          "id",
          "name",
          "tokenStart",
          "tokenLast4",
          "scopes",
          "allServers",
          "serverIds",
          "ipAllowlist",
          "expiresAt",
          "createdAt",
          "lastUsedAt",
          "rateLimits"
        ],
        "description": "The API token making the request: its name, scopes, server and IP limits, expiry and rate limits. Never its secret.",
        "examples": [
          {
            "id": "0b9f2c1e-5d0b-4b53-9a7e-2f1a3a6d7b11",
            "name": "deploy-bot",
            "tokenStart": "rfp_3kTq",
            "tokenLast4": "a1B2",
            "scopes": [
              "servers:read",
              "sites:read",
              "sites:write"
            ],
            "allServers": true,
            "serverIds": [],
            "ipAllowlist": [
              "203.0.113.0/24"
            ],
            "expiresAt": "2027-02-16T08:46:49.000Z",
            "createdAt": "2026-11-18T08:46:49.000Z",
            "lastUsedAt": "2026-11-18T09:12:03.000Z",
            "rateLimits": {
              "readPerMinute": 120,
              "writePerMinute": 30,
              "heavyPerMinute": 20,
              "perHour": 3000,
              "concurrent": 4
            }
          }
        ]
      },
      "ApiTokenRateLimits": {
        "type": "object",
        "properties": {
          "readPerMinute": {
            "type": "integer",
            "description": "Reads (GET and HEAD requests) the token may make per minute."
          },
          "writePerMinute": {
            "type": "integer",
            "description": "Changes (POST, PUT, PATCH and DELETE requests) the token may make per minute."
          },
          "heavyPerMinute": {
            "type": "integer",
            "description": "Requests per minute to operations that wait for a server or a service while you wait (file operations, tools, graphs, DNS checks)."
          },
          "perHour": {
            "type": "integer",
            "description": "Requests of every kind the token may make per hour."
          },
          "concurrent": {
            "type": "integer",
            "description": "Requests the token may have in progress at the same time."
          }
        },
        "required": [
          "readPerMinute",
          "writePerMinute",
          "heavyPerMinute",
          "perHour",
          "concurrent"
        ],
        "description": "The token's rate limits, with any change support made for the account included. Each answer's RateLimit headers say how much is left.",
        "examples": [
          {
            "readPerMinute": 120,
            "writePerMinute": 30,
            "heavyPerMinute": 20,
            "perHour": 3000,
            "concurrent": 4
          }
        ]
      },
      "Availability": {
        "type": "object",
        "properties": {
          "cloud": {
            "type": "string",
            "description": "The cloud this is for.",
            "x-known-values": [
              "digitalocean",
              "vultr",
              "hetzner",
              "linode",
              "gcp",
              "edge",
              "custom"
            ]
          },
          "regions": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Each region's id, with the ids of the plans that can be created there now (an empty list: none). Null when the cloud doesn't report its stock: then any plan it lists can be ordered, and the order is still checked when it's placed."
          }
        },
        "required": [
          "cloud",
          "regions"
        ],
        "description": "Which plans can be created in each region of a cloud right now.",
        "examples": [
          {
            "cloud": "digitalocean",
            "regions": {
              "fra1": [
                "starter",
                "standard",
                "business"
              ],
              "nyc3": [
                "standard",
                "business"
              ],
              "lon1": []
            }
          }
        ]
      },
      "Backup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The backup's id."
          },
          "status": {
            "type": "string",
            "description": "`running` (being made, or waiting its turn: see `stage`), `completed`, `failed` (see `error`) or `deleting` (being deleted from its storage: it leaves the list when that's done).",
            "x-known-values": [
              "running",
              "completed",
              "failed",
              "deleting"
            ]
          },
          "trigger": {
            "type": "string",
            "description": "Why it was made: `scheduled` (the site's daily or weekly backup), `manual` (asked for, in the panel or with `POST /sites/{siteId}/backups`) or `before_restore` (the site as it was just before a restore, so the restore can be undone).",
            "x-known-values": [
              "scheduled",
              "manual",
              "before_restore"
            ]
          },
          "location": {
            "type": "string",
            "description": "Where it's kept, in words: Rabbitflare Backup and its region, or the name your storage had when the backup was made."
          },
          "sizeBytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Its whole size. Null until it's completed."
          },
          "filesBytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The size of its files part (a .tar.gz archive). Null until it's completed."
          },
          "databaseBytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The size of its database part (a gzipped SQL dump). Null until it's completed."
          },
          "progress": {
            "anyOf": [
              {
                "type": "number",
                "description": "From 0 to 1."
              },
              {
                "type": "null"
              }
            ],
            "description": "How far it got, from 0 to 1, when that's known (1 once it's completed). Null otherwise."
          },
          "stage": {
            "anyOf": [
              {
                "type": "string",
                "description": "A few words."
              },
              {
                "type": "null"
              }
            ],
            "description": "What it's doing while it runs, like `Backing up the database` or `Waiting for another backup on the server to finish`. Null otherwise."
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it failed, in one plain sentence. Null unless it failed."
          },
          "startedAt": {
            "type": "string",
            "description": "When it was started (asked for, or due).",
            "format": "date-time"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it completed or failed. Null while it runs.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it completed or failed. Null while it runs."
          },
          "canRestore": {
            "type": "boolean",
            "description": "Whether the site can be restored from it (`POST /sites/{siteId}/backups/{backupId}/actions/restore`): a completed backup whose storage is still connected."
          },
          "canDownload": {
            "type": "boolean",
            "description": "Whether its parts can be downloaded (`GET /sites/{siteId}/backups/{backupId}/download`). False for a backup on an SFTP server: download it from that server. A backup in Google Drive is kept there as a folder: its download answers `409 conflict` with the folder's link."
          }
        },
        "required": [
          "id",
          "status",
          "trigger",
          "location",
          "sizeBytes",
          "filesBytes",
          "databaseBytes",
          "progress",
          "stage",
          "error",
          "startedAt",
          "finishedAt",
          "canRestore",
          "canDownload"
        ],
        "description": "A backup of a site: its files and its database, as they were when it was made.",
        "examples": [
          {
            "id": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
            "status": "completed",
            "trigger": "scheduled",
            "location": "Rabbitflare Backup (Europe (Frankfurt))",
            "sizeBytes": 1284311552,
            "filesBytes": 1201143808,
            "databaseBytes": 83167744,
            "progress": 1,
            "stage": null,
            "error": null,
            "startedAt": "2026-11-19T03:00:04.000Z",
            "finishedAt": "2026-11-19T03:06:41.000Z",
            "canRestore": true,
            "canDownload": true
          },
          {
            "id": "6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f90",
            "status": "running",
            "trigger": "manual",
            "location": "Rabbitflare Backup (Europe (Frankfurt))",
            "sizeBytes": null,
            "filesBytes": null,
            "databaseBytes": null,
            "progress": null,
            "stage": "Waiting to start",
            "error": null,
            "startedAt": "2026-11-19T10:15:02.000Z",
            "finishedAt": null,
            "canRestore": false,
            "canDownload": false
          }
        ]
      },
      "BackupDestination": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The storage's id: what a site's backup settings name as `destination`."
          },
          "kind": {
            "type": "string",
            "description": "What it is: `s3` (an Amazon S3 bucket), `spaces` (a DigitalOcean Space), `vultr` (Vultr Object Storage), `b2` (a B2 bucket, connected in the panel: through the API a B2 bucket connects as `s3compat`), `r2` (a Cloudflare R2 bucket), `s3compat` (other storage that speaks S3), `gdrive` (Google Drive), `dropbox` (Dropbox) or `sftp` (an SFTP server).",
            "x-known-values": [
              "s3",
              "spaces",
              "vultr",
              "b2",
              "r2",
              "s3compat",
              "gdrive",
              "dropbox",
              "sftp"
            ]
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "detail": {
            "type": "string",
            "description": "Where it points: a bucket and its folder (`shop-backups/sites`), the Google or Dropbox account, or the SFTP user, server and folder (`backup@nas.example.com:site-backups`)."
          },
          "status": {
            "type": "string",
            "description": "`ok` (it worked when last checked, or for the last backup), `error` (see `lastError`) or `pending` (an SFTP server waiting for Rabbitflare's key: add `publicKey` to it, then check it).",
            "x-known-values": [
              "ok",
              "error",
              "pending"
            ]
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "What went wrong when it was last checked or used, in one plain sentence. Null unless `status` is `error`."
          },
          "publicKey": {
            "anyOf": [
              {
                "type": "string",
                "description": "An SSH public key."
              },
              {
                "type": "null"
              }
            ],
            "description": "An SFTP server's Rabbitflare key, when it signs in with one: this public half goes in the user's `~/.ssh/authorized_keys` on the server. Null otherwise."
          },
          "hostKeyFingerprint": {
            "anyOf": [
              {
                "type": "string",
                "description": "A fingerprint, like SHA256:…"
              },
              {
                "type": "null"
              }
            ],
            "description": "An SFTP server's identity (its host key's fingerprint), noted at its first successful check: backups go only to a server that still has it. Null until then, and for other kinds."
          },
          "siteCount": {
            "type": "integer",
            "description": "How many sites back up to it now."
          },
          "createdAt": {
            "type": "string",
            "description": "When it was connected.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "detail",
          "status",
          "lastError",
          "publicKey",
          "hostKeyFingerprint",
          "siteCount",
          "createdAt"
        ],
        "description": "Storage of your own that sites can be backed up to. Its keys and passwords are never answered.",
        "examples": [
          {
            "id": "8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12",
            "kind": "s3",
            "name": "Amazon S3 · shop-backups",
            "detail": "shop-backups/sites",
            "status": "ok",
            "lastError": null,
            "publicKey": null,
            "hostKeyFingerprint": null,
            "siteCount": 1,
            "createdAt": "2026-11-12T09:30:00.000Z"
          },
          {
            "id": "9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c23",
            "kind": "sftp",
            "name": "Office NAS",
            "detail": "backup@nas.example.com:site-backups",
            "status": "pending",
            "lastError": null,
            "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGk2bVx0dGhpcyBpcyBhbiBleGFtcGxlIGtleSBvbmx5 rabbitflare.com-backups",
            "hostKeyFingerprint": null,
            "siteCount": 0,
            "createdAt": "2026-11-19T10:02:00.000Z"
          }
        ]
      },
      "BackupDestinationCreateInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "s3",
                "description": "An Amazon S3 bucket."
              },
              "name": {
                "description": "A name for it, up to 60 characters. Left out: its kind and its bucket (or server), like `Amazon S3 · shop-backups`.",
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "accessKeyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "description": "The access key's ID."
              },
              "secretAccessKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "The access key's secret. Kept encrypted, and never answered."
              },
              "bucket": {
                "type": "string",
                "minLength": 3,
                "maxLength": 63,
                "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$",
                "description": "The bucket's name."
              },
              "folder": {
                "description": "A folder inside it for the backups, like `sites`. Left out: the top.",
                "type": "string",
                "maxLength": 200,
                "pattern": "^[\\w .@+=,/-]*$"
              }
            },
            "required": [
              "kind",
              "accessKeyId",
              "secretAccessKey",
              "bucket"
            ],
            "additionalProperties": false,
            "description": "An Amazon S3 bucket. An access key that can read, write, list and delete in the bucket."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "spaces",
                "description": "A DigitalOcean Space."
              },
              "name": {
                "description": "A name for it, up to 60 characters. Left out: its kind and its bucket (or server), like `Amazon S3 · shop-backups`.",
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "accessKeyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "description": "The access key's ID."
              },
              "secretAccessKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "The access key's secret. Kept encrypted, and never answered."
              },
              "bucket": {
                "type": "string",
                "minLength": 3,
                "maxLength": 63,
                "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$",
                "description": "The bucket's name."
              },
              "region": {
                "type": "string",
                "enum": [
                  "nyc3",
                  "sfo3",
                  "atl1",
                  "tor1",
                  "ams3",
                  "lon1",
                  "fra1",
                  "sgp1",
                  "blr1",
                  "syd1"
                ],
                "description": "The Space's region: `nyc3`, `sfo3`, `atl1`, `tor1`, `ams3`, `lon1`, `fra1`, `sgp1`, `blr1`, `syd1`."
              },
              "folder": {
                "description": "A folder inside it for the backups, like `sites`. Left out: the top.",
                "type": "string",
                "maxLength": 200,
                "pattern": "^[\\w .@+=,/-]*$"
              }
            },
            "required": [
              "kind",
              "accessKeyId",
              "secretAccessKey",
              "bucket",
              "region"
            ],
            "additionalProperties": false,
            "description": "A DigitalOcean Space (`bucket` is the Space's name). An access key that can read, write, list and delete in the bucket."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "vultr",
                "description": "Vultr Object Storage."
              },
              "name": {
                "description": "A name for it, up to 60 characters. Left out: its kind and its bucket (or server), like `Amazon S3 · shop-backups`.",
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "accessKeyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "description": "The access key's ID."
              },
              "secretAccessKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "The access key's secret. Kept encrypted, and never answered."
              },
              "bucket": {
                "type": "string",
                "minLength": 3,
                "maxLength": 63,
                "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$",
                "description": "The bucket's name."
              },
              "location": {
                "type": "string",
                "enum": [
                  "ewr1",
                  "sjc1",
                  "lax1",
                  "ord1",
                  "ams1",
                  "fra1",
                  "lon1",
                  "sto1",
                  "sgp1",
                  "blr1",
                  "del1",
                  "bom1",
                  "tyo1",
                  "syd1"
                ],
                "description": "The storage's location: `ewr1`, `sjc1`, `lax1`, `ord1`, `ams1`, `fra1`, `lon1`, `sto1`, `sgp1`, `blr1`, `del1`, `bom1`, `tyo1`, `syd1`."
              },
              "folder": {
                "description": "A folder inside it for the backups, like `sites`. Left out: the top.",
                "type": "string",
                "maxLength": 200,
                "pattern": "^[\\w .@+=,/-]*$"
              }
            },
            "required": [
              "kind",
              "accessKeyId",
              "secretAccessKey",
              "bucket",
              "location"
            ],
            "additionalProperties": false,
            "description": "A bucket in Vultr Object Storage. An access key that can read, write, list and delete in the bucket."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "r2",
                "description": "A Cloudflare R2 bucket."
              },
              "name": {
                "description": "A name for it, up to 60 characters. Left out: its kind and its bucket (or server), like `Amazon S3 · shop-backups`.",
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "accessKeyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "description": "The access key's ID."
              },
              "secretAccessKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "The access key's secret. Kept encrypted, and never answered."
              },
              "bucket": {
                "type": "string",
                "minLength": 3,
                "maxLength": 63,
                "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$",
                "description": "The bucket's name."
              },
              "accountId": {
                "type": "string",
                "pattern": "^[a-f0-9]{32}$",
                "description": "Your Cloudflare account's ID (32 characters)."
              },
              "jurisdiction": {
                "description": "`eu` for a bucket in the EU jurisdiction. Left out: `default`.",
                "type": "string",
                "enum": [
                  "default",
                  "eu"
                ]
              },
              "folder": {
                "description": "A folder inside it for the backups, like `sites`. Left out: the top.",
                "type": "string",
                "maxLength": 200,
                "pattern": "^[\\w .@+=,/-]*$"
              }
            },
            "required": [
              "kind",
              "accessKeyId",
              "secretAccessKey",
              "bucket",
              "accountId"
            ],
            "additionalProperties": false,
            "description": "A Cloudflare R2 bucket, with an R2 API token that can read and write objects in it."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "s3compat",
                "description": "Other storage that speaks S3."
              },
              "name": {
                "description": "A name for it, up to 60 characters. Left out: its kind and its bucket (or server), like `Amazon S3 · shop-backups`.",
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "accessKeyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "description": "The access key's ID."
              },
              "secretAccessKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "The access key's secret. Kept encrypted, and never answered."
              },
              "bucket": {
                "type": "string",
                "minLength": 3,
                "maxLength": 63,
                "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$",
                "description": "The bucket's name."
              },
              "endpoint": {
                "type": "string",
                "maxLength": 300,
                "description": "The storage's https:// endpoint, like `https://s3.example.com`: on the public internet (a name whose IPv4 addresses are all public, or a public IPv4 address)."
              },
              "region": {
                "description": "The region the storage expects in signed requests, where it asks for one. Left out: the usual default, which most such storage accepts.",
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "folder": {
                "description": "A folder inside it for the backups, like `sites`. Left out: the top.",
                "type": "string",
                "maxLength": 200,
                "pattern": "^[\\w .@+=,/-]*$"
              }
            },
            "required": [
              "kind",
              "accessKeyId",
              "secretAccessKey",
              "bucket",
              "endpoint"
            ],
            "additionalProperties": false,
            "description": "Any other storage that speaks S3 (a B2 bucket among them: its S3 endpoint, and its region). An access key that can read, write, list and delete in the bucket."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "sftp",
                "description": "An SFTP server."
              },
              "name": {
                "description": "A name for it, up to 60 characters. Left out: its kind and its bucket (or server), like `Amazon S3 · shop-backups`.",
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "host": {
                "type": "string",
                "minLength": 1,
                "maxLength": 253,
                "pattern": "^[a-z0-9.-]+$|^\\[?[0-9a-f:]+\\]?$",
                "description": "The server's hostname or IPv4 address, on the public internet (a name whose IPv4 addresses are all public, or a public IPv4 address)."
              },
              "port": {
                "description": "Its SSH port. Left out: 22.",
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              "username": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[\\w.@-]+$",
                "description": "The user the backups are written as."
              },
              "auth": {
                "description": "`key` (the default): Rabbitflare makes a key for this storage, and the answer's `publicKey` goes in the user's `~/.ssh/authorized_keys` on the server. `password`: Rabbitflare signs in with `password`.",
                "type": "string",
                "enum": [
                  "key",
                  "password"
                ]
              },
              "password": {
                "description": "The user's password, with `auth: \"password\"`. Kept encrypted, and never answered.",
                "type": "string",
                "maxLength": 200
              },
              "folder": {
                "description": "A folder inside it for the backups, like `sites`. Left out: the top.",
                "type": "string",
                "maxLength": 200,
                "pattern": "^[\\w .@+=,/-]*$"
              }
            },
            "required": [
              "kind",
              "host",
              "username"
            ],
            "additionalProperties": false,
            "description": "An SFTP server that Rabbitflare signs in to with its own key (added to the server by you) or a password."
          }
        ],
        "description": "Storage of your own to connect, by its kind. Google Drive and Dropbox are connected in the panel, by signing in to them.",
        "examples": [
          {
            "kind": "s3",
            "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
            "secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
            "bucket": "shop-backups",
            "folder": "sites"
          },
          {
            "kind": "sftp",
            "name": "Office NAS",
            "host": "nas.example.com",
            "username": "backup",
            "folder": "site-backups"
          }
        ]
      },
      "BackupDestinationRenameInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "Its new name, up to 60 characters."
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "description": "A new name for the storage.",
        "examples": [
          {
            "name": "Shop backups (S3)"
          }
        ]
      },
      "BackupDisableInput": {
        "type": "object",
        "properties": {
          "removeStored": {
            "description": "`true`: also delete the site's backups in Rabbitflare Backup now (until they're deleted, their space is billed); refused while one of them is running (`409 conflict`). Backups in storage of your own stay where they are. Left out: `false`.",
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "Whether turning backups off also deletes the site's backups in Rabbitflare Backup.",
        "examples": [
          {
            "removeStored": true
          }
        ]
      },
      "BackupRestore": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The restore's id."
          },
          "backupId": {
            "type": "string",
            "description": "The backup it restores from."
          },
          "parts": {
            "type": "string",
            "description": "What it restores: `all` (the files and the database), `files` or `database`.",
            "x-known-values": [
              "all",
              "files",
              "database"
            ]
          },
          "status": {
            "type": "string",
            "description": "`waiting` (to start), `running` (see `stage`), `completed` or `failed` (see `error`; the site was left as it was).",
            "x-known-values": [
              "waiting",
              "running",
              "completed",
              "failed"
            ]
          },
          "stage": {
            "anyOf": [
              {
                "type": "string",
                "description": "A few words."
              },
              {
                "type": "null"
              }
            ],
            "description": "What it's doing while it runs, like `Backing up the site as it is now` or `Restoring the database`. Null otherwise."
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it failed, in one plain sentence. Null unless it failed."
          },
          "startedAt": {
            "type": "string",
            "description": "When it was asked for.",
            "format": "date-time"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it completed or failed. Null while it runs.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it completed or failed. Null while it runs."
          }
        },
        "required": [
          "id",
          "backupId",
          "parts",
          "status",
          "stage",
          "error",
          "startedAt",
          "finishedAt"
        ],
        "description": "A site being put back as it was in one of its backups.",
        "examples": [
          {
            "id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01",
            "backupId": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
            "parts": "all",
            "status": "running",
            "stage": "Backing up the site as it is now",
            "error": null,
            "startedAt": "2026-11-19T10:20:11.000Z",
            "finishedAt": null
          }
        ]
      },
      "BackupRestoreInput": {
        "type": "object",
        "properties": {
          "parts": {
            "description": "What to restore: `all` (the files and the database), `files` or `database`. Left out: `all`.",
            "type": "string",
            "enum": [
              "all",
              "files",
              "database"
            ]
          },
          "backupFirst": {
            "description": "Back the site up as it is now first, to where its backups go, so the restore can be undone by restoring that backup. Left out: `true`.",
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "What to restore from the backup.",
        "examples": [
          {
            "parts": "all",
            "backupFirst": true
          },
          {
            "parts": "database"
          }
        ]
      },
      "BackupSettingsInput": {
        "type": "object",
        "properties": {
          "destination": {
            "anyOf": [
              {
                "type": "string",
                "const": "rabbitflare"
              },
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            ],
            "description": "Where backups go: `rabbitflare` (Rabbitflare Backup), or the id of your storage (`GET /backup-destinations`)."
          },
          "region": {
            "description": "Where Rabbitflare Backup keeps them: `virginia` (United States), `frankfurt` (Europe) or `singapore` (Asia Pacific). Needed with `rabbitflare`; not used with storage of your own.",
            "type": "string",
            "enum": [
              "virginia",
              "frankfurt",
              "singapore"
            ]
          },
          "frequency": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "manual"
            ],
            "description": "`daily`, `weekly`, or `manual` (only when one is started)."
          },
          "hour": {
            "description": "The hour of the day (0 to 23, UTC) a scheduled backup starts. Left out: 3.",
            "type": "integer",
            "minimum": 0,
            "maximum": 23
          },
          "weekday": {
            "description": "For weekly backups, the day: 0 (Sunday) to 6 (Saturday). Left out: 0.",
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          },
          "keep": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60,
            "description": "How many backups to keep, 1 to 60: when one more completes, the oldest beyond that number are deleted."
          },
          "removeStored": {
            "description": "When the site moves from Rabbitflare Backup to storage of your own: `true` also deletes its backups in Rabbitflare Backup (until then, their space is still billed). Refused while one of them is running (`409 conflict`). Left out: they're kept.",
            "type": "boolean"
          }
        },
        "required": [
          "destination",
          "frequency",
          "keep"
        ],
        "additionalProperties": false,
        "description": "Where a site's backups go and how often: the whole settings, saved as they're sent (left-out times take their defaults).",
        "examples": [
          {
            "destination": "rabbitflare",
            "region": "frankfurt",
            "frequency": "daily",
            "hour": 3,
            "keep": 14
          },
          {
            "destination": "8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12",
            "frequency": "weekly",
            "hour": 2,
            "weekday": 6,
            "keep": 8,
            "removeStored": true
          }
        ]
      },
      "CdnCustomHostname": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "description": "The hostname the site's files are served from, like cdn.example.com."
          },
          "status": {
            "type": "string",
            "description": "`validating`: waiting for its DNS records (add both). `attaching`: adding it and its certificate to the CDN. `deploying`: spreading it to every CDN location (usually 3 to 10 minutes). `checking`: checking it serves the site's files (its `routing` record must point at the CDN). `installing`: switching the site's pages to it. `active`: the site's files are served from it. `removing`: being removed (the site already uses the CDN's own address again). `failed`: see `error`.",
            "x-known-values": [
              "validating",
              "attaching",
              "deploying",
              "checking",
              "installing",
              "active",
              "removing",
              "failed"
            ]
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CdnDnsRecord"
            },
            "description": "The DNS records to add for it, while it's being set up. The `validation` record appears a few seconds after the hostname is added; once the hostname is active only the `routing` record is listed (keep it)."
          },
          "dnsZone": {
            "anyOf": [
              {
                "type": "string",
                "description": "A domain name."
              },
              {
                "type": "null"
              }
            ],
            "description": "The domain registered with Rabbitflare, and using Rabbitflare DNS, that the hostname is on: add the records in the control panel, on the domain's DNS page. Null when its DNS is elsewhere: add the records there."
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why setting it up failed (with `status: \"failed\"`). Remove it and add it again to start over. Null otherwise."
          },
          "addedAt": {
            "type": "string",
            "description": "When the hostname was added.",
            "format": "date-time"
          }
        },
        "required": [
          "hostname",
          "status",
          "records",
          "dnsZone",
          "error",
          "addedAt"
        ],
        "description": "A hostname of your own the site's files are served from instead of the CDN's own address, with the DNS records it needs.",
        "examples": [
          {
            "hostname": "cdn.example.com",
            "status": "validating",
            "records": [
              {
                "type": "CNAME",
                "name": "_3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c.cdn.example.com",
                "value": "_9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d.validation.example.net",
                "purpose": "validation"
              },
              {
                "type": "CNAME",
                "name": "cdn.example.com",
                "value": "d1a2b3c4e5f6g7.cdn.example.net",
                "purpose": "routing"
              }
            ],
            "dnsZone": "example.com",
            "error": null,
            "addedAt": "2026-11-18T10:15:02.000Z"
          }
        ]
      },
      "CdnDnsRecord": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The record's type: `CNAME`.",
            "x-known-values": [
              "CNAME"
            ]
          },
          "name": {
            "type": "string",
            "description": "The record's name (where to add it), in full."
          },
          "value": {
            "type": "string",
            "description": "What the record points at."
          },
          "purpose": {
            "type": "string",
            "description": "`validation`: proves the hostname is yours, for its SSL certificate. `routing`: sends the hostname's visitors to the CDN.",
            "x-known-values": [
              "validation",
              "routing"
            ]
          }
        },
        "required": [
          "type",
          "name",
          "value",
          "purpose"
        ],
        "description": "A DNS record to add for a custom CDN hostname. If its DNS is on Cloudflare, set the record to DNS only (grey cloud).",
        "examples": [
          {
            "type": "CNAME",
            "name": "cdn.example.com",
            "value": "d1a2b3c4e5f6g7.cdn.example.net",
            "purpose": "routing"
          }
        ]
      },
      "CdnHostnameInput": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(?=.{4,253}$)(?:(?!-)[a-z0-9-]{1,63}(?<!-)\\.)+[a-z]{2,63}$",
            "description": "A hostname on a domain of your own that isn't used for anything else yet, like cdn.example.com (no https:// or path)."
          }
        },
        "required": [
          "hostname"
        ],
        "additionalProperties": false,
        "description": "A hostname of your own to serve the site's files from.",
        "examples": [
          {
            "hostname": "cdn.example.com"
          }
        ]
      },
      "CdnPurgeInput": {
        "type": "object",
        "properties": {
          "paths": {
            "description": "Files or folders to clear, each inside /wp-content/ or /wp-includes/ (up to 300 characters), like /wp-content/themes/shop/style.css or a folder ending in `*` like /wp-content/uploads/2026/11/*. A path clears every version of its file too (style.css?ver=2). Up to 15. Left out: everything is cleared. Needs the delivery options (`deliveryOptions`).",
            "minItems": 1,
            "maxItems": 15,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 300
            }
          }
        },
        "additionalProperties": false,
        "description": "What to clear from the CDN: particular files and folders, or everything."
      },
      "CdnSettingsInput": {
        "type": "object",
        "properties": {
          "types": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "images",
                "css",
                "js",
                "fonts",
                "media",
                "documents"
              ]
            },
            "description": "The kinds of files the CDN serves (at least one): `images` (Images: JPG, PNG, GIF, WebP, AVIF, SVG, ICO), `css` (CSS: Stylesheets), `js` (JavaScript: Scripts), `fonts` (Fonts: WOFF2, WOFF, TTF, OTF, EOT), `media` (Video and audio: MP4, WebM, MP3, M4A, WAV, OGG), `documents` (PDFs: PDF documents)."
          },
          "exclude": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Paths to keep on the server (up to 20, each inside /wp-content/ or /wp-includes/, like /wp-content/plugins/my-plugin/): files whose address starts with one of them are never served from the CDN. Send an empty list to keep none."
          }
        },
        "required": [
          "types",
          "exclude"
        ],
        "additionalProperties": false,
        "description": "What the CDN serves: the kinds of files, and paths it leaves on the server. Both replace what was there."
      },
      "CloneRoom": {
        "type": "object",
        "properties": {
          "serverId": {
            "type": "string",
            "description": "The destination server's id."
          },
          "freeBytes": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Bytes."
              },
              {
                "type": "null"
              }
            ],
            "description": "Free room on the server's disk. Null when it couldn't be checked."
          },
          "neededBytes": {
            "type": "integer",
            "description": "The room the clone needs there while it's made, with what must stay free (0 when the site's size wasn't given)."
          },
          "fits": {
            "description": "Whether the clone fits. Null when that couldn't be checked; the clone checks again before copying.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "unknown": {
            "type": "boolean",
            "description": "Whether the room couldn't be checked (the server didn't answer)."
          }
        },
        "required": [
          "serverId",
          "freeBytes",
          "neededBytes",
          "fits",
          "unknown"
        ],
        "description": "The room on a destination server for a clone of the site.",
        "examples": [
          {
            "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
            "freeBytes": 41871163392,
            "neededBytes": 330825728,
            "fits": true,
            "unknown": false
          }
        ]
      },
      "CloneSetup": {
        "type": "object",
        "properties": {
          "blockers": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A sentence."
            },
            "description": "Why the site can't be cloned right now (cloning isn't open to the account, it's a staging copy, it's still installing, its server is off, another operation is running…). Empty when it can be."
          },
          "sizes": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "filesBytes": {
                    "type": "integer",
                    "description": "The site's files, without caches and backup archives, in bytes."
                  },
                  "databaseBytes": {
                    "type": "integer",
                    "description": "The site's database, in bytes."
                  }
                },
                "required": [
                  "filesBytes",
                  "databaseBytes"
                ],
                "description": "The site's size."
              },
              {
                "type": "null"
              }
            ],
            "description": "The site's size. Null when it couldn't be measured."
          },
          "wordpressVersion": {
            "anyOf": [
              {
                "type": "string",
                "description": "A version."
              },
              {
                "type": "null"
              }
            ],
            "description": "The site's WordPress version. Null when not known."
          },
          "suggestedName": {
            "type": "string",
            "description": "A name for the new site: the site's, with “copy”."
          },
          "destinations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The server's id: send it as `serverId` to clone the site there."
                },
                "name": {
                  "type": "string",
                  "description": "The server's name."
                },
                "cloud": {
                  "type": "string",
                  "description": "Where the server runs (see the Server object).",
                  "x-known-values": [
                    "digitalocean",
                    "vultr",
                    "hetzner",
                    "linode",
                    "gcp",
                    "edge",
                    "custom"
                  ]
                },
                "region": {
                  "type": "string",
                  "description": "The server's location id."
                },
                "sameServer": {
                  "type": "boolean",
                  "description": "Whether it's the site's own server."
                },
                "unavailableReason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A sentence."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Why the site can't be cloned there right now (the server is off, still being set up…). Null when it can."
                }
              },
              "required": [
                "id",
                "name",
                "cloud",
                "region",
                "sameServer",
                "unavailableReason"
              ],
              "description": "A server the site can be cloned to."
            },
            "description": "The servers of the account the site can be cloned to, its own first. A token limited to some servers sees only those."
          },
          "room": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CloneRoom"
              },
              {
                "type": "null"
              }
            ],
            "description": "The room on the site's own server. Null when it couldn't be checked."
          },
          "active": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SiteClone"
              },
              {
                "type": "null"
              }
            ],
            "description": "A clone of this site that hasn't finished (one runs at a time). Null when none is."
          },
          "recent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteClone"
            },
            "description": "The latest clones of this site (up to 5), newest first."
          }
        },
        "required": [
          "blockers",
          "sizes",
          "wordpressVersion",
          "suggestedName",
          "destinations",
          "room",
          "active",
          "recent"
        ],
        "description": "What cloning a site needs: whether it can be cloned, its size, where it can go, and its clones.",
        "examples": [
          {
            "blockers": [],
            "sizes": {
              "filesBytes": 48000000,
              "databaseBytes": 6400000
            },
            "wordpressVersion": "6.8.3",
            "suggestedName": "Shop copy",
            "destinations": [
              {
                "id": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
                "name": "Production",
                "cloud": "digitalocean",
                "region": "fra1",
                "sameServer": true,
                "unavailableReason": null
              },
              {
                "id": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",
                "name": "Staging box",
                "cloud": "vultr",
                "region": "lhr",
                "sameServer": false,
                "unavailableReason": "Switched off"
              }
            ],
            "room": {
              "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
              "freeBytes": 41871163392,
              "neededBytes": 330825728,
              "fits": true,
              "unknown": false
            },
            "active": null,
            "recent": [
              {
                "id": "2b7e1c9d-3a4f-4e5b-8d6c-0f1e2a3b4c5d",
                "status": "done",
                "stage": null,
                "progress": 100,
                "source": {
                  "id": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                  "name": "Shop",
                  "serverName": "Production"
                },
                "target": {
                  "id": "6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
                  "name": "Shop copy",
                  "serverName": "Production"
                },
                "crossServer": false,
                "options": {
                  "resources": true,
                  "firewall": true,
                  "cron": true,
                  "noindex": true
                },
                "lastError": null,
                "notes": [
                  "The site's 2 cron jobs were copied paused, so they don't run twice. Turn each on with POST /v1/sites/{siteId}/cron-jobs/{jobId}/actions/enable when you want it."
                ],
                "health": {
                  "ok": true,
                  "problems": [],
                  "reason": null
                },
                "skipped": [
                  {
                    "path": "wp-content/uploads/cache.sock",
                    "reason": "special_file"
                  }
                ],
                "skippedCount": 1,
                "sizes": {
                  "filesBytes": 48000000,
                  "databaseBytes": 6400000
                },
                "cancellable": false,
                "createdAt": "2026-11-18T15:40:12.000Z",
                "startedAt": "2026-11-18T15:41:02.000Z",
                "finishedAt": "2026-11-18T15:44:51.000Z"
              }
            ]
          }
        ]
      },
      "CloneStarted": {
        "type": "object",
        "properties": {
          "site": {
            "$ref": "#/components/schemas/Site"
          },
          "clone": {
            "$ref": "#/components/schemas/SiteClone"
          }
        },
        "required": [
          "site",
          "clone"
        ],
        "description": "A clone just started: the new site, and the clone being made into it.",
        "examples": [
          {
            "site": {
              "id": "6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
              "name": "Shop copy",
              "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
              "server": {
                "id": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
                "name": "Production",
                "status": "active",
                "cloud": "digitalocean",
                "region": "fra1",
                "ipv4": "203.0.113.10",
                "ipv6": "2001:db8::10"
              },
              "status": "queued",
              "stage": "queued",
              "pendingAction": null,
              "url": "http://shop-copy-p4m8r.rabbitflare.link",
              "adminUrl": "http://shop-copy-p4m8r.rabbitflare.link/wp-admin/",
              "builtInDomain": "shop-copy-p4m8r.rabbitflare.link",
              "primaryDomain": "shop-copy-p4m8r.rabbitflare.link",
              "siteTitle": "Example Shop",
              "wordpress": {
                "adminUsername": "editor",
                "adminEmail": "you@example.com"
              },
              "sslStatus": "none",
              "cdn": "off",
              "firewall": {
                "mode": "off",
                "status": "off"
              },
              "malwareProtection": {
                "enabled": true,
                "included": true
              },
              "customResources": false,
              "stagingOf": null,
              "staging": null,
              "clone": {
                "id": "2b7e1c9d-3a4f-4e5b-8d6c-0f1e2a3b4c5d",
                "status": "queued",
                "stage": "Setting up the new site",
                "progress": null,
                "sourceName": "Shop",
                "error": null
              },
              "clonedFrom": null,
              "beingCloned": null,
              "iconUrl": null,
              "lastError": null,
              "readyAt": null,
              "createdAt": "2026-11-18T15:40:12.000Z",
              "updatedAt": "2026-11-18T15:40:12.000Z"
            },
            "clone": {
              "id": "2b7e1c9d-3a4f-4e5b-8d6c-0f1e2a3b4c5d",
              "status": "queued",
              "stage": "Setting up the new site",
              "progress": null,
              "source": {
                "id": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                "name": "Shop",
                "serverName": "Production"
              },
              "target": {
                "id": "6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
                "name": "Shop copy",
                "serverName": "Production"
              },
              "crossServer": false,
              "options": {
                "resources": true,
                "firewall": true,
                "cron": true,
                "noindex": true
              },
              "lastError": null,
              "notes": [],
              "health": null,
              "skipped": [],
              "skippedCount": 0,
              "sizes": null,
              "cancellable": true,
              "createdAt": "2026-11-18T15:40:12.000Z",
              "startedAt": null,
              "finishedAt": null
            }
          }
        ]
      },
      "CloneStartInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9 ._-]*$",
            "description": "The site's name: 2 to 48 letters, numbers, spaces, dots, dashes or underscores, starting with a letter or number."
          },
          "serverId": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "The server to clone the site to: the site's own, or another server of the account (`destinations` in `GET /sites/{siteId}/clone`)."
          },
          "options": {
            "description": "What to copy besides the files and the database. Left out: the defaults.",
            "type": "object",
            "properties": {
              "resources": {
                "description": "Copy the site's PHP and resource settings, where they fit the destination server. Default true.",
                "type": "boolean"
              },
              "firewall": {
                "description": "Copy the firewall's settings, addresses and exceptions. Default true.",
                "type": "boolean"
              },
              "cron": {
                "description": "Copy the site's cron jobs, paused. Default true.",
                "type": "boolean"
              },
              "noindex": {
                "description": "Ask search engines not to index the clone. Default false.",
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "name",
          "serverId"
        ],
        "additionalProperties": false,
        "description": "The new site's name, and where to clone the site to.",
        "examples": [
          {
            "name": "Shop copy",
            "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
            "options": {
              "noindex": true
            }
          }
        ]
      },
      "Cloud": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The cloud's id. Use it to list its regions and plans, and to create a server.",
            "x-known-values": [
              "digitalocean",
              "vultr",
              "hetzner",
              "linode",
              "gcp",
              "edge",
              "custom"
            ]
          },
          "name": {
            "type": "string",
            "description": "The cloud's name, as the panel shows it."
          },
          "storage": {
            "type": "string",
            "description": "The kind of disk its servers have, as the panel shows it next to the disk size (for example SSD or NVMe SSD)."
          },
          "metered": {
            "type": "boolean",
            "description": "Whether data transfer beyond what the plan includes is billed by use, to your card."
          },
          "ownServer": {
            "type": "boolean",
            "description": "Whether this is `custom`: servers you already have at any provider, connected with one command. Their size and location are your provider's."
          }
        },
        "required": [
          "id",
          "name",
          "storage",
          "metered",
          "ownServer"
        ],
        "description": "A cloud you can create servers on, or `custom` for connecting servers you already have.",
        "examples": [
          {
            "id": "digitalocean",
            "name": "DigitalOcean",
            "storage": "SSD",
            "metered": false,
            "ownServer": false
          }
        ]
      },
      "CronJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The cron job's id."
          },
          "siteId": {
            "type": "string",
            "description": "The site it runs on."
          },
          "name": {
            "type": "string",
            "description": "The job's name."
          },
          "type": {
            "type": "string",
            "description": "What the job runs: `wp_cli` (a WP-CLI command), `php` (a PHP script in the site), `url` (calls an address, as a visitor would) or `command` (a shell command).",
            "x-known-values": [
              "wp_cli",
              "php",
              "url",
              "command"
            ]
          },
          "target": {
            "type": "string",
            "description": "What it runs, by `type`: the WP-CLI command without `wp` (`transient delete --expired`), the PHP script's path in the site and its arguments (`/wp-content/tasks/report.php --quiet`), the address it calls, or the shell command."
          },
          "schedule": {
            "type": "string",
            "description": "When it runs: a cron schedule of five fields (minute, hour, day of month, month, day of week) in UTC, like `0 3 * * *` (every day at 03:00 UTC)."
          },
          "timeoutSeconds": {
            "type": "integer",
            "description": "How long a run may take, in seconds, before it's stopped (60 to 7,200)."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether it runs on its schedule. `false`: paused (it can still be run by hand)."
          },
          "createdAt": {
            "type": "string",
            "description": "When the job was added.",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "When it was last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "siteId",
          "name",
          "type",
          "target",
          "schedule",
          "timeoutSeconds",
          "enabled",
          "createdAt",
          "updatedAt"
        ],
        "description": "A scheduled task on a site, run by its server as the site's own user in the site's folder. Every job's runs are kept (the last 20, with their output).",
        "examples": [
          {
            "id": "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
            "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "name": "Nightly clean-up",
            "type": "wp_cli",
            "target": "transient delete --expired",
            "schedule": "0 3 * * *",
            "timeoutSeconds": 900,
            "enabled": true,
            "createdAt": "2026-11-02T09:14:05.000Z",
            "updatedAt": "2026-11-02T09:14:05.000Z"
          }
        ]
      },
      "CronJobInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The job's name, up to 80 characters."
          },
          "type": {
            "type": "string",
            "enum": [
              "wp_cli",
              "php",
              "url",
              "command"
            ],
            "description": "What the job runs: `wp_cli` (a WP-CLI command), `php` (a PHP script in the site), `url` (calls an address, as a visitor would) or `command` (a shell command)."
          },
          "target": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "What it runs, on one line (up to 2,000 characters), by `type`: a WP-CLI command (`transient delete --expired`; a leading `wp` is left out), a PHP script's path in the site that starts with `/` and its arguments (`/wp-content/tasks/report.php --quiet`), a full address starting with `https://` or `http://`, or a shell command. It runs as the site's own user, in the site's folder."
          },
          "schedule": {
            "type": "string",
            "description": "When it runs: a cron schedule of five fields (minute, hour, day of month, month, day of week) in UTC, with numbers, `*`, ranges (`1-5`), steps (`*/15`) and lists (`1,15`). For example `*/15 * * * *` (every 15 minutes) or `0 3 * * 0` (Sundays at 03:00 UTC)."
          },
          "timeoutSeconds": {
            "description": "How long a run may take, in seconds, before it's stopped: 60 (1 minute) to 7,200 (2 hours). Left out: 300 (5 minutes).",
            "type": "integer",
            "minimum": 60,
            "maximum": 7200
          },
          "enabled": {
            "description": "Whether it runs on its schedule. Left out: `true`. `false` adds it paused.",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "type",
          "target",
          "schedule"
        ],
        "additionalProperties": false,
        "description": "A new cron job. A site can have up to 25.",
        "examples": [
          {
            "name": "Nightly clean-up",
            "type": "wp_cli",
            "target": "transient delete --expired",
            "schedule": "0 3 * * *",
            "timeoutSeconds": 900
          }
        ]
      },
      "CronJobRunStarted": {
        "type": "object",
        "properties": {
          "running": {
            "type": "boolean",
            "description": "Whether the run is still going. `false`: it already ended, and it's the first of the job's runs."
          }
        },
        "required": [
          "running"
        ],
        "description": "A run of a cron job, started by hand.",
        "examples": [
          {
            "running": true
          }
        ]
      },
      "CronJobUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The job's name, up to 80 characters."
          },
          "type": {
            "type": "string",
            "enum": [
              "wp_cli",
              "php",
              "url",
              "command"
            ],
            "description": "What the job runs: `wp_cli` (a WP-CLI command), `php` (a PHP script in the site), `url` (calls an address, as a visitor would) or `command` (a shell command)."
          },
          "target": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "What it runs, on one line (up to 2,000 characters), by `type`: a WP-CLI command (`transient delete --expired`; a leading `wp` is left out), a PHP script's path in the site that starts with `/` and its arguments (`/wp-content/tasks/report.php --quiet`), a full address starting with `https://` or `http://`, or a shell command. It runs as the site's own user, in the site's folder."
          },
          "schedule": {
            "type": "string",
            "description": "When it runs: a cron schedule of five fields (minute, hour, day of month, month, day of week) in UTC, with numbers, `*`, ranges (`1-5`), steps (`*/15`) and lists (`1,15`). For example `*/15 * * * *` (every 15 minutes) or `0 3 * * 0` (Sundays at 03:00 UTC)."
          },
          "timeoutSeconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 7200,
            "description": "How long a run may take, in seconds, before it's stopped: 60 (1 minute) to 7,200 (2 hours)."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether it runs on its schedule. `false`: paused."
          }
        },
        "required": [
          "name",
          "type",
          "target",
          "schedule",
          "timeoutSeconds",
          "enabled"
        ],
        "additionalProperties": false,
        "description": "Every setting of a cron job: they all replace the job's own, so each is required (a paused job stays paused only with `enabled: false`).",
        "examples": [
          {
            "name": "Nightly clean-up",
            "type": "wp_cli",
            "target": "transient delete --expired",
            "schedule": "30 2 * * *",
            "timeoutSeconds": 900,
            "enabled": true
          }
        ]
      },
      "CronRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The run's id. It stays the same for as long as the run is kept."
          },
          "startedAt": {
            "type": "string",
            "description": "When it started. For skipped runs folded together (`repeats` over 1), the latest of them.",
            "format": "date-time"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it ended.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it ended. Null while it runs."
          },
          "durationMs": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "How long it took, in milliseconds. Null while it runs."
          },
          "exitCode": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The exit code it ended with (0 is success). Null when it didn't start, was stopped, or still runs."
          },
          "status": {
            "type": "string",
            "description": "How it ended: `success` (exit code 0), `failed` (another exit code, or it couldn't start), `timeout` (stopped at the job's `timeoutSeconds`) or `skipped` (it didn't run: see `reason`).",
            "x-known-values": [
              "success",
              "failed",
              "timeout",
              "skipped"
            ]
          },
          "trigger": {
            "type": "string",
            "description": "What started it: `schedule`, or `manual` (run by hand, in the panel or with `POST …/actions/run`).",
            "x-known-values": [
              "schedule",
              "manual"
            ]
          },
          "reason": {
            "description": "Why it was skipped, stopped or couldn't start, in a sentence (for example, the previous run was still going). Null otherwise.",
            "type": [
              "string",
              "null"
            ]
          },
          "outputBytes": {
            "type": "integer",
            "description": "The size of everything it printed, in bytes."
          },
          "truncated": {
            "type": "boolean",
            "description": "Whether only the end of its output is kept: the last 16 KB of a longer output."
          },
          "repeats": {
            "type": "integer",
            "description": "How many runs this entry stands for: skips in a row for the same reason are folded into one entry. 1 otherwise."
          },
          "output": {
            "type": "string",
            "description": "What the job printed (its output and errors together), the end of it when `truncated`."
          }
        },
        "required": [
          "id",
          "startedAt",
          "finishedAt",
          "durationMs",
          "exitCode",
          "status",
          "trigger",
          "reason",
          "outputBytes",
          "truncated",
          "repeats",
          "output"
        ],
        "description": "One run of a cron job: when, how it ended, and what it printed.",
        "examples": [
          {
            "id": "1795057200000-48213",
            "startedAt": "2026-11-19T03:00:00.000Z",
            "finishedAt": "2026-11-19T03:00:02.000Z",
            "durationMs": 2140,
            "exitCode": 0,
            "status": "success",
            "trigger": "schedule",
            "reason": null,
            "outputBytes": 40,
            "truncated": false,
            "repeats": 1,
            "output": "Success: 14 expired transients deleted.\n"
          }
        ]
      },
      "CronStatus": {
        "type": "object",
        "properties": {
          "checkedAt": {
            "type": "string",
            "description": "The time on the site's server when it was asked (UTC, the time zone of every schedule).",
            "format": "date-time"
          },
          "jobs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "jobId": {
                  "type": "string",
                  "description": "The cron job's id."
                },
                "running": {
                  "type": "boolean",
                  "description": "Whether it's running now."
                },
                "lastRun": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The run's id. It stays the same for as long as the run is kept."
                        },
                        "startedAt": {
                          "type": "string",
                          "description": "When it started. For skipped runs folded together (`repeats` over 1), the latest of them.",
                          "format": "date-time"
                        },
                        "finishedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "description": "When it ended.",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "When it ended. Null while it runs."
                        },
                        "durationMs": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "How long it took, in milliseconds. Null while it runs."
                        },
                        "exitCode": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "The exit code it ended with (0 is success). Null when it didn't start, was stopped, or still runs."
                        },
                        "status": {
                          "type": "string",
                          "description": "How it ended: `success` (exit code 0), `failed` (another exit code, or it couldn't start), `timeout` (stopped at the job's `timeoutSeconds`) or `skipped` (it didn't run: see `reason`).",
                          "x-known-values": [
                            "success",
                            "failed",
                            "timeout",
                            "skipped"
                          ]
                        },
                        "trigger": {
                          "type": "string",
                          "description": "What started it: `schedule`, or `manual` (run by hand, in the panel or with `POST …/actions/run`).",
                          "x-known-values": [
                            "schedule",
                            "manual"
                          ]
                        },
                        "reason": {
                          "description": "Why it was skipped, stopped or couldn't start, in a sentence (for example, the previous run was still going). Null otherwise.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "outputBytes": {
                          "type": "integer",
                          "description": "The size of everything it printed, in bytes."
                        },
                        "truncated": {
                          "type": "boolean",
                          "description": "Whether only the end of its output is kept: the last 16 KB of a longer output."
                        },
                        "repeats": {
                          "type": "integer",
                          "description": "How many runs this entry stands for: skips in a row for the same reason are folded into one entry. 1 otherwise."
                        }
                      },
                      "required": [
                        "id",
                        "startedAt",
                        "finishedAt",
                        "durationMs",
                        "exitCode",
                        "status",
                        "trigger",
                        "reason",
                        "outputBytes",
                        "truncated",
                        "repeats"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its latest run, without the output (`GET /sites/{siteId}/cron-jobs/{jobId}/runs` has it). Null when it hasn't run yet."
                }
              },
              "required": [
                "jobId",
                "running",
                "lastRun"
              ],
              "description": "One job's state."
            },
            "description": "Every cron job of the site, in the order of their ids."
          }
        },
        "required": [
          "checkedAt",
          "jobs"
        ],
        "description": "Which of a site's cron jobs are running now, and how each one's latest run went, as its server reports them.",
        "examples": [
          {
            "checkedAt": "2026-11-19T10:42:17.000Z",
            "jobs": [
              {
                "jobId": "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
                "running": false,
                "lastRun": {
                  "id": "1795057200000-48213",
                  "startedAt": "2026-11-19T03:00:00.000Z",
                  "finishedAt": "2026-11-19T03:00:02.000Z",
                  "durationMs": 2140,
                  "exitCode": 0,
                  "status": "success",
                  "trigger": "schedule",
                  "reason": null,
                  "outputBytes": 40,
                  "truncated": false,
                  "repeats": 1
                }
              }
            ]
          }
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "The error's family, from the HTTP status. Stable: switch on it first.",
                "x-known-values": [
                  "invalid_request_error",
                  "authentication_error",
                  "payment_error",
                  "permission_error",
                  "not_found_error",
                  "conflict_error",
                  "rate_limit_error",
                  "api_error"
                ]
              },
              "code": {
                "type": "string",
                "description": "The exact reason, in snake_case. The errors guide lists every code; new codes can appear."
              },
              "message": {
                "type": "string",
                "description": "What went wrong, in a sentence for a person. Not for parsing: the wording can change."
              },
              "fields": {
                "description": "When the request is at fault: each field's path (`site.adminEmail`) and what's wrong with it.",
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              "requestId": {
                "type": "string",
                "description": "The request's id, the same as the X-Request-Id header. Quote it to support."
              },
              "docUrl": {
                "type": "string",
                "description": "The errors guide, at this code."
              },
              "requiredScopes": {
                "description": "With insufficient_scope: every scope the operation needs.",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "missingScopes": {
                "description": "With insufficient_scope: the scopes the token lacks.",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "expiredAt": {
                "type": "string",
                "description": "With token_expired: when the token expired.",
                "format": "date-time"
              },
              "retryAfterSeconds": {
                "description": "With rate_limited, api_read_only and api_unavailable: seconds to wait before trying again, as in Retry-After.",
                "type": "integer"
              },
              "scope": {
                "type": "string",
                "description": "With rate_limited: which limit was reached.",
                "x-known-values": [
                  "token",
                  "account",
                  "create",
                  "operation",
                  "network"
                ]
              },
              "limit": {
                "description": "With rate_limited: the number of requests the limit allows in its window.",
                "type": "integer"
              }
            },
            "required": [
              "type",
              "code",
              "message",
              "requestId",
              "docUrl"
            ],
            "description": "What went wrong."
          }
        },
        "required": [
          "error"
        ],
        "description": "The answer to a request that failed. `type` and the HTTP status say what kind of failure it is, `code` the exact reason.",
        "examples": [
          {
            "error": {
              "type": "invalid_request_error",
              "code": "validation_failed",
              "message": "Choose a plan offered on the cloud you picked",
              "fields": {
                "planId": "Choose a plan offered on the cloud you picked"
              },
              "requestId": "req_8Zk2mPq4Xc7Lw9Tn0Bv3Ys",
              "docUrl": "https://rabbitflare.com/docs/api/errors#validation_failed"
            }
          }
        ]
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event's id. A webhook for this event carries the same id: use it to ignore a delivery you already handled."
          },
          "type": {
            "type": "string",
            "description": "What happened (see `GET /webhooks/event-types`). New types can appear: ignore those you don't know.",
            "x-known-values": [
              "server.created",
              "server.ready",
              "server.provisioning_failed",
              "server.powered_on",
              "server.powered_off",
              "server.rebooted",
              "server.resized",
              "server.snapshot_created",
              "server.snapshot_deleted",
              "server.restored",
              "server.unreachable",
              "server.missing",
              "server.suspended",
              "server.resumed",
              "server.deleted",
              "server.security_enabled",
              "server.security_disabled",
              "server.security_failed",
              "site.created",
              "site.ready",
              "site.install_failed",
              "site.deleted",
              "site.delete_failed",
              "site.domain_added",
              "site.domain_verified",
              "site.domain_removed",
              "site.primary_domain_changed",
              "site.domains_updated",
              "site.domains_failed",
              "site.cdn_enabled",
              "site.cdn_disabled",
              "site.cdn_failed",
              "site.cdn_purged",
              "site.cdn_purge_failed",
              "site.cdn_hostname_ready",
              "site.cdn_hostname_failed",
              "site.cloned",
              "site.clone_failed",
              "site.resources_updated",
              "site.resources_failed",
              "site.firewall_updated",
              "site.firewall_failed",
              "media_offload.enabled",
              "media_offload.disabled",
              "media_offload.failed",
              "media_offload.run_completed",
              "media_offload.run_failed",
              "smtp.enabled",
              "smtp.disabled",
              "smtp.paused",
              "smtp.resumed",
              "rabbitpress.installed",
              "rabbitpress.removed",
              "rabbitpress.failed",
              "backup.started",
              "backup.completed",
              "backup.failed",
              "backup.restore_started",
              "backup.restored",
              "backup.restore_failed",
              "backup.delete_failed",
              "staging.created",
              "staging.refreshed",
              "staging.pushed",
              "staging.push_undone",
              "staging.failed",
              "staging.deleted",
              "staging.needs_attention",
              "malware_protection.enabled",
              "malware_protection.disabled",
              "malware.found",
              "malware.cleaned",
              "malware.warning",
              "ticket.opened",
              "ticket.answered",
              "api_token.created",
              "api_token.revoked",
              "webhook_endpoint.disabled",
              "ping"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "When it happened.",
            "format": "date-time"
          },
          "level": {
            "type": "string",
            "description": "How it went: `info`, `success`, `warning` (something to look at) or `error` (it failed).",
            "x-known-values": [
              "info",
              "success",
              "warning",
              "error"
            ]
          },
          "message": {
            "type": "string",
            "description": "What happened, as one sentence: the line the panel's Activity shows. For people to read; don't parse it."
          },
          "actor": {
            "$ref": "#/components/schemas/EventActor"
          },
          "server": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EventSubject"
              },
              {
                "type": "null"
              }
            ],
            "description": "The server it was about, or `null`."
          },
          "site": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EventSubject"
              },
              {
                "type": "null"
              }
            ],
            "description": "The site it was about, or `null`."
          },
          "mailDomain": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EventSubject"
              },
              {
                "type": "null"
              }
            ],
            "description": "The mail domain it was about, or `null`."
          }
        },
        "required": [
          "id",
          "type",
          "createdAt",
          "level",
          "message",
          "actor",
          "server",
          "site",
          "mailDomain"
        ],
        "description": "Something that happened on the account: a server became ready, a site was deleted, an API token was made. The same event is listed by `GET /events` and sent to webhook endpoints.",
        "examples": [
          {
            "id": "5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60",
            "type": "site.ready",
            "createdAt": "2026-11-18T08:46:49.000Z",
            "level": "success",
            "message": "“Blog” is live at https://blog-k3x9q.rabbitflare.link",
            "actor": {
              "type": "system",
              "name": null
            },
            "server": {
              "id": "6f0c6c0e-5d0b-4b53-9a7e-2f1a3a6d7b11",
              "name": "web-1"
            },
            "site": {
              "id": "9b1e4f2a-7c3d-4e5f-8a9b-0c1d2e3f4a5b",
              "name": "Blog"
            },
            "mailDomain": null
          }
        ]
      },
      "EventActor": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Who did it: `user` (a person in the panel), `api_token` (a call with an API token), `system` (Rabbitflare on its own) or `support` (Rabbitflare's support team).",
            "x-known-values": [
              "user",
              "api_token",
              "system",
              "support"
            ]
          },
          "name": {
            "description": "The team member's or API token's name. `null` for the account's owner, for Rabbitflare and for support.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "type",
          "name"
        ],
        "description": "Who or what made the event happen."
      },
      "EventSubject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Its id."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          }
        },
        "required": [
          "id",
          "name"
        ],
        "description": "A server, site or mail domain the event is about: its id and name."
      },
      "EventType": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The event type, as events and webhooks name it.",
            "x-known-values": [
              "server.created",
              "server.ready",
              "server.provisioning_failed",
              "server.powered_on",
              "server.powered_off",
              "server.rebooted",
              "server.resized",
              "server.snapshot_created",
              "server.snapshot_deleted",
              "server.restored",
              "server.unreachable",
              "server.missing",
              "server.suspended",
              "server.resumed",
              "server.deleted",
              "server.security_enabled",
              "server.security_disabled",
              "server.security_failed",
              "site.created",
              "site.ready",
              "site.install_failed",
              "site.deleted",
              "site.delete_failed",
              "site.domain_added",
              "site.domain_verified",
              "site.domain_removed",
              "site.primary_domain_changed",
              "site.domains_updated",
              "site.domains_failed",
              "site.cdn_enabled",
              "site.cdn_disabled",
              "site.cdn_failed",
              "site.cdn_purged",
              "site.cdn_purge_failed",
              "site.cdn_hostname_ready",
              "site.cdn_hostname_failed",
              "site.cloned",
              "site.clone_failed",
              "site.resources_updated",
              "site.resources_failed",
              "site.firewall_updated",
              "site.firewall_failed",
              "media_offload.enabled",
              "media_offload.disabled",
              "media_offload.failed",
              "media_offload.run_completed",
              "media_offload.run_failed",
              "smtp.enabled",
              "smtp.disabled",
              "smtp.paused",
              "smtp.resumed",
              "rabbitpress.installed",
              "rabbitpress.removed",
              "rabbitpress.failed",
              "backup.started",
              "backup.completed",
              "backup.failed",
              "backup.restore_started",
              "backup.restored",
              "backup.restore_failed",
              "backup.delete_failed",
              "staging.created",
              "staging.refreshed",
              "staging.pushed",
              "staging.push_undone",
              "staging.failed",
              "staging.deleted",
              "staging.needs_attention",
              "malware_protection.enabled",
              "malware_protection.disabled",
              "malware.found",
              "malware.cleaned",
              "malware.warning",
              "ticket.opened",
              "ticket.answered",
              "api_token.created",
              "api_token.revoked",
              "webhook_endpoint.disabled",
              "ping"
            ]
          },
          "category": {
            "type": "string",
            "description": "The group it belongs to: `servers`, `sites`, `backups`, `staging`, `domains`, `billing`, `mail`, `support` or `api`.",
            "x-known-values": [
              "servers",
              "sites",
              "backups",
              "staging",
              "malware",
              "support",
              "api"
            ]
          },
          "description": {
            "type": "string",
            "description": "What it means, in one line."
          }
        },
        "required": [
          "type",
          "category",
          "description"
        ],
        "description": "One kind of event: its name, its group and what it means.",
        "examples": [
          {
            "type": "site.ready",
            "category": "sites",
            "description": "A site finished installing and is live."
          }
        ]
      },
      "FileChmodInput": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "maxLength": 4096,
            "description": "The file's or folder's path in the site."
          },
          "mode": {
            "type": "string",
            "pattern": "^[0-7]{3}$",
            "description": "Its new permissions, as three octal digits: `644` for most files, `755` for folders, `600` for a file only the site may read."
          }
        },
        "required": [
          "path",
          "mode"
        ],
        "additionalProperties": false,
        "description": "A file's or folder's new permissions.",
        "examples": [
          {
            "path": "/wp-config.php",
            "mode": "600"
          }
        ]
      },
      "FileCompressInput": {
        "type": "object",
        "properties": {
          "paths": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 4096,
              "description": "A file or folder to put in the archive."
            },
            "description": "What to put in the archive (1 to 500 files or folders, each with all it holds; links are left out)."
          },
          "destination": {
            "type": "string",
            "maxLength": 4096,
            "description": "The new archive's path in the site, ending in `.zip`. Nothing may be there yet."
          }
        },
        "required": [
          "paths",
          "destination"
        ],
        "additionalProperties": false,
        "description": "Files and folders to put in a new .zip archive.",
        "examples": [
          {
            "paths": [
              "/wp-content/themes/bakery"
            ],
            "destination": "/wp-content/uploads/bakery-theme.zip"
          }
        ]
      },
      "FileContent": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "The file's path in the site."
          },
          "content": {
            "type": "string",
            "description": "The file's text (UTF-8)."
          },
          "version": {
            "type": "string",
            "description": "The file's version: send it as `expectedVersion` when writing it back."
          },
          "sizeBytes": {
            "type": "integer",
            "description": "Its size, in bytes."
          },
          "modifiedAt": {
            "type": "string",
            "description": "When it was last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "path",
          "content",
          "version",
          "sizeBytes",
          "modifiedAt"
        ],
        "description": "A text file of a site, with its version for a safe save.",
        "examples": [
          {
            "path": "/robots.txt",
            "content": "User-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php\n",
            "version": "1795017600000000000:67",
            "sizeBytes": 67,
            "modifiedAt": "2026-11-18T08:00:00.000Z"
          }
        ]
      },
      "FileCreateInput": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "maxLength": 4096,
            "description": "The new file's or folder's path in the site."
          }
        },
        "required": [
          "path"
        ],
        "additionalProperties": false,
        "description": "Where to make a new, empty file or folder.",
        "examples": [
          {
            "path": "/wp-content/uploads/reports"
          }
        ]
      },
      "FileDeleteInput": {
        "type": "object",
        "properties": {
          "paths": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 4096,
              "description": "A path to delete."
            },
            "description": "The files and folders to delete (1 to 500), each with all it holds."
          }
        },
        "required": [
          "paths"
        ],
        "additionalProperties": false,
        "description": "What to delete.",
        "examples": [
          {
            "paths": [
              "/wp-content/uploads/old-logo.png",
              "/wp-content/upgrade"
            ]
          }
        ]
      },
      "FileEntry": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Its name: the last part of its path."
          },
          "path": {
            "type": "string",
            "description": "Its path in the site, from the site's folder (always starts with `/`)."
          },
          "type": {
            "type": "string",
            "description": "`file`, `dir` (a folder), `link` (a symbolic link: see `linkTargetType`) or `other` (anything else, like a socket).",
            "x-known-values": [
              "file",
              "dir",
              "link",
              "other"
            ]
          },
          "sizeBytes": {
            "type": "integer",
            "description": "Its size, in bytes. For a folder, the size of the folder's own entry, not of what it holds."
          },
          "modifiedAt": {
            "type": "string",
            "description": "When it was last changed.",
            "format": "date-time"
          },
          "mode": {
            "type": "string",
            "description": "Its permissions, as three octal digits: `644` for most files, `755` for folders."
          },
          "version": {
            "type": "string",
            "description": "Changes whenever the file changes. Send it as `expectedVersion` when writing the file, so a change made by someone else in the meantime isn't overwritten."
          },
          "linkTargetType": {
            "description": "For a link: what it leads to: `file`, `dir` (a folder), or `broken` (to nothing, or outside the site's folder, where it can't be followed). Null for anything else.",
            "x-known-values": [
              "file",
              "dir",
              "broken"
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "path",
          "type",
          "sizeBytes",
          "modifiedAt",
          "mode",
          "version",
          "linkTargetType"
        ],
        "description": "A file, folder or link in a site's folder.",
        "examples": [
          {
            "name": "team-photo.jpg",
            "path": "/wp-content/uploads/2026/11/team-photo.jpg",
            "type": "file",
            "sizeBytes": 284113,
            "modifiedAt": "2026-11-18T16:20:45.512Z",
            "mode": "644",
            "version": "1795025645512000000:284113",
            "linkTargetType": null
          }
        ]
      },
      "FileExtractInput": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "maxLength": 4096,
            "description": "The .zip archive's path in the site."
          },
          "destination": {
            "type": "string",
            "maxLength": 4096,
            "description": "The folder to extract it into (it must exist). Files already there with the same names are replaced."
          }
        },
        "required": [
          "path",
          "destination"
        ],
        "additionalProperties": false,
        "description": "A .zip archive, and where to extract it.",
        "examples": [
          {
            "path": "/wp-content/uploads/theme.zip",
            "destination": "/wp-content/themes"
          }
        ]
      },
      "FileList": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "The folder's path in the site."
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileEntry"
            },
            "description": "What the folder holds: folders (and links to folders) first, then the rest, each by name."
          },
          "truncated": {
            "type": "boolean",
            "description": "Whether the folder holds more than 5,000 entries, of which only 5,000 are listed (not chosen by name). List the folders inside it instead."
          }
        },
        "required": [
          "path",
          "entries",
          "truncated"
        ],
        "description": "A folder of a site, with everything it holds.",
        "examples": [
          {
            "path": "/wp-content",
            "entries": [
              {
                "name": "plugins",
                "path": "/wp-content/plugins",
                "type": "dir",
                "sizeBytes": 4096,
                "modifiedAt": "2026-11-12T08:03:19.000Z",
                "mode": "755",
                "version": "1794470599000000000:4096",
                "linkTargetType": null
              },
              {
                "name": "themes",
                "path": "/wp-content/themes",
                "type": "dir",
                "sizeBytes": 4096,
                "modifiedAt": "2026-10-30T14:41:02.000Z",
                "mode": "755",
                "version": "1793371262000000000:4096",
                "linkTargetType": null
              },
              {
                "name": "uploads",
                "path": "/wp-content/uploads",
                "type": "dir",
                "sizeBytes": 4096,
                "modifiedAt": "2026-11-18T16:20:45.000Z",
                "mode": "755",
                "version": "1795018845000000000:4096",
                "linkTargetType": null
              },
              {
                "name": "index.php",
                "path": "/wp-content/index.php",
                "type": "file",
                "sizeBytes": 28,
                "modifiedAt": "2026-09-14T10:00:00.000Z",
                "mode": "644",
                "version": "1789380000000000000:28",
                "linkTargetType": null
              }
            ],
            "truncated": false
          }
        ]
      },
      "FileMoveInput": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "maxLength": 4096,
            "description": "The file's or folder's path now."
          },
          "to": {
            "type": "string",
            "maxLength": 4096,
            "description": "Its new path, name included (its folder must exist)."
          },
          "overwrite": {
            "description": "`true`: replace a file already at `to` (never a folder). Left out or `false`: refused if something is there (`409 exists`).",
            "type": "boolean"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "additionalProperties": false,
        "description": "A file or folder, and where it goes.",
        "examples": [
          {
            "from": "/wp-content/uploads/old-logo.png",
            "to": "/wp-content/uploads/2026/11/logo.png"
          }
        ]
      },
      "FilesDeleted": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "integer",
            "description": "How many of the paths were deleted (a folder with all it held counts as one)."
          }
        },
        "required": [
          "deleted"
        ],
        "description": "What a delete removed.",
        "examples": [
          {
            "deleted": 3
          }
        ]
      },
      "FilesExtracted": {
        "type": "object",
        "properties": {
          "extractedFiles": {
            "type": "integer",
            "description": "How many files the archive put in place (folders aren't counted)."
          },
          "extractedBytes": {
            "type": "integer",
            "description": "Their total size, in bytes."
          }
        },
        "required": [
          "extractedFiles",
          "extractedBytes"
        ],
        "description": "What extracting an archive put in place.",
        "examples": [
          {
            "extractedFiles": 1873,
            "extractedBytes": 48211943
          }
        ]
      },
      "FileWriteInput": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "maxLength": 4096,
            "description": "The file's path in the site. A file that isn't there yet is made (its folder must exist)."
          },
          "content": {
            "type": "string",
            "maxLength": 2097152,
            "description": "The file's whole new text (UTF-8). The request's body is at most 1 MB; upload larger files instead."
          },
          "expectedVersion": {
            "description": "The `version` the file had when you read it: if it changed since, nothing is written (`409 conflict`). `new`: only if the file isn't there yet. Left out: written whatever happened meanwhile.",
            "type": "string",
            "maxLength": 64
          },
          "force": {
            "description": "`true`: save a PHP file even with a syntax error. Left out or `false`: a .php file is checked first and isn't saved if PHP finds an error (`422 lint_error`).",
            "type": "boolean"
          }
        },
        "required": [
          "path",
          "content"
        ],
        "additionalProperties": false,
        "description": "A text file's new content.",
        "examples": [
          {
            "path": "/robots.txt",
            "content": "User-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php\n",
            "expectedVersion": "1795017600000000000:35"
          }
        ]
      },
      "FirewallAddressInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "allow",
              "block"
            ],
            "description": "`block`: refuse its requests on every page of the site. `allow`: let its requests skip the firewall's checks (only for addresses you trust, like your office)."
          },
          "address": {
            "type": "string",
            "maxLength": 64,
            "description": "An IPv4 or IPv6 address, or a range like 203.0.113.0/24 (at most /8 for IPv4, /16 for IPv6). The server's own addresses can't be blocked."
          },
          "note": {
            "description": "A note for yourself, up to 80 characters.",
            "type": "string",
            "maxLength": 80
          }
        },
        "required": [
          "kind",
          "address"
        ],
        "additionalProperties": false,
        "description": "An IP address or range to allow or block on a site.",
        "examples": [
          {
            "kind": "block",
            "address": "198.51.100.0/24",
            "note": "Login attempts from a scanner"
          }
        ]
      },
      "FirewallEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event's id."
          },
          "occurredAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the request came.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the request came. Null when not known."
          },
          "ip": {
            "type": "string",
            "description": "The IP address the request came from."
          },
          "method": {
            "type": "string",
            "description": "The request's HTTP method, like GET or POST."
          },
          "path": {
            "type": "string",
            "description": "The page asked for, without its query string."
          },
          "hasQuery": {
            "type": "boolean",
            "description": "Whether the address had a query string (left out of `path`)."
          },
          "blocked": {
            "type": "boolean",
            "description": "Whether the firewall blocked it. False: it was flagged and logged, but let through (in Monitor mode, for example)."
          },
          "httpStatus": {
            "type": "integer",
            "description": "The HTTP status the site answered (403 when blocked)."
          },
          "score": {
            "anyOf": [
              {
                "type": "integer",
                "description": "A score."
              },
              {
                "type": "null"
              }
            ],
            "description": "How suspicious the request looked: the total weight of the rules it matched. Null when not known."
          },
          "userAgent": {
            "anyOf": [
              {
                "type": "string",
                "description": "A browser's name."
              },
              {
                "type": "null"
              }
            ],
            "description": "The browser or tool the request said it came from. Null when it sent none."
          },
          "category": {
            "type": "string",
            "description": "What kind of attack it looked like, in words: for example `SQL injection`, `Cross-site scripting (XSS)` or `Suspicious request`."
          },
          "matchedRules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ruleId": {
                  "type": "integer",
                  "description": "The rule's number: an exception (`POST /sites/{siteId}/firewall/exceptions`) can turn it off for a false alarm."
                },
                "message": {
                  "type": "string",
                  "description": "What the rule found."
                }
              },
              "required": [
                "ruleId",
                "message"
              ],
              "description": "A rule the request matched."
            },
            "description": "The firewall rules the request matched."
          }
        },
        "required": [
          "id",
          "occurredAt",
          "ip",
          "method",
          "path",
          "hasQuery",
          "blocked",
          "httpStatus",
          "score",
          "userAgent",
          "category",
          "matchedRules"
        ],
        "description": "A request the site's firewall blocked or flagged.",
        "examples": [
          {
            "id": "aZq3Lk2mVt9Xw4Rn7Pb1",
            "occurredAt": "2026-11-18T10:02:44.000Z",
            "ip": "198.51.100.23",
            "method": "GET",
            "path": "/shop/",
            "hasQuery": true,
            "blocked": true,
            "httpStatus": 403,
            "score": 10,
            "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
            "category": "SQL injection",
            "matchedRules": [
              {
                "ruleId": 942270,
                "message": "Looking for basic SQL injection. Common attack string for MySQL, Oracle and others"
              },
              {
                "ruleId": 949110,
                "message": "Inbound Anomaly Score Exceeded (Total Score: 10)"
              }
            ]
          }
        ]
      },
      "FirewallExceptionInput": {
        "type": "object",
        "properties": {
          "ruleIds": {
            "minItems": 1,
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "The rules to turn off (1 to 12), by number: the `ruleId` values of a firewall event's `matchedRules`."
          },
          "path": {
            "description": "Only on this page and the pages under it, like /wp-admin/admin-ajax.php (`/` is the front page only). Left out: everywhere on the site.",
            "type": "string",
            "maxLength": 300,
            "pattern": "^(?:\\/[A-Za-z0-9._~/%+-]*)?$"
          },
          "note": {
            "description": "A note for yourself, up to 120 characters.",
            "type": "string",
            "maxLength": 120
          }
        },
        "required": [
          "ruleIds"
        ],
        "additionalProperties": false,
        "description": "An exception for a false alarm: rules the firewall stops checking, on one page (and the pages under it) or everywhere on the site.",
        "examples": [
          {
            "ruleIds": [
              942270,
              942360
            ],
            "path": "/wp-admin/admin-ajax.php",
            "note": "Page builder saves"
          }
        ]
      },
      "FirewallRule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The rule's id."
          },
          "kind": {
            "type": "string",
            "description": "`allow`: requests from `address` skip the firewall's checks. `block`: requests from `address` are refused on every page of the site. `exception`: the rules in `ruleIds` stop checking requests (on `path` and the pages under it, or everywhere when `path` is null).",
            "x-known-values": [
              "allow",
              "block",
              "exception"
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "description": "An IP address or range."
              },
              {
                "type": "null"
              }
            ],
            "description": "The IP address or range, like 203.0.113.7 or 203.0.113.0/24, written as the firewall uses it (a range from its first address). Null for an exception."
          },
          "ruleIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "description": "A rule's number."
            },
            "description": "The firewall rules an exception turns off, by number (as an event's `matchedRules` names them). Empty for an address."
          },
          "path": {
            "anyOf": [
              {
                "type": "string",
                "description": "A path."
              },
              {
                "type": "null"
              }
            ],
            "description": "Where an exception applies: this page and the pages under it (`/` is the front page only). Null: everywhere on the site, and always for an address."
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "description": "A note."
              },
              {
                "type": "null"
              }
            ],
            "description": "The note given when it was added. Null when none was."
          },
          "createdAt": {
            "type": "string",
            "description": "When the rule was added.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "kind",
          "address",
          "ruleIds",
          "path",
          "note",
          "createdAt"
        ],
        "description": "An allowed or blocked address, or an exception for a false alarm, on a site's firewall.",
        "examples": [
          {
            "id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
            "kind": "block",
            "address": "198.51.100.0/24",
            "ruleIds": [],
            "path": null,
            "note": "Login attempts from a scanner",
            "createdAt": "2026-11-18T09:20:03.000Z"
          }
        ]
      },
      "FirewallSettingsInput": {
        "type": "object",
        "properties": {
          "mode": {
            "description": "`protect` (block attacks), `monitor` (log them, block nothing) or `off`.",
            "type": "string",
            "enum": [
              "off",
              "monitor",
              "protect"
            ]
          },
          "sensitivity": {
            "description": "`standard` (recommended) or `strict` (catches more, with more false alarms).",
            "type": "string",
            "enum": [
              "standard",
              "strict"
            ]
          },
          "loginProtection": {
            "description": "Slow down repeated sign-ins from one address.",
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "The firewall's settings to change. Settings left out stay as they are.",
        "examples": [
          {
            "mode": "protect",
            "sensitivity": "standard",
            "loginProtection": true
          }
        ]
      },
      "FirstSiteInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9 ._-]*$",
            "description": "The site's name: 2 to 48 letters, numbers, spaces, dots, dashes or underscores, starting with a letter or number."
          },
          "siteTitle": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The site's title in WordPress (up to 120 characters). It can be changed in WordPress later."
          },
          "adminUsername": {
            "type": "string",
            "pattern": "^[a-z0-9._-]{3,32}$",
            "description": "The WordPress administrator's username: 3 to 32 lowercase letters, numbers, dots, dashes or underscores. Not `admin` or `administrator`."
          },
          "adminEmail": {
            "description": "The WordPress administrator's email address.",
            "type": "string",
            "maxLength": 254
          },
          "resources": {
            "description": "What the site may use of its server. Left out: no limits of its own.",
            "$ref": "#/components/schemas/SiteResourcesInput"
          }
        },
        "required": [
          "name",
          "siteTitle",
          "adminUsername",
          "adminEmail"
        ],
        "additionalProperties": false,
        "description": "A WordPress site to install on a new server as soon as it's ready.",
        "examples": [
          {
            "name": "Shop",
            "siteTitle": "Example Shop",
            "adminUsername": "editor",
            "adminEmail": "you@example.com"
          }
        ]
      },
      "MalwareIgnoredPathInput": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000,
            "description": "A file or folder inside the site's folder, like wp-content/plugins/my-backup-tool."
          }
        },
        "required": [
          "path"
        ],
        "additionalProperties": false,
        "description": "A file or folder for scans to skip.",
        "examples": [
          {
            "path": "wp-content/plugins/my-backup-tool/restore.php"
          }
        ]
      },
      "MalwareProtectionSettingsInput": {
        "type": "object",
        "properties": {
          "alerts": {
            "type": "boolean",
            "description": "Email the account's owner about this site (threats, clean-ups, blacklists, security holes)."
          }
        },
        "required": [
          "alerts"
        ],
        "additionalProperties": false,
        "description": "A site's malware protection settings.",
        "examples": [
          {
            "alerts": false
          }
        ]
      },
      "MalwareThreat": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The threat's id (digits): what the clean, undo and ignore actions take in `threatIds`."
          },
          "kind": {
            "type": "string",
            "description": "`file` or `database`.",
            "x-known-values": [
              "file",
              "database"
            ]
          },
          "location": {
            "anyOf": [
              {
                "type": "string",
                "description": "A path."
              },
              {
                "type": "null"
              }
            ],
            "description": "The file, relative to the site's folder. Null for a threat in the database, or a file outside the site's folder."
          },
          "threat": {
            "type": "string",
            "description": "What it is, in words."
          },
          "signature": {
            "type": "string",
            "description": "The malware signature that matched, as Imunify360 names it."
          },
          "severity": {
            "type": "string",
            "description": "`critical`, `high`, `medium` or `low`.",
            "x-known-values": [
              "critical",
              "high",
              "medium",
              "low"
            ]
          },
          "foundBy": {
            "type": "string",
            "description": "`realtime` (as the file was written), `scan` (one asked for), `nightly` (a scheduled scan) or `database`.",
            "x-known-values": [
              "realtime",
              "scan",
              "nightly",
              "database"
            ]
          },
          "foundAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it was found. Null when not known.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was found. Null when not known."
          },
          "status": {
            "type": "string",
            "description": "`open` (clean or ignore it), `cleaned` or `ignored` (marked not malware).",
            "x-known-values": [
              "open",
              "cleaned",
              "ignored"
            ]
          },
          "doneAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it was cleaned. Null otherwise.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was cleaned. Null otherwise."
          },
          "canUndo": {
            "type": "boolean",
            "description": "Whether the clean-up can be undone (a copy of the file is kept `keepCopiesDays`)."
          }
        },
        "required": [
          "id",
          "kind",
          "location",
          "threat",
          "signature",
          "severity",
          "foundBy",
          "foundAt",
          "status",
          "doneAt",
          "canUndo"
        ],
        "description": "Malware or another threat found on a site.",
        "examples": [
          {
            "id": "1",
            "kind": "file",
            "location": "wp-content/uploads/cache.php",
            "threat": "Web shell (a backdoor that lets attackers run commands)",
            "signature": "SMW-SA-20634-php.bkdr.wshll-0",
            "severity": "critical",
            "foundBy": "realtime",
            "foundAt": "2026-11-25T08:14:02.000Z",
            "status": "open",
            "doneAt": null,
            "canUndo": false
          }
        ]
      },
      "MalwareThreatIdsInput": {
        "type": "object",
        "properties": {
          "threatIds": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,14}$"
            },
            "description": "The threats, by `id` (1 to 500)."
          }
        },
        "required": [
          "threatIds"
        ],
        "additionalProperties": false,
        "description": "Threats of a site.",
        "examples": [
          {
            "threatIds": [
              "1"
            ]
          }
        ]
      },
      "MalwareWordpressPluginInput": {
        "type": "object",
        "properties": {
          "installed": {
            "description": "Add the plugin to the site (about a minute), or take it off.",
            "type": "boolean"
          },
          "firewall": {
            "description": "The plugin's firewall in the site.",
            "type": "boolean"
          },
          "aiBotProtection": {
            "description": "AI bot protection in the site.",
            "type": "boolean"
          },
          "preset": {
            "description": "How strict AI bot protection is: `balanced` (recommended), `strict` or `monitor`.",
            "type": "string",
            "enum": [
              "balanced",
              "strict",
              "monitor"
            ]
          }
        },
        "additionalProperties": false,
        "description": "Imunify360's WordPress plugin in a site: what to change.",
        "examples": [
          {
            "aiBotProtection": true,
            "preset": "strict"
          }
        ]
      },
      "MediaOffloadEnableInput": {
        "type": "object",
        "properties": {
          "mode": {
            "description": "`copy`: files stay on the server and are copied to storage. `free` (free up disk): once storage holds them, files older than `freeAfterDays` are removed from the server and served from storage. Left out: `copy`.",
            "type": "string",
            "enum": [
              "copy",
              "free"
            ]
          },
          "freeAfterDays": {
            "description": "In free up disk mode, how many days new files stay on the server before their copy there is removed: 1, 3, 7, 14, 30, 90. Left out: 7.",
            "type": "number",
            "enum": [
              1,
              3,
              7,
              14,
              30,
              90
            ]
          },
          "kinds": {
            "description": "The kinds of files to keep in storage: `image` (Images: JPEG, PNG, WebP, AVIF, GIF, SVG), `video` (Video: MP4, MOV, WebM), `audio` (Audio: MP3, M4A, WAV, OGG), `document` (Documents: PDF, Word, Excel, PowerPoint, text), `archive` (Archives: ZIP, RAR, 7z, tar), `font` (Fonts: WOFF2, WOFF, TTF, OTF), `other` (Everything else: Any other file plugins keep there (CSS, JSON, logs…)). Left out: `image`, `video`, `audio`, `document`, `archive`, `font`.",
            "minItems": 1,
            "maxItems": 7,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "video",
                "audio",
                "document",
                "archive",
                "font",
                "other"
              ]
            }
          },
          "keep": {
            "description": "Folders of the uploads folder to keep on the server, besides the ones always kept there (private downloads and form uploads, backups and logs, files plugins rebuild, code). Left out: none.",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "description": "A folder of the uploads folder, like `2019/archive` (`*` matches within a name)."
            }
          }
        },
        "additionalProperties": false,
        "description": "The settings to turn Media Offload on with. Left out: `copy`, 7 days, the kinds `image`, `video`, `audio`, `document`, `archive`, `font`, and no extra folders.",
        "examples": [
          {},
          {
            "mode": "free",
            "freeAfterDays": 14,
            "kinds": [
              "image",
              "video"
            ],
            "keep": [
              "2019/archive"
            ]
          }
        ]
      },
      "MediaOffloadInspectInput": {
        "type": "object",
        "properties": {
          "settings": {
            "description": "The settings to inspect with. Left out: `copy`, 7 days, the kinds `image`, `video`, `audio`, `document`, `archive`, `font`, and no extra folders. The whole object left out: the defaults.",
            "type": "object",
            "properties": {
              "mode": {
                "description": "`copy`: files stay on the server and are copied to storage. `free` (free up disk): once storage holds them, files older than `freeAfterDays` are removed from the server and served from storage. Left out: `copy`.",
                "type": "string",
                "enum": [
                  "copy",
                  "free"
                ]
              },
              "freeAfterDays": {
                "description": "In free up disk mode, how many days new files stay on the server before their copy there is removed: 1, 3, 7, 14, 30, 90. Left out: 7.",
                "type": "number",
                "enum": [
                  1,
                  3,
                  7,
                  14,
                  30,
                  90
                ]
              },
              "kinds": {
                "description": "The kinds of files to keep in storage: `image` (Images: JPEG, PNG, WebP, AVIF, GIF, SVG), `video` (Video: MP4, MOV, WebM), `audio` (Audio: MP3, M4A, WAV, OGG), `document` (Documents: PDF, Word, Excel, PowerPoint, text), `archive` (Archives: ZIP, RAR, 7z, tar), `font` (Fonts: WOFF2, WOFF, TTF, OTF), `other` (Everything else: Any other file plugins keep there (CSS, JSON, logs…)). Left out: `image`, `video`, `audio`, `document`, `archive`, `font`.",
                "minItems": 1,
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "image",
                    "video",
                    "audio",
                    "document",
                    "archive",
                    "font",
                    "other"
                  ]
                }
              },
              "keep": {
                "description": "Folders of the uploads folder to keep on the server, besides the ones always kept there (private downloads and form uploads, backups and logs, files plugins rebuild, code). Left out: none.",
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "A folder of the uploads folder, like `2019/archive` (`*` matches within a name)."
                }
              }
            },
            "additionalProperties": false
          },
          "fresh": {
            "description": "Read the media library again, even if it was inspected with the same settings in the last 5 minutes. Left out: `false`.",
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "What to inspect turning Media Offload on with.",
        "examples": [
          {},
          {
            "settings": {
              "mode": "free",
              "kinds": [
                "image",
                "video"
              ]
            },
            "fresh": true
          }
        ]
      },
      "MediaOffloadInspection": {
        "type": "object",
        "properties": {
          "ready": {
            "type": "boolean",
            "description": "Nothing in the site's setup stands in the way of turning it on (`problems` is empty). Another media offload plugin must be deactivated too."
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A sentence."
            },
            "description": "What stands in the way, one sentence each."
          },
          "conflictingPlugins": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A plugin's name."
            },
            "description": "Other media offload plugins active on the site: deactivate them in WordPress first."
          },
          "files": {
            "type": "integer",
            "description": "Files in the uploads folder."
          },
          "bytes": {
            "type": "integer",
            "description": "Their size, in bytes."
          },
          "kinds": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "description": "A kind of file: `image` (Images: JPEG, PNG, WebP, AVIF, GIF, SVG), `video` (Video: MP4, MOV, WebM), `audio` (Audio: MP3, M4A, WAV, OGG), `document` (Documents: PDF, Word, Excel, PowerPoint, text), `archive` (Archives: ZIP, RAR, 7z, tar), `font` (Fonts: WOFF2, WOFF, TTF, OTF), `other` (Everything else: Any other file plugins keep there (CSS, JSON, logs…)).",
                  "x-known-values": [
                    "image",
                    "video",
                    "audio",
                    "document",
                    "archive",
                    "font",
                    "other"
                  ]
                },
                "files": {
                  "type": "integer",
                  "description": "Files of this kind that would move to storage."
                },
                "bytes": {
                  "type": "integer",
                  "description": "Their size, in bytes."
                }
              },
              "required": [
                "kind",
                "files",
                "bytes"
              ],
              "description": "What would move of one kind of file."
            },
            "description": "What would move to storage, by kind of file."
          },
          "keptOnServer": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "reason": {
                  "type": "string",
                  "description": "Why they stay: `folder` (a folder always kept, or one in `keep`), `kind` (a kind of file not chosen), `code` (code files), `hidden` (hidden files), `name` (a path too long for storage), `owner` (files that don't belong to the site's own user).",
                  "x-known-values": [
                    "folder",
                    "kind",
                    "code",
                    "hidden",
                    "name",
                    "owner"
                  ]
                },
                "files": {
                  "type": "integer",
                  "description": "Files."
                },
                "bytes": {
                  "type": "integer",
                  "description": "Their size, in bytes."
                }
              },
              "required": [
                "reason",
                "files",
                "bytes"
              ],
              "description": "Files kept on the server for one reason."
            },
            "description": "Files of the uploads folder that stay on the server, by reason."
          },
          "keptFolders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "folder": {
                  "type": "string",
                  "description": "A folder of the uploads folder."
                },
                "bytes": {
                  "type": "integer",
                  "description": "What stays there, in bytes."
                }
              },
              "required": [
                "folder",
                "bytes"
              ],
              "description": "A folder kept on the server."
            },
            "description": "Up to 10 folders kept on the server, largest first."
          },
          "disk": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "freeBytes": {
                    "type": "integer",
                    "description": "Free space, in bytes."
                  },
                  "totalBytes": {
                    "type": "integer",
                    "description": "The disk's size, in bytes."
                  }
                },
                "required": [
                  "freeBytes",
                  "totalBytes"
                ],
                "description": "The server's disk."
              },
              {
                "type": "null"
              }
            ],
            "description": "The site's server's disk. Null when it couldn't be read."
          },
          "multisite": {
            "type": "boolean",
            "description": "Whether the site is a WordPress multisite network."
          },
          "checkedAt": {
            "type": "string",
            "description": "When the media library was inspected (an inspection is kept 5 minutes).",
            "format": "date-time"
          }
        },
        "required": [
          "ready",
          "problems",
          "conflictingPlugins",
          "files",
          "bytes",
          "kinds",
          "keptOnServer",
          "keptFolders",
          "disk",
          "multisite",
          "checkedAt"
        ],
        "description": "What turning Media Offload on would move to storage and what would stay on the server, read from the site's server.",
        "examples": [
          {
            "ready": true,
            "problems": [],
            "conflictingPlugins": [],
            "files": 18726,
            "bytes": 12521012000,
            "kinds": [
              {
                "kind": "image",
                "files": 18120,
                "bytes": 9870000000
              },
              {
                "kind": "video",
                "files": 12,
                "bytes": 2410000000
              },
              {
                "kind": "audio",
                "files": 0,
                "bytes": 0
              },
              {
                "kind": "document",
                "files": 280,
                "bytes": 200000000
              },
              {
                "kind": "archive",
                "files": 0,
                "bytes": 0
              },
              {
                "kind": "font",
                "files": 0,
                "bytes": 0
              },
              {
                "kind": "other",
                "files": 0,
                "bytes": 0
              }
            ],
            "keptOnServer": [
              {
                "reason": "folder",
                "files": 310,
                "bytes": 41000000
              },
              {
                "reason": "code",
                "files": 4,
                "bytes": 12000
              }
            ],
            "keptFolders": [
              {
                "folder": "woocommerce_uploads",
                "bytes": 41000000
              }
            ],
            "disk": {
              "freeBytes": 52300000000,
              "totalBytes": 80000000000
            },
            "multisite": false,
            "checkedAt": "2026-11-19T10:05:12.000Z"
          }
        ]
      },
      "MediaOffloadRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The run's id."
          },
          "operation": {
            "type": "string",
            "description": "What it does: `sync` copies files that aren't in storage yet (new uploads are copied within a minute or two by themselves), `free` removes the server's copies of files storage holds (free up disk only), `verify` checks every file in storage and repairs what it can, `restore` brings every file back to the server, and `export` prepares one download of the whole media library (from the panel's Offload tab).",
            "x-known-values": [
              "sync",
              "free",
              "verify",
              "restore",
              "export"
            ]
          },
          "status": {
            "type": "string",
            "description": "`queued`, `running`, then `done`, `failed` (see `error`) or `cancelled`.",
            "x-known-values": [
              "queued",
              "running",
              "done",
              "failed",
              "cancelled"
            ]
          },
          "stage": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "What it's doing now, in a few words, like `Copying files to storage`. Null once it has finished."
          },
          "filesDone": {
            "type": "integer",
            "description": "Files done so far."
          },
          "filesTotal": {
            "type": "integer",
            "description": "Files it has to do (0 until it has counted them)."
          },
          "filesFailed": {
            "type": "integer",
            "description": "Files that couldn't be done: they're tried again later, and stay on the server meanwhile."
          },
          "bytesDone": {
            "type": "integer",
            "description": "Bytes done so far."
          },
          "bytesTotal": {
            "type": "integer",
            "description": "Bytes it has to do (0 until it has counted them)."
          },
          "bytesPerSecond": {
            "anyOf": [
              {
                "type": "number",
                "description": "Bytes a second."
              },
              {
                "type": "null"
              }
            ],
            "description": "How fast it's going, in bytes a second. Null when it isn't running."
          },
          "filesPerSecond": {
            "anyOf": [
              {
                "type": "number",
                "description": "Files a second."
              },
              {
                "type": "null"
              }
            ],
            "description": "How fast it's going, in files a second. Null when it isn't running."
          },
          "etaSeconds": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Seconds."
              },
              {
                "type": "null"
              }
            ],
            "description": "About how many seconds are left. Null when it isn't known."
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it didn't finish (with `status: \"failed\"` or `cancelled`). Null otherwise."
          },
          "turnOffAfter": {
            "type": "boolean",
            "description": "A `restore` that turns Media Offload off once every file is back on the server."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it started. Null while it's queued.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it started. Null while it's queued."
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it finished. Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it finished. Null until then."
          },
          "createdAt": {
            "type": "string",
            "description": "When it was asked for.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "operation",
          "status",
          "stage",
          "filesDone",
          "filesTotal",
          "filesFailed",
          "bytesDone",
          "bytesTotal",
          "bytesPerSecond",
          "filesPerSecond",
          "etaSeconds",
          "error",
          "turnOffAfter",
          "startedAt",
          "finishedAt",
          "createdAt"
        ],
        "description": "One operation on a site's offloaded media: copying, freeing up disk, checking, bringing files back, or preparing a download.",
        "examples": [
          {
            "id": "c4d5e6f7-8a9b-4c0d-9e1f-2a3b4c5d6e7f",
            "operation": "verify",
            "status": "done",
            "stage": null,
            "filesDone": 18412,
            "filesTotal": 18412,
            "filesFailed": 0,
            "bytesDone": 12480000000,
            "bytesTotal": 12480000000,
            "bytesPerSecond": null,
            "filesPerSecond": null,
            "etaSeconds": null,
            "error": null,
            "turnOffAfter": false,
            "startedAt": "2026-11-16T03:00:05.000Z",
            "finishedAt": "2026-11-16T03:04:41.000Z",
            "createdAt": "2026-11-16T03:00:01.000Z"
          }
        ]
      },
      "MediaOffloadRunInput": {
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "enum": [
              "sync",
              "free",
              "verify",
              "restore",
              "export"
            ],
            "description": "What to do: `sync` copies files that aren't in storage yet (new uploads are copied within a minute or two by themselves), `free` removes the server's copies of files storage holds (free up disk only), `verify` checks every file in storage and repairs what it can, `restore` brings every file back to the server, and `export` prepares one download of the whole media library (from the panel's Offload tab)."
          },
          "turnOffAfter": {
            "description": "With `restore`: turn Media Offload off once every file is back on the server. Left out: `false`.",
            "type": "boolean"
          }
        },
        "required": [
          "operation"
        ],
        "additionalProperties": false,
        "description": "An operation to start on the site's offloaded media. One runs at a time per site.",
        "examples": [
          {
            "operation": "verify"
          },
          {
            "operation": "restore",
            "turnOffAfter": true
          }
        ]
      },
      "MediaOffloadSettingsInput": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "copy",
              "free"
            ],
            "description": "`copy`: files stay on the server and are copied to storage. `free` (free up disk): once storage holds them, files older than `freeAfterDays` are removed from the server and served from storage."
          },
          "freeAfterDays": {
            "type": "number",
            "enum": [
              1,
              3,
              7,
              14,
              30,
              90
            ],
            "description": "In free up disk mode, how many days new files stay on the server before their copy there is removed: 1, 3, 7, 14, 30, 90."
          },
          "kinds": {
            "minItems": 1,
            "maxItems": 7,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "video",
                "audio",
                "document",
                "archive",
                "font",
                "other"
              ]
            },
            "description": "The kinds of files to keep in storage: `image` (Images: JPEG, PNG, WebP, AVIF, GIF, SVG), `video` (Video: MP4, MOV, WebM), `audio` (Audio: MP3, M4A, WAV, OGG), `document` (Documents: PDF, Word, Excel, PowerPoint, text), `archive` (Archives: ZIP, RAR, 7z, tar), `font` (Fonts: WOFF2, WOFF, TTF, OTF), `other` (Everything else: Any other file plugins keep there (CSS, JSON, logs…))."
          },
          "keep": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "description": "A folder of the uploads folder, like `2019/archive` (`*` matches within a name)."
            },
            "description": "Folders of the uploads folder to keep on the server, besides the ones always kept there (private downloads and form uploads, backups and logs, files plugins rebuild, code)."
          }
        },
        "required": [
          "mode",
          "freeAfterDays",
          "kinds",
          "keep"
        ],
        "additionalProperties": false,
        "description": "Every Media Offload setting: they all replace the site's own, so each is required.",
        "examples": [
          {
            "mode": "free",
            "freeAfterDays": 14,
            "kinds": [
              "image",
              "video",
              "document"
            ],
            "keep": []
          }
        ]
      },
      "MetricPoint": {
        "type": "object",
        "properties": {
          "t": {
            "type": "integer",
            "description": "The time of the reading, in Unix seconds."
          },
          "v": {
            "type": "number",
            "description": "The reading."
          }
        },
        "required": [
          "t",
          "v"
        ],
        "description": "One reading of a graph.",
        "examples": [
          {
            "t": 1763455200,
            "v": 12.4
          }
        ]
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "The page size that was used."
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether another page follows this one."
          },
          "nextCursor": {
            "description": "Pass it as `cursor` to get the next page. `null` on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "limit",
          "hasMore",
          "nextCursor"
        ],
        "description": "Where a list's page sits: whether more items follow, and the cursor to read them."
      },
      "PhpSecurity": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "description": "`current`: every PHP security fix Ubuntu has released is installed and running. `waiting`: a fix is released but not installed yet (they install themselves each day when `auto` is true). `restart`: it's installed, but some PHP still runs the build from before it (restart PHP). `unknown`: see `reason`.",
            "x-known-values": [
              "current",
              "waiting",
              "restart",
              "unknown"
            ]
          },
          "reason": {
            "description": "Why the state is `unknown`: `unchecked` (no check has finished yet), `failed` (no check has worked yet), `stale` (the latest check is too old to go by) or `lists` (the server's list of security updates is old, so newer fixes may be missing from it). Null otherwise.",
            "x-known-values": [
              "unchecked",
              "failed",
              "stale",
              "lists"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "build": {
            "anyOf": [
              {
                "type": "string",
                "description": "A PHP build."
              },
              {
                "type": "null"
              }
            ],
            "description": "The installed PHP build, like 8.3.6-0ubuntu0.24.04.13. Null until the first check."
          },
          "packages": {
            "type": "integer",
            "description": "How many PHP packages are installed (PHP itself and its extensions)."
          },
          "fixes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The package."
                },
                "installed": {
                  "type": "string",
                  "description": "The version installed now."
                },
                "fixed": {
                  "type": "string",
                  "description": "The version with the fix."
                }
              },
              "required": [
                "name",
                "installed",
                "fixed"
              ],
              "description": "A PHP package with a security fix released that isn't installed yet."
            },
            "description": "Security fixes released for PHP that aren't installed yet."
          },
          "restart": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Who still runs the old build."
            },
            "description": "Who still runs the build from before an update: the server's PHP, or a site's address."
          },
          "auto": {
            "type": "boolean",
            "description": "Whether security fixes install themselves every day."
          },
          "listsAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the server last downloaded the lists of updates. Null when it never has.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the server last downloaded the lists of updates. Null when it never has."
          },
          "securityAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the list of security updates the server has was published. Null when it has none.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the list of security updates the server has was published. Null when it has none."
          },
          "checkedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the server was last checked. Null until the first check.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the server was last checked. Null until the first check."
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "description": "Why a check failed."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the latest check failed, when it failed after the last good one. Null otherwise."
          }
        },
        "required": [
          "state",
          "reason",
          "build",
          "packages",
          "fixes",
          "restart",
          "auto",
          "listsAt",
          "securityAt",
          "checkedAt",
          "error"
        ],
        "description": "Whether the server has every PHP security fix installed and running. Checked every few hours, and on demand.",
        "examples": [
          {
            "state": "current",
            "reason": null,
            "build": "8.3.6-0ubuntu0.24.04.13",
            "packages": 14,
            "fixes": [],
            "restart": [],
            "auto": true,
            "listsAt": "2026-11-18T06:12:04.000Z",
            "securityAt": "2026-11-17T21:30:00.000Z",
            "checkedAt": "2026-11-18T07:00:31.000Z",
            "error": null
          }
        ]
      },
      "Ping": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "Always true: the token works."
          },
          "time": {
            "type": "string",
            "description": "The API's clock when it answered, in UTC.",
            "format": "date-time"
          }
        },
        "required": [
          "ok",
          "time"
        ],
        "description": "The answer to a test call: the token works, and the API's time.",
        "examples": [
          {
            "ok": true,
            "time": "2026-11-18T08:46:49.000Z"
          }
        ]
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The plan's id. Pass it as `planId` when you create or resize a server."
          },
          "name": {
            "type": "string",
            "description": "The plan's name, as the panel shows it."
          },
          "description": {
            "type": "string",
            "description": "What the plan suits, or what its type of server is, in a sentence."
          },
          "cloud": {
            "type": "string",
            "description": "The cloud these values are for: a plan offered on two clouds can have more disk or data transfer on one.",
            "x-known-values": [
              "digitalocean",
              "vultr",
              "hetzner",
              "linode",
              "gcp",
              "edge",
              "custom"
            ]
          },
          "line": {
            "description": "The type of server, as the panel's headings show it (for example General Purpose). Null for the Own servers plan.",
            "type": [
              "string",
              "null"
            ]
          },
          "option": {
            "description": "The choice within the type, where there is one (for example Premium Intel); otherwise null.",
            "type": [
              "string",
              "null"
            ]
          },
          "architecture": {
            "description": "The kind of processor: `x86_64` (Intel or AMD) or `arm64`. Null for the Own servers plan: its servers can have either.",
            "x-known-values": [
              "x86_64",
              "arm64"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "vcpus": {
            "type": "number",
            "description": "Virtual CPUs. 0 for the Own servers plan: each of your servers has its own."
          },
          "memoryGb": {
            "type": "number",
            "description": "Memory, in GB. 0 for the Own servers plan."
          },
          "diskGb": {
            "type": "number",
            "description": "Disk, in GB, on this cloud. 0 for the Own servers plan."
          },
          "transferTb": {
            "type": "number",
            "description": "Data transfer included each month, in TB, on this cloud. 0 for the Own servers plan."
          },
          "priceMonthlyCents": {
            "type": "integer",
            "description": "The price a month for a new server, in US cents, before any offer (during a sale the first invoices can be lower). For the Own servers plan, one price covers all of the account's own servers."
          },
          "currency": {
            "type": "string",
            "const": "usd",
            "description": "Always `usd`: amounts are in US cents."
          },
          "regions": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "The only regions the plan is offered in, or null when it's offered in every region of the cloud."
          },
          "popular": {
            "type": "boolean",
            "description": "Whether the panel suggests it as a popular choice."
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "cloud",
          "line",
          "option",
          "architecture",
          "vcpus",
          "memoryGb",
          "diskGb",
          "transferTb",
          "priceMonthlyCents",
          "currency",
          "regions",
          "popular"
        ],
        "description": "A plan (a server size) you can choose on a cloud, with its price a month.",
        "examples": [
          {
            "id": "starter",
            "name": "Starter",
            "description": "Personal sites, portfolios and small blogs.",
            "cloud": "digitalocean",
            "line": "Basic",
            "option": "Regular",
            "architecture": "x86_64",
            "vcpus": 1,
            "memoryGb": 1,
            "diskGb": 25,
            "transferTb": 1,
            "priceMonthlyCents": 1200,
            "currency": "usd",
            "regions": null,
            "popular": false
          }
        ]
      },
      "ProtectionDomain": {
        "type": "object",
        "properties": {
          "domainId": {
            "type": "string",
            "description": "The domain's id, as the site's list of domains gives it."
          },
          "hostname": {
            "type": "string",
            "description": "The domain, like www.example.com."
          },
          "status": {
            "type": "string",
            "description": "`protected`: its visitors come through Cloudflare. `switching`: Rabbitflare is switching its DNS (`dnsBy` isn't `you`); nothing to do. `ready`: its certificate is ready: set `record` at its DNS company now. `preparing`: Cloudflare is checking it and making its certificate (a few minutes); nothing to change yet. `action`: something comes first, `detail` says what (such as turning off your own Cloudflare proxy for it). `redirects`: a root domain that can't point at a name: its visitors are sent on to the primary domain; nothing to do. `error`: Cloudflare refused it, `detail` says why.",
            "x-known-values": [
              "protected",
              "switching",
              "ready",
              "preparing",
              "action",
              "redirects",
              "error"
            ]
          },
          "detail": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "What's happening with it, or why it waits or was refused, in a sentence. Null when it's protected."
          },
          "record": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "`CNAME`, or for a root domain the DNS company's `ALIAS` or `ANAME` record.",
                    "x-known-values": [
                      "CNAME",
                      "ALIAS",
                      "ANAME"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "description": "The record's name: the domain itself."
                  },
                  "value": {
                    "type": "string",
                    "description": "What it points at: the site's name at Cloudflare (`edge`)."
                  }
                },
                "required": [
                  "type",
                  "name",
                  "value"
                ],
                "description": "A DNS record."
              },
              {
                "type": "null"
              }
            ],
            "description": "The DNS record that sends the domain through Cloudflare. At Cloudflare, set it to DNS only (grey cloud), and remove other A, AAAA or CNAME records of the same name (keep MX and TXT records: they're for email). Null for a root domain whose DNS company can't point it at a name."
          },
          "dnsBy": {
            "type": "string",
            "description": "Who changes its DNS: `rabbitflare` (it was bought from Rabbitflare), `your_cloudflare` (its DNS is in a Cloudflare account you connected to Rabbitflare: Rabbitflare changes it there), or `you` (at its DNS company, as `record` says).",
            "x-known-values": [
              "rabbitflare",
              "your_cloudflare",
              "you"
            ]
          },
          "dnsCompany": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The company's id, like `cloudflare`, `godaddy` or `namecheap`."
                  },
                  "name": {
                    "type": "string",
                    "description": "The company's name, like Cloudflare, GoDaddy or Namecheap."
                  },
                  "root": {
                    "type": "string",
                    "description": "How a root domain (example.com, no www) can point at a name there: `cname` (a CNAME works), `alias` or `aname` (its own record type for it), `none` (it can't: make www the primary domain, and the root keeps its A record), or `unknown`.",
                    "x-known-values": [
                      "cname",
                      "alias",
                      "aname",
                      "none",
                      "unknown"
                    ]
                  }
                },
                "required": [
                  "id",
                  "name",
                  "root"
                ],
                "description": "A DNS company."
              },
              {
                "type": "null"
              }
            ],
            "description": "The DNS company its nameservers belong to. Null when not known yet or not recognised, and for domains bought from Rabbitflare."
          }
        },
        "required": [
          "domainId",
          "hostname",
          "status",
          "detail",
          "record",
          "dnsBy",
          "dnsCompany"
        ],
        "description": "One of the site's domains under Cloudflare protection: where it stands, and the DNS record that sends it through Cloudflare.",
        "examples": [
          {
            "domainId": "c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f",
            "hostname": "shop.example.com",
            "status": "ready",
            "detail": "Its certificate is ready. Change the record now.",
            "record": {
              "type": "CNAME",
              "name": "shop.example.com",
              "value": "shop-x7k2p.rabbitflare.net"
            },
            "dnsBy": "you",
            "dnsCompany": {
              "id": "godaddy",
              "name": "GoDaddy",
              "root": "none"
            }
          }
        ]
      },
      "ProtectionEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event's id in this list: the request's Ray ID. When one request was stopped more than once, each of its events adds what happened to it, like `8e3f2a1b4c5d6e7f-block-managed-rules`."
          },
          "occurredAt": {
            "type": "string",
            "description": "When the request came.",
            "format": "date-time"
          },
          "action": {
            "type": "string",
            "description": "What Cloudflare did: `block` (refused it), or a challenge the visitor had to pass: `managed_challenge`, `challenge` or `jschallenge`.",
            "x-known-values": [
              "block",
              "challenge",
              "managed_challenge",
              "jschallenge"
            ]
          },
          "hostname": {
            "type": "string",
            "description": "The domain the request was for."
          },
          "method": {
            "type": "string",
            "description": "The request's HTTP method, like GET or POST."
          },
          "path": {
            "type": "string",
            "description": "The page asked for (up to 300 characters)."
          },
          "ip": {
            "type": "string",
            "description": "The IP address the request came from."
          },
          "country": {
            "anyOf": [
              {
                "type": "string",
                "description": "A country code."
              },
              {
                "type": "null"
              }
            ],
            "description": "The country the request came from, as a two-letter code like US. Null when not known."
          },
          "reason": {
            "type": "string",
            "description": "What stopped it, in words: for example `Managed rules`, `Blocklist`, `Browser check`, `DDoS protection` or `Rate limit`; `Cloudflare` when it was another of Cloudflare's protections."
          },
          "userAgent": {
            "anyOf": [
              {
                "type": "string",
                "description": "A browser's name."
              },
              {
                "type": "null"
              }
            ],
            "description": "The browser or tool the request said it came from (up to 300 characters). Null when it sent none."
          },
          "rayId": {
            "anyOf": [
              {
                "type": "string",
                "description": "A Ray ID."
              },
              {
                "type": "null"
              }
            ],
            "description": "Cloudflare's Ray ID of the request: the code a stopped visitor sees on Cloudflare's page. Null when not known."
          }
        },
        "required": [
          "id",
          "occurredAt",
          "action",
          "hostname",
          "method",
          "path",
          "ip",
          "country",
          "reason",
          "userAgent",
          "rayId"
        ],
        "description": "A request Cloudflare blocked or challenged on one of the site's domains.",
        "examples": [
          {
            "id": "8e3f2a1b4c5d6e7f",
            "occurredAt": "2026-11-18T10:44:09.000Z",
            "action": "managed_challenge",
            "hostname": "shop.example.com",
            "method": "POST",
            "path": "/wp-login.php",
            "ip": "198.51.100.77",
            "country": "US",
            "reason": "Managed rules",
            "userAgent": "python-requests/2.32.3",
            "rayId": "8e3f2a1b4c5d6e7f"
          }
        ]
      },
      "ProtectionSettingsInput": {
        "type": "object",
        "properties": {
          "on": {
            "type": "boolean",
            "description": "`true` to turn Cloudflare protection on for the site, `false` to turn it off."
          }
        },
        "required": [
          "on"
        ],
        "additionalProperties": false,
        "description": "Turn a site's Cloudflare protection on or off.",
        "examples": [
          {
            "on": true
          }
        ]
      },
      "RabbitPressInstallInput": {
        "type": "object",
        "properties": {
          "licenseId": {
            "description": "For a site on a server of your own: the licence it uses, one of your active RabbitPress Cache licences (a licence covers one website). Left out: the licence the site used before. Not needed on servers Rabbitflare creates.",
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "additionalProperties": false,
        "description": "How to install RabbitPress Cache on a site. Send `{}` (or nothing) on a server Rabbitflare creates.",
        "examples": [
          {},
          {
            "licenseId": "5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a"
          }
        ]
      },
      "Region": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The region's id. Pass it as `region` when you create a server."
          },
          "name": {
            "type": "string",
            "description": "The region's name, as the panel shows it."
          },
          "city": {
            "type": "string",
            "description": "The city the data center is in, or near."
          },
          "country": {
            "type": "string",
            "description": "The country, in English."
          },
          "countryCode": {
            "type": "string",
            "description": "The country's two-letter ISO 3166-1 code."
          },
          "continent": {
            "type": "string",
            "description": "The part of the world, as the panel groups regions.",
            "x-known-values": [
              "North America",
              "South America",
              "Europe",
              "Asia Pacific",
              "Middle East & Africa"
            ]
          },
          "cloud": {
            "type": "string",
            "description": "The cloud the region belongs to.",
            "x-known-values": [
              "digitalocean",
              "vultr",
              "hetzner",
              "linode",
              "gcp",
              "edge",
              "custom"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "city",
          "country",
          "countryCode",
          "continent",
          "cloud"
        ],
        "description": "A location (data center) of a cloud where servers can be created.",
        "examples": [
          {
            "id": "nyc3",
            "name": "New York 3",
            "city": "New York",
            "country": "United States",
            "countryCode": "US",
            "continent": "North America",
            "cloud": "digitalocean"
          }
        ]
      },
      "SecurityAddress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The entry's id in this list: its kind and key, like `block:185.191.171.0/24`."
          },
          "key": {
            "type": "string",
            "description": "The address, range (203.0.113.0/24) or two-letter country code (DE) the entry is for: what `…/addresses/actions/remove` and `…/actions/move` take."
          },
          "kind": {
            "type": "string",
            "description": "`allow`: never blocked by the server. `block`: refused by every site on the server. `challenge`: asked to prove it's a person (a CAPTCHA) first.",
            "x-known-values": [
              "allow",
              "block",
              "challenge"
            ]
          },
          "ip": {
            "anyOf": [
              {
                "type": "string",
                "description": "An IP address or range."
              },
              {
                "type": "null"
              }
            ],
            "description": "The address or range. Null for a country."
          },
          "country": {
            "anyOf": [
              {
                "type": "string",
                "description": "A country code."
              },
              {
                "type": "null"
              }
            ],
            "description": "The two-letter country code. Null for an address."
          },
          "comment": {
            "anyOf": [
              {
                "type": "string",
                "description": "A note."
              },
              {
                "type": "null"
              }
            ],
            "description": "The note it was added with: your own words, or Imunify360's reason when it added the entry itself. Null when none."
          },
          "automatic": {
            "type": "boolean",
            "description": "Added by Imunify360 itself (an attack, a passed check), not by you."
          },
          "addedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it was added. Null when not known.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was added. Null when not known."
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it comes off the list by itself. Null: it stays.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it comes off the list by itself. Null: it stays."
          }
        },
        "required": [
          "id",
          "key",
          "kind",
          "ip",
          "country",
          "comment",
          "automatic",
          "addedAt",
          "expiresAt"
        ],
        "description": "An address, range or country on a server's allowed, blocked or challenged list.",
        "examples": [
          {
            "id": "block:185.191.171.0/24",
            "key": "185.191.171.0/24",
            "kind": "block",
            "ip": "185.191.171.0/24",
            "country": null,
            "comment": "SSH password guessing",
            "automatic": false,
            "addedAt": "2026-11-25T08:59:40.000Z",
            "expiresAt": null
          }
        ]
      },
      "SecurityAddressInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "allow",
              "block",
              "challenge"
            ],
            "description": "`allow` (never blocked), `block` (refused by every site on the server) or `challenge` (a CAPTCHA first; addresses only)."
          },
          "ip": {
            "description": "An IP address or range. Give `ip` or `country`.",
            "type": "string",
            "pattern": "^[0-9a-fA-F:.]{2,45}(\\/\\d{1,3})?$"
          },
          "country": {
            "description": "A two-letter country code, like DE: every address there. Give `ip` or `country`.",
            "type": "string",
            "pattern": "^[A-Za-z]{2}$"
          },
          "comment": {
            "description": "A note for yourself, up to 200 characters.",
            "type": "string",
            "maxLength": 200
          },
          "expiresInMinutes": {
            "description": "For how long, in minutes (up to 400 days). Left out: until it's removed.",
            "type": "integer",
            "minimum": 1,
            "maximum": 576000
          }
        },
        "required": [
          "kind"
        ],
        "additionalProperties": false,
        "description": "An address, range or country for a server's lists.",
        "examples": [
          {
            "kind": "block",
            "ip": "185.191.171.0/24",
            "comment": "SSH password guessing"
          }
        ]
      },
      "SecurityAddressMoveInput": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "description": "The entry's `key`: an address, a range or a two-letter country code."
          },
          "from": {
            "type": "string",
            "enum": [
              "allow",
              "block",
              "challenge"
            ],
            "description": "The list it's on now."
          },
          "to": {
            "type": "string",
            "enum": [
              "allow",
              "block",
              "challenge"
            ],
            "description": "The list it moves to (a country can't be `challenge`)."
          }
        },
        "required": [
          "key",
          "from",
          "to"
        ],
        "additionalProperties": false,
        "description": "An entry to move to another of a server's lists.",
        "examples": [
          {
            "key": "45.146.165.10",
            "from": "challenge",
            "to": "block"
          }
        ]
      },
      "SecurityAddressRemoveInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "allow",
              "block",
              "challenge"
            ],
            "description": "The list it's on."
          },
          "key": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "description": "The entry's `key`: an address, a range or a two-letter country code."
          }
        },
        "required": [
          "kind",
          "key"
        ],
        "additionalProperties": false,
        "description": "An entry to take off a server's list.",
        "examples": [
          {
            "kind": "block",
            "key": "185.191.171.0/24"
          }
        ]
      },
      "SecurityCrawlerInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Its name, up to 100 characters (not Google, Bing, Yandex or Baidu: they're let through already)."
          },
          "url": {
            "description": "Where it says how to recognise its crawlers.",
            "type": "string",
            "maxLength": 300,
            "pattern": "^https?:\\/\\/[^\\s()]+$"
          },
          "domains": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\.?(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9-]{2,63}$"
            },
            "description": "Where its crawlers' addresses' names end, like .duckduckgo.com (1 to 10)."
          }
        },
        "required": [
          "name",
          "domains"
        ],
        "additionalProperties": false,
        "description": "A search engine for the bot checks to let through.",
        "examples": [
          {
            "name": "DuckDuckGo",
            "url": "https://duckduckgo.com/duckduckbot",
            "domains": [
              ".duckduckgo.com"
            ]
          }
        ]
      },
      "SecurityIncident": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The incident's id."
          },
          "occurredAt": {
            "type": "string",
            "description": "When it happened (the last time, when it happened more than once).",
            "format": "date-time"
          },
          "ip": {
            "anyOf": [
              {
                "type": "string",
                "description": "An IP address."
              },
              {
                "type": "null"
              }
            ],
            "description": "The address it came from. Null when not known."
          },
          "country": {
            "anyOf": [
              {
                "type": "string",
                "description": "A country code."
              },
              {
                "type": "null"
              }
            ],
            "description": "Where that address is, as a two-letter country code. Null when not known."
          },
          "siteId": {
            "anyOf": [
              {
                "type": "string",
                "description": "A site's id."
              },
              {
                "type": "null"
              }
            ],
            "description": "The site attacked. Null when it was the server, or the site isn't known."
          },
          "domain": {
            "anyOf": [
              {
                "type": "string",
                "description": "A domain."
              },
              {
                "type": "null"
              }
            ],
            "description": "The domain attacked. Null when it was the server."
          },
          "kind": {
            "type": "string",
            "description": "`waf` (the web application firewall), `wordpress` (stopped inside a site by the WordPress plugin: an attack on a known hole), `brute_force` (password guessing), `dos` (too many connections or requests), `bot`, `port_scan`, `blocklist` (an address known for attacks), `malware`, or `other`.",
            "x-known-values": [
              "waf",
              "wordpress",
              "brute_force",
              "dos",
              "bot",
              "port_scan",
              "blocklist",
              "malware",
              "other"
            ]
          },
          "description": {
            "type": "string",
            "description": "What it was."
          },
          "ruleId": {
            "anyOf": [
              {
                "type": "string",
                "description": "A rule."
              },
              {
                "type": "null"
              }
            ],
            "description": "The rule that matched, when it can be turned off for false alarms (`servers.security.rules.disable`). Null otherwise."
          },
          "severity": {
            "type": "string",
            "description": "`critical`, `high`, `medium` or `low`.",
            "x-known-values": [
              "critical",
              "high",
              "medium",
              "low"
            ]
          },
          "action": {
            "type": "string",
            "description": "What Imunify360 did: `blocked` the address, `challenged` it (a CAPTCHA), or only `logged` it.",
            "x-known-values": [
              "blocked",
              "challenged",
              "logged"
            ]
          },
          "times": {
            "type": "integer",
            "description": "How many times it happened."
          },
          "wordpress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "target": {
                    "description": "What was attacked: a `plugin`, a `theme` or WordPress itself (`core`). Null when not known.",
                    "x-known-values": [
                      "plugin",
                      "theme",
                      "core"
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "folder": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A folder's name."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The plugin's or theme's folder, like contact-form-7. Null when not known."
                  },
                  "version": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A version."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Its version then. Null when not known."
                  },
                  "cve": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A CVE id."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The hole's CVE id. Null when it has none."
                  },
                  "ruleOff": {
                    "type": "boolean",
                    "description": "Whether its rule is turned off for the site (or every site) now."
                  }
                },
                "required": [
                  "target",
                  "folder",
                  "version",
                  "cve",
                  "ruleOff"
                ],
                "description": "What the WordPress plugin stopped."
              },
              {
                "type": "null"
              }
            ],
            "description": "With `kind: \"wordpress\"`: what was attacked. Null otherwise."
          }
        },
        "required": [
          "id",
          "occurredAt",
          "ip",
          "country",
          "siteId",
          "domain",
          "kind",
          "description",
          "ruleId",
          "severity",
          "action",
          "times",
          "wordpress"
        ],
        "description": "An attack Imunify360 stopped (or logged) on a server.",
        "examples": [
          {
            "id": "1",
            "occurredAt": "2026-11-25T09:10:02.000Z",
            "ip": "45.146.165.10",
            "country": "DE",
            "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "domain": "shop.example.com",
            "kind": "waf",
            "description": "Information disclosure attempt via WordPress plugins",
            "ruleId": "77350218",
            "severity": "high",
            "action": "challenged",
            "times": 12,
            "wordpress": null
          }
        ]
      },
      "SecurityPortInput": {
        "type": "object",
        "properties": {
          "port": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535,
            "description": "The port, 1 to 65535."
          },
          "protocol": {
            "type": "string",
            "enum": [
              "tcp",
              "udp"
            ],
            "description": "`tcp` or `udp`."
          },
          "comment": {
            "description": "A note for yourself, up to 200 characters.",
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "port",
          "protocol"
        ],
        "additionalProperties": false,
        "description": "A port for a server's port list.",
        "examples": [
          {
            "port": 3306,
            "protocol": "tcp",
            "comment": "Database: only the office"
          }
        ]
      },
      "SecurityRuleDisableInput": {
        "type": "object",
        "properties": {
          "ruleId": {
            "type": "string",
            "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9._:@+-]{1,128}$",
            "description": "The rule: a web application firewall rule's number, or a WordPress plugin rule's name (an incident's `ruleId`)."
          },
          "siteIds": {
            "description": "The sites to turn it off for (each needs malware protection on). Left out or empty: every site on the server.",
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "note": {
            "description": "Why, for yourself, up to 100 characters (a web application firewall rule keeps it as its `name`).",
            "type": "string",
            "maxLength": 100
          }
        },
        "required": [
          "ruleId"
        ],
        "additionalProperties": false,
        "description": "The rule to turn off, and where.",
        "examples": [
          {
            "ruleId": "77350218",
            "siteIds": [
              "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
            ],
            "note": "Turned off for the shop's page builder"
          }
        ]
      },
      "SecurityRuleEnableInput": {
        "type": "object",
        "properties": {
          "ruleId": {
            "type": "string",
            "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9._:@+-]{1,128}$",
            "description": "The rule, as `disabledRules` names it."
          }
        },
        "required": [
          "ruleId"
        ],
        "additionalProperties": false,
        "description": "The rule to turn back on.",
        "examples": [
          {
            "ruleId": "77350218"
          }
        ]
      },
      "SecurityScanInput": {
        "type": "object",
        "properties": {
          "database": {
            "description": "Scan the databases too (slower). Left out: files only.",
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "What a malware scan checks.",
        "examples": [
          {
            "database": true
          }
        ]
      },
      "Server": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The server's id."
          },
          "name": {
            "type": "string",
            "description": "The server's name, as shown in the panel."
          },
          "status": {
            "type": "string",
            "description": "`pending_payment`: waiting for its first payment. `provisioning`: being set up (see `stage`). `active`: running. `off`: powered off. `suspended`: switched off for an unpaid bill. `failed`: setup failed (see `lastError`). `deleting`: being destroyed. `deleted`: destroyed.",
            "x-known-values": [
              "pending_payment",
              "provisioning",
              "active",
              "off",
              "suspended",
              "failed",
              "deleting",
              "deleted"
            ]
          },
          "stage": {
            "type": "string",
            "description": "How far setup has got: `queued`, `creating`, `preflight` (a server of your own is being checked), `booting`, `packages`, `database`, `security`, `verifying` (connecting to Rabbitflare), then `complete`, or `failed`.",
            "x-known-values": [
              "queued",
              "creating",
              "preflight",
              "booting",
              "packages",
              "database",
              "security",
              "verifying",
              "complete",
              "failed"
            ]
          },
          "pendingAction": {
            "description": "A change in progress on the server (`power_on`, `power_off`, `reboot`, `resize`, `snapshot`, `restore`, `destroy`). Another change waits until it's done (409 `busy`). Null when there's none.",
            "x-known-values": [
              "power_on",
              "power_off",
              "reboot",
              "resize",
              "snapshot",
              "restore",
              "destroy"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "cloud": {
            "type": "string",
            "description": "Where the server runs: `digitalocean`, `vultr`, `hetzner`, `linode`, `gcp` (Google Cloud), `edge` (Amazon EC2), or `custom` (a server of your own).",
            "x-known-values": [
              "digitalocean",
              "vultr",
              "hetzner",
              "linode",
              "gcp",
              "edge",
              "custom"
            ]
          },
          "region": {
            "type": "string",
            "description": "The location's id on its cloud, like fra1 (Frankfurt). `own` for a server of your own."
          },
          "planId": {
            "type": "string",
            "description": "The plan's id (see the plans of each cloud). `own` for a server of your own."
          },
          "priceMonthlyCents": {
            "type": "integer",
            "description": "What this server is billed each month, in US cents, before any offer: during a sale an invoice can be lower, never higher. It stays as bought when plan prices change."
          },
          "currency": {
            "type": "string",
            "const": "usd",
            "description": "Always `usd`: amounts are in US cents."
          },
          "ipv4": {
            "anyOf": [
              {
                "type": "string",
                "description": "An IPv4 address."
              },
              {
                "type": "null"
              }
            ],
            "description": "The server's public IPv4 address. Null until it has one."
          },
          "ipv6": {
            "anyOf": [
              {
                "type": "string",
                "description": "An IPv6 address."
              },
              {
                "type": "null"
              }
            ],
            "description": "The server's public IPv6 address. Null when it has none."
          },
          "phpVersion": {
            "type": "string",
            "description": "The PHP version the server's sites run, like 8.3."
          },
          "backupsEnabled": {
            "type": "boolean",
            "description": "Whether the whole server is backed up automatically: by its cloud, or by Rabbitflare once it has moved to Rabbitflare's own backups (`automaticBackupsBy` says which). It stays `true` when the cloud's own backups are turned off for Rabbitflare's. `false` for Amazon EC2 and Google Cloud servers and servers of your own: their sites are backed up one by one."
          },
          "automaticBackupsBy": {
            "description": "Who takes the server's automatic backups: `rabbitflare` (Rabbitflare's own weekly backups; its cloud's are off), `cloud` (its cloud's automatic backups), or `both` while it moves from its cloud's to Rabbitflare's. Given in answers about one server (`GET /servers/{serverId}` and the changes made to one); null in the list of servers, and for servers without automatic backups (`backupsEnabled: false`).",
            "x-known-values": [
              "rabbitflare",
              "cloud",
              "both"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "billing": {
            "type": "object",
            "properties": {
              "method": {
                "description": "How the server is paid: `card` (cards and the wallet) or `paypal`. Null when it isn't billed on its own (a server of your own is covered by the Own servers plan).",
                "x-known-values": [
                  "card",
                  "paypal"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "description": "The state of the server's monthly payment: `active`, `past_due` (a payment failed and is being retried), `unpaid`, `canceled`… Null before the first payment.",
                "x-known-values": [
                  "active",
                  "trialing",
                  "past_due",
                  "unpaid",
                  "paused",
                  "canceled",
                  "incomplete_expired",
                  "complimentary"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "currentPeriodEnd": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "When the period paid for ends (the next payment is due then). Null when not known.",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "When the period paid for ends (the next payment is due then). Null when not known."
              }
            },
            "required": [
              "method",
              "status",
              "currentPeriodEnd"
            ],
            "description": "How the server is paid for."
          },
          "pendingPlanId": {
            "anyOf": [
              {
                "type": "string",
                "description": "A plan's id."
              },
              {
                "type": "null"
              }
            ],
            "description": "The plan a resize is waiting to move to, while a PayPal approval is outstanding. Null otherwise."
          },
          "scheduledDeletionAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the server will be destroyed if nothing changes (a suspended server, or a free trial that wasn't kept). Null otherwise.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the server will be destroyed if nothing changes (a suspended server, or a free trial that wasn't kept). Null otherwise."
          },
          "trial": {
            "type": "boolean",
            "description": "A free trial server that hasn't been kept (paid for) yet."
          },
          "specs": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "vcpus": {
                    "type": "integer",
                    "description": "Processor cores."
                  },
                  "memoryGb": {
                    "type": "number",
                    "description": "Memory, in GB."
                  },
                  "diskGb": {
                    "type": "number",
                    "description": "Disk size, in GB."
                  },
                  "os": {
                    "type": "string",
                    "description": "The operating system, as the server reported it."
                  },
                  "arch": {
                    "type": "string",
                    "description": "The processor architecture, like x86_64 or aarch64."
                  },
                  "provider": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A hosting provider."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The hosting provider the machine was recognised as, when it was (like Amazon Web Services). Null otherwise."
                  }
                },
                "required": [
                  "vcpus",
                  "memoryGb",
                  "diskGb",
                  "os",
                  "arch",
                  "provider"
                ],
                "description": "The machine as it reported itself when it was connected."
              },
              {
                "type": "null"
              }
            ],
            "description": "Servers of your own: the machine as it reported itself. Null for servers bought from Rabbitflare (their plan says it all)."
          },
          "siteCount": {
            "type": "integer",
            "description": "Sites on the server (staging copies aren't counted)."
          },
          "dataTransfer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ServerDataTransfer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Amazon EC2 and Google Cloud servers: data transfer this month. Null on the other clouds, where it isn't billed by use."
          },
          "phpSecurity": {
            "$ref": "#/components/schemas/PhpSecurity"
          },
          "security": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "description": "Imunify360 on the server: `off`, `installing` (a few minutes), `on`, `failed`, or `removing`. On servers Rabbitflare creates with Intel or AMD processors and 2 GB of memory or more, it's turned on by itself once the server is ready, while the account's `features.security` is on.",
                "x-known-values": [
                  "off",
                  "installing",
                  "on",
                  "failed",
                  "removing"
                ]
              },
              "available": {
                "type": "boolean",
                "description": "Whether the server can run Imunify360 and it's open to the account. `GET /servers/{serverId}/security` says why not."
              }
            },
            "required": [
              "status",
              "available"
            ],
            "description": "The server's security (Imunify360). `GET /servers/{serverId}/security` has the rest."
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the last setup or change failed. Null when nothing failed."
          },
          "readyAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the server finished setting up (a server of your own: when it connected). Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the server finished setting up (a server of your own: when it connected). Null until then."
          },
          "createdAt": {
            "type": "string",
            "description": "When the server was created.",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "When the server last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "stage",
          "pendingAction",
          "cloud",
          "region",
          "planId",
          "priceMonthlyCents",
          "currency",
          "ipv4",
          "ipv6",
          "phpVersion",
          "backupsEnabled",
          "automaticBackupsBy",
          "billing",
          "pendingPlanId",
          "scheduledDeletionAt",
          "trial",
          "specs",
          "siteCount",
          "dataTransfer",
          "phpSecurity",
          "security",
          "lastError",
          "readyAt",
          "createdAt",
          "updatedAt"
        ],
        "description": "A server: one machine on the cloud you chose (or one of your own), holding any number of WordPress sites.",
        "examples": [
          {
            "id": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
            "name": "Production",
            "status": "active",
            "stage": "complete",
            "pendingAction": null,
            "cloud": "digitalocean",
            "region": "fra1",
            "planId": "business",
            "priceMonthlyCents": 5200,
            "currency": "usd",
            "ipv4": "203.0.113.10",
            "ipv6": "2001:db8::10",
            "phpVersion": "8.3",
            "backupsEnabled": true,
            "automaticBackupsBy": "rabbitflare",
            "billing": {
              "method": "card",
              "status": "active",
              "currentPeriodEnd": "2026-12-18T08:46:49.000Z"
            },
            "pendingPlanId": null,
            "scheduledDeletionAt": null,
            "trial": false,
            "specs": null,
            "siteCount": 2,
            "dataTransfer": null,
            "phpSecurity": {
              "state": "current",
              "reason": null,
              "build": "8.3.6-0ubuntu0.24.04.13",
              "packages": 14,
              "fixes": [],
              "restart": [],
              "auto": true,
              "listsAt": "2026-11-18T06:12:04.000Z",
              "securityAt": "2026-11-17T21:30:00.000Z",
              "checkedAt": "2026-11-18T07:00:31.000Z",
              "error": null
            },
            "security": {
              "status": "on",
              "available": true
            },
            "lastError": null,
            "readyAt": "2026-11-18T08:51:12.000Z",
            "createdAt": "2026-11-18T08:46:49.000Z",
            "updatedAt": "2026-11-18T09:02:31.000Z"
          }
        ]
      },
      "ServerConnection": {
        "type": "object",
        "properties": {
          "command": {
            "anyOf": [
              {
                "type": "string",
                "description": "A shell command."
              },
              {
                "type": "null"
              }
            ],
            "description": "The one line to run on your server as root to connect it. It carries a one-time key: keep it private. Null once the server is connected."
          },
          "ports": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "port": {
                  "type": "integer",
                  "description": "The port."
                },
                "protocol": {
                  "type": "string",
                  "description": "The protocol.",
                  "x-known-values": [
                    "TCP"
                  ]
                },
                "purpose": {
                  "type": "string",
                  "description": "What it's for."
                }
              },
              "required": [
                "port",
                "protocol",
                "purpose"
              ],
              "description": "A port the server's firewall must allow."
            },
            "description": "The ports your server's firewall must allow from the internet."
          }
        },
        "required": [
          "command",
          "ports"
        ],
        "description": "How to connect a server of your own: the command to run on it, and the ports to open.",
        "examples": [
          {
            "command": "curl -fsSL https://app.rabbitflare.com/api/connect/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/EXAMPLE-ONE-TIME-KEY | sudo bash",
            "ports": [
              {
                "port": 80,
                "protocol": "TCP",
                "purpose": "Web traffic (HTTP), and SSL certificate checks"
              },
              {
                "port": 443,
                "protocol": "TCP",
                "purpose": "Web traffic (HTTPS)"
              },
              {
                "port": 22022,
                "protocol": "TCP",
                "purpose": "SSH for the Rabbitflare control panel"
              }
            ]
          }
        ]
      },
      "ServerCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9 ._-]*$",
            "description": "The server's name: 2 to 48 letters, numbers, spaces, dots, dashes or underscores, starting with a letter or number."
          },
          "cloud": {
            "type": "string",
            "enum": [
              "digitalocean",
              "vultr",
              "hetzner",
              "linode",
              "gcp",
              "edge",
              "custom"
            ],
            "description": "Where the server runs: `digitalocean`, `vultr`, `hetzner`, `linode`, `gcp` (Google Cloud) or `edge` (Amazon EC2), where it's open to your account; or `custom` to connect a server of your own."
          },
          "region": {
            "description": "The location's id on that cloud, like fra1 (DigitalOcean, Frankfurt) or nyc3 (DigitalOcean, New York). Required, except for a server of your own.",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "planId": {
            "description": "The plan's id, offered on that cloud in that location. Required, except for a server of your own.",
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "ipv4": {
            "description": "A server of your own (`cloud: \"custom\"`) only, and required there: its public IPv4 address.",
            "type": "string",
            "maxLength": 15
          },
          "site": {
            "description": "A WordPress site to install as soon as the server is ready. Left out: the server starts empty.",
            "$ref": "#/components/schemas/FirstSiteInput"
          },
          "paymentMethodId": {
            "description": "A saved card to pay with. Left out: the account's default card. The wallet is always used first.",
            "type": "string",
            "pattern": "^pm_[A-Za-z0-9]{8,64}$"
          }
        },
        "required": [
          "name",
          "cloud"
        ],
        "additionalProperties": false,
        "description": "A new server: the cloud, location and plan to order it on, or a server of your own to connect; optionally a first site.",
        "examples": [
          {
            "name": "Production",
            "cloud": "digitalocean",
            "region": "fra1",
            "planId": "business",
            "site": {
              "name": "Shop",
              "siteTitle": "Example Shop",
              "adminUsername": "editor",
              "adminEmail": "you@example.com"
            }
          },
          {
            "name": "My own server",
            "cloud": "custom",
            "ipv4": "203.0.113.40"
          }
        ]
      },
      "ServerDataTransfer": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "description": "The month counted, as YYYY-MM."
          },
          "usedBytes": {
            "type": "integer",
            "description": "Data the server sent this month so far (backups to Rabbitflare Backup in the server's own location don't count)."
          },
          "includedBytes": {
            "type": "integer",
            "description": "What the server's plan includes this month."
          },
          "extraCentsPerGb": {
            "type": "integer",
            "description": "The price of each GB beyond what's included, in US cents."
          },
          "currency": {
            "type": "string",
            "const": "usd",
            "description": "Always `usd`: amounts are in US cents."
          },
          "measuredAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it was last measured (every hour). Null until the first time.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was last measured (every hour). Null until the first time."
          },
          "unpaidBill": {
            "type": "boolean",
            "description": "A data transfer bill that includes this server couldn't be charged: the server stays off until it's paid (in the panel's Billing)."
          }
        },
        "required": [
          "period",
          "usedBytes",
          "includedBytes",
          "extraCentsPerGb",
          "currency",
          "measuredAt",
          "unpaidBill"
        ],
        "description": "Amazon EC2 and Google Cloud servers: data transfer this month. Data beyond what the plan includes is billed by the GB.",
        "examples": [
          {
            "period": "2026-11",
            "usedBytes": 41230000000,
            "includedBytes": 1000000000000,
            "extraCentsPerGb": 12,
            "currency": "usd",
            "measuredAt": "2026-11-18T08:00:12.000Z",
            "unpaidBill": false
          }
        ]
      },
      "ServerLogs": {
        "type": "object",
        "properties": {
          "settings": {
            "$ref": "#/components/schemas/ServerLogSettings"
          },
          "usage": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "disk": {
                    "type": "object",
                    "properties": {
                      "totalBytes": {
                        "type": "integer",
                        "description": "The disk's size."
                      },
                      "usedBytes": {
                        "type": "integer",
                        "description": "Space in use."
                      },
                      "freeBytes": {
                        "type": "integer",
                        "description": "Space free."
                      },
                      "usedPercent": {
                        "type": "number",
                        "description": "Space in use, in percent."
                      }
                    },
                    "required": [
                      "totalBytes",
                      "usedBytes",
                      "freeBytes",
                      "usedPercent"
                    ],
                    "description": "The server's disk."
                  },
                  "logsBytes": {
                    "type": "integer",
                    "description": "Space all logs take."
                  },
                  "groups": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The group: `web`, `firewall`, `system`, `database` or `other`.",
                          "x-known-values": [
                            "web",
                            "firewall",
                            "system",
                            "database",
                            "other"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "description": "The group's name, as the panel shows it."
                        },
                        "bytes": {
                          "type": "integer",
                          "description": "Space the group's logs take."
                        },
                        "currentBytes": {
                          "type": "integer",
                          "description": "The logs being written now."
                        },
                        "oldBytes": {
                          "type": "integer",
                          "description": "Old copies of them."
                        },
                        "journalBytes": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Bytes."
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "The system journal's share (the `system` group only). Null for other groups."
                        }
                      },
                      "required": [
                        "id",
                        "title",
                        "bytes",
                        "currentBytes",
                        "oldBytes",
                        "journalBytes"
                      ],
                      "description": "A group of the system's own logs."
                    },
                    "description": "The system's own logs, by group."
                  },
                  "sites": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "siteId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "description": "A site's id."
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "The site's id. Null when the logs belong to a site that no longer exists."
                        },
                        "name": {
                          "type": "string",
                          "description": "The site's name."
                        },
                        "stagingCopy": {
                          "type": "boolean",
                          "description": "A staging copy of another site."
                        },
                        "bytes": {
                          "type": "integer",
                          "description": "Space the site's logs take."
                        },
                        "phpBytes": {
                          "type": "integer",
                          "description": "Its PHP error log."
                        },
                        "debugBytes": {
                          "type": "integer",
                          "description": "Its WordPress debug log."
                        },
                        "oldBytes": {
                          "type": "integer",
                          "description": "Old copies of its logs."
                        }
                      },
                      "required": [
                        "siteId",
                        "name",
                        "stagingCopy",
                        "bytes",
                        "phpBytes",
                        "debugBytes",
                        "oldBytes"
                      ],
                      "description": "A site's logs."
                    },
                    "description": "Each site's logs."
                  },
                  "lastAutoClean": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "ranAt": {
                            "type": "string",
                            "description": "When it ran.",
                            "format": "date-time"
                          },
                          "freedBytes": {
                            "type": "integer",
                            "description": "Space it freed."
                          }
                        },
                        "required": [
                          "ranAt",
                          "freedBytes"
                        ],
                        "description": "The last automatic clean-up."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The last automatic clean-up. Null when there hasn't been one."
                  },
                  "autoCleanOn": {
                    "type": "boolean",
                    "description": "Whether the server's hourly clean-up is set up and on right now."
                  }
                },
                "required": [
                  "disk",
                  "logsBytes",
                  "groups",
                  "sites",
                  "lastAutoClean",
                  "autoCleanOn"
                ],
                "description": "How much room the logs take."
              },
              {
                "type": "null"
              }
            ],
            "description": "How much room the logs take, read from the server. Null while the server isn't running or didn't answer (see `usageError`)."
          },
          "usageError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why `usage` couldn't be read. Null when it was."
          }
        },
        "required": [
          "settings",
          "usage",
          "usageError"
        ],
        "description": "The server's logs: the room they take, and how they're cleaned up.",
        "examples": [
          {
            "settings": {
              "autoClean": true,
              "keepDays": 7,
              "maxSizeMb": 100,
              "freeSpace": true,
              "state": "applied",
              "error": null
            },
            "usage": {
              "disk": {
                "totalBytes": 85899345920,
                "usedBytes": 18253611008,
                "freeBytes": 67645734912,
                "usedPercent": 21.3
              },
              "logsBytes": 412090368,
              "groups": [
                {
                  "id": "web",
                  "title": "Web server",
                  "bytes": 201326592,
                  "currentBytes": 12582912,
                  "oldBytes": 188743680,
                  "journalBytes": null
                }
              ],
              "sites": [
                {
                  "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                  "name": "Shop",
                  "stagingCopy": false,
                  "bytes": 52428800,
                  "phpBytes": 1048576,
                  "debugBytes": 50331648,
                  "oldBytes": 1048576
                }
              ],
              "lastAutoClean": {
                "ranAt": "2026-11-18T08:00:03.000Z",
                "freedBytes": 10485760
              },
              "autoCleanOn": true
            },
            "usageError": null
          }
        ]
      },
      "ServerLogsCleared": {
        "type": "object",
        "properties": {
          "freedBytes": {
            "type": "integer",
            "description": "Space freed on the server's disk."
          }
        },
        "required": [
          "freedBytes"
        ],
        "description": "What clearing logs freed.",
        "examples": [
          {
            "freedBytes": 50331648
          }
        ]
      },
      "ServerLogsClearInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "target": {
                "type": "string",
                "const": "site",
                "description": "One site's logs."
              },
              "siteId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                "description": "The site, on this server."
              },
              "kind": {
                "description": "Only its PHP error log (`php`) or its WordPress debug log (`debug`). Leave it out for all of the site's logs.",
                "type": "string",
                "enum": [
                  "php",
                  "debug"
                ]
              }
            },
            "required": [
              "target",
              "siteId"
            ],
            "additionalProperties": false,
            "description": "One site's logs."
          },
          {
            "type": "object",
            "properties": {
              "target": {
                "type": "string",
                "enum": [
                  "sites",
                  "web",
                  "firewall",
                  "system",
                  "database",
                  "other",
                  "all"
                ],
                "description": "`sites`: every site's logs. `web`, `firewall`, `system`, `database`, `other`: that group of the system's logs. `all`: everything."
              }
            },
            "required": [
              "target"
            ],
            "additionalProperties": false,
            "description": "A group of logs, or all of them."
          }
        ],
        "description": "Which logs to clear.",
        "examples": [
          {
            "target": "site",
            "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "kind": "debug"
          },
          {
            "target": "all"
          }
        ]
      },
      "ServerLogSettings": {
        "type": "object",
        "properties": {
          "autoClean": {
            "type": "boolean",
            "description": "Whether old logs are cleaned up automatically, every hour."
          },
          "keepDays": {
            "type": "integer",
            "description": "How many days old copies of logs are kept: 1, 3, 7, 14, 30, 90."
          },
          "maxSizeMb": {
            "type": "integer",
            "description": "The size, in MB, a log may reach before it's rotated: 10, 50, 100, 250, 500, 1000."
          },
          "freeSpace": {
            "type": "boolean",
            "description": "Whether space is freed up from logs when the disk is over 90% full."
          },
          "state": {
            "type": "string",
            "description": "`applied`: the server uses these settings. `applying`: they're being put in place. `failed`: they couldn't be (see `error`).",
            "x-known-values": [
              "applied",
              "applying",
              "failed"
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the settings couldn't be put in place. Null otherwise."
          }
        },
        "required": [
          "autoClean",
          "keepDays",
          "maxSizeMb",
          "freeSpace",
          "state",
          "error"
        ],
        "description": "How the server cleans up its logs.",
        "examples": [
          {
            "autoClean": true,
            "keepDays": 7,
            "maxSizeMb": 100,
            "freeSpace": true,
            "state": "applied",
            "error": null
          }
        ]
      },
      "ServerLogSettingsInput": {
        "type": "object",
        "properties": {
          "autoClean": {
            "type": "boolean",
            "description": "Clean up old logs automatically, every hour."
          },
          "keepDays": {
            "type": "number",
            "enum": [
              1,
              3,
              7,
              14,
              30,
              90
            ],
            "description": "How many days old copies of logs are kept: 1, 3, 7, 14, 30, 90."
          },
          "maxSizeMb": {
            "type": "number",
            "enum": [
              10,
              50,
              100,
              250,
              500,
              1000
            ],
            "description": "The size, in MB, a log may reach before it's rotated: 10, 50, 100, 250, 500, 1000."
          },
          "freeSpace": {
            "type": "boolean",
            "description": "Free up space from logs when the disk is over 90% full."
          }
        },
        "required": [
          "autoClean",
          "keepDays",
          "maxSizeMb",
          "freeSpace"
        ],
        "additionalProperties": false,
        "description": "How the server should clean up its logs. Every field is required: the settings are saved as a whole.",
        "examples": [
          {
            "autoClean": true,
            "keepDays": 7,
            "maxSizeMb": 100,
            "freeSpace": true
          }
        ]
      },
      "ServerMediaOffload": {
        "type": "object",
        "properties": {
          "serverId": {
            "type": "string",
            "description": "The server's id."
          },
          "allowance": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "includedBytes": {
                    "type": "integer",
                    "description": "Storage included with the server, shared by its sites (decimal: 1 GB is 1,000,000,000 bytes)."
                  },
                  "usedBytes": {
                    "type": "integer",
                    "description": "Storage the server's sites use now."
                  },
                  "sites": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "siteId": {
                          "type": "string",
                          "description": "The site's id."
                        },
                        "name": {
                          "type": "string",
                          "description": "The site's name."
                        },
                        "bytes": {
                          "type": "integer",
                          "description": "Storage it uses."
                        }
                      },
                      "required": [
                        "siteId",
                        "name",
                        "bytes"
                      ],
                      "description": "A site using Media Offload."
                    },
                    "description": "The sites using it, largest first."
                  },
                  "extraCentsPerGbMonth": {
                    "type": "number",
                    "description": "The price of each GB stored beyond what's included, per month, in US cents (it can have decimals). Billed after the month ends."
                  },
                  "monthToDateCents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Extra storage this month so far, before it's billed, in US cents."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Extra storage this month so far, before it's billed, in US cents. Null for a token without `billing:read`."
                  },
                  "currency": {
                    "type": "string",
                    "const": "usd",
                    "description": "Always `usd`: amounts are in US cents."
                  }
                },
                "required": [
                  "includedBytes",
                  "usedBytes",
                  "sites",
                  "extraCentsPerGbMonth",
                  "monthToDateCents",
                  "currency"
                ],
                "description": "The server's included storage and who uses it."
              },
              {
                "type": "null"
              }
            ],
            "description": "The server's included storage. Null on servers of your own: storage is included with the servers Rabbitflare creates."
          }
        },
        "required": [
          "serverId",
          "allowance"
        ],
        "description": "Media Offload on a server: the storage included with it for its sites' media libraries, and what uses it.",
        "examples": [
          {
            "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
            "allowance": {
              "includedBytes": 100000000000,
              "usedBytes": 12480000000,
              "sites": [
                {
                  "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                  "name": "Shop",
                  "bytes": 12480000000
                }
              ],
              "extraCentsPerGbMonth": 2.085,
              "monthToDateCents": 0,
              "currency": "usd"
            }
          }
        ]
      },
      "ServerMetrics": {
        "type": "object",
        "properties": {
          "range": {
            "type": "string",
            "description": "The time the graphs cover: `1h`, `6h`, `24h` or `7d`.",
            "x-known-values": [
              "1h",
              "6h",
              "24h",
              "7d"
            ]
          },
          "cpu": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricPoint"
            },
            "description": "Processor use, in percent (0 to 100)."
          },
          "memory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricPoint"
            },
            "description": "Memory in use, in percent."
          },
          "disk": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricPoint"
            },
            "description": "Disk space in use, in percent."
          },
          "load": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricPoint"
            },
            "description": "The load average over one minute."
          },
          "bandwidthIn": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricPoint"
            },
            "description": "Data received, in megabits per second."
          },
          "bandwidthOut": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricPoint"
            },
            "description": "Data sent, in megabits per second."
          },
          "notice": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "A note about the graphs, for example while a new server's history is still being collected. Null when there's none."
          }
        },
        "required": [
          "range",
          "cpu",
          "memory",
          "disk",
          "load",
          "bandwidthIn",
          "bandwidthOut",
          "notice"
        ],
        "description": "The server's graphs over a time range: processor, memory, disk, load and bandwidth. Empty until the server is running.",
        "examples": [
          {
            "range": "1h",
            "cpu": [
              {
                "t": 1763455200,
                "v": 12.4
              }
            ],
            "memory": [
              {
                "t": 1763455200,
                "v": 41.7
              }
            ],
            "disk": [
              {
                "t": 1763455200,
                "v": 21.3
              }
            ],
            "load": [
              {
                "t": 1763455200,
                "v": 0.18
              }
            ],
            "bandwidthIn": [
              {
                "t": 1763455200,
                "v": 0.42
              }
            ],
            "bandwidthOut": [
              {
                "t": 1763455200,
                "v": 1.35
              }
            ],
            "notice": null
          }
        ]
      },
      "ServerResizeInput": {
        "type": "object",
        "properties": {
          "planId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The plan to move to: a larger one on the server's cloud, offered in its location."
          }
        },
        "required": [
          "planId"
        ],
        "additionalProperties": false,
        "description": "The plan to resize a server to.",
        "examples": [
          {
            "planId": "performance"
          }
        ]
      },
      "ServerRestoreInput": {
        "type": "object",
        "properties": {
          "imageId": {
            "type": "string",
            "pattern": "^(\\d{1,15}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$",
            "description": "The `id` of a snapshot or backup from the server's list of snapshots."
          }
        },
        "required": [
          "imageId"
        ],
        "additionalProperties": false,
        "description": "The snapshot or backup to restore the server from.",
        "examples": [
          {
            "imageId": "171824639"
          }
        ]
      },
      "ServerSecurity": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Imunify360 on the server: `off`, `installing` (a few minutes; then `server.security_enabled`), `on`, `failed` (see `lastError`; turn it on again to retry), or `removing` (being turned off).",
            "x-known-values": [
              "off",
              "installing",
              "on",
              "failed",
              "removing"
            ]
          },
          "available": {
            "type": "boolean",
            "description": "Whether the server can run Imunify360: servers Rabbitflare creates and you pay for, with Intel or AMD processors and 2 GB of memory or more. Always true once it's on (or on its way in or out), so it can be turned off."
          },
          "unavailableReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it can't run here (with `available: false`). Null otherwise."
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "What went wrong (with `status: \"failed\"`). Null otherwise."
          },
          "extraSitePriceCents": {
            "type": "integer",
            "description": "What each site with malware protection on costs a month, past the server's included one, in US cents (299): billed after each month, by the days it was on."
          },
          "currency": {
            "type": "string",
            "const": "usd",
            "description": "Always `usd`: amounts are in US cents."
          },
          "sites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "siteId": {
                  "type": "string",
                  "description": "The site's id."
                },
                "enabled": {
                  "type": "boolean",
                  "description": "Whether malware protection is on for the site."
                },
                "included": {
                  "type": "boolean",
                  "description": "The site that comes with the server at no charge: the first to have it on."
                },
                "enabledAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "When it was turned on. Null while it's off.",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it was turned on. Null while it's off."
                },
                "openThreats": {
                  "type": "integer",
                  "description": "Threats found and not cleaned or ignored."
                }
              },
              "required": [
                "siteId",
                "enabled",
                "included",
                "enabledAt",
                "openThreats"
              ],
              "description": "A site's malware protection."
            },
            "description": "The server's live sites (staging copies aren't among them), oldest first. Every site is guarded by the server's firewall whatever its own switch says."
          },
          "checkedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the server last reported its figures (newer ones are fetched in the background once they're over 30 seconds old). Null while Imunify360 isn't on.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the server last reported its figures (newer ones are fetched in the background once they're over 30 seconds old). Null while Imunify360 isn't on."
          },
          "refreshing": {
            "type": "boolean",
            "description": "Newer figures are being fetched from the server: read again in a few seconds."
          },
          "stats": {
            "type": "object",
            "properties": {
              "attacksStopped24h": {
                "type": "integer",
                "description": "Attacks blocked or challenged in the last 24 hours."
              },
              "openThreats": {
                "type": "integer",
                "description": "Threats found and not cleaned or ignored, on every site."
              },
              "cleaned30d": {
                "type": "integer",
                "description": "Threats cleaned in the last 30 days."
              },
              "blockedAddresses": {
                "type": "integer",
                "description": "Addresses and countries blocked now."
              },
              "lastScanAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "When the last scan started. Null when none has run.",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "When the last scan started. Null when none has run."
              },
              "vulnerable": {
                "type": "integer",
                "description": "Plugins, themes and WordPress installs with open security holes, on every site."
              }
            },
            "required": [
              "attacksStopped24h",
              "openThreats",
              "cleaned30d",
              "blockedAddresses",
              "lastScanAt",
              "vulnerable"
            ],
            "description": "The server's figures. Zero while Imunify360 isn't on."
          },
          "settings": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ServerSecuritySettings"
              },
              {
                "type": "null"
              }
            ],
            "description": "Imunify360's settings. Null until it's on."
          },
          "ports": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "port": {
                  "type": "integer",
                  "description": "The port."
                },
                "protocol": {
                  "type": "string",
                  "description": "`tcp` or `udp`.",
                  "x-known-values": [
                    "tcp",
                    "udp"
                  ]
                },
                "comment": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A note."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The note it was added with: your own words. Null when none was."
                },
                "allowedAddresses": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "An IP address or range."
                  },
                  "description": "Addresses that still get through while the port is blocked."
                }
              },
              "required": [
                "port",
                "protocol",
                "comment",
                "allowedAddresses"
              ],
              "description": "A port in the server's port list."
            },
            "description": "The ports `settings.portsMode` treats differently: closed while it's `open_except`, open while it's `closed_except`."
          },
          "disabledRules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ruleId": {
                  "type": "string",
                  "description": "The rule: a web application firewall rule's number, or a WordPress plugin rule's name (like RULE-CVE-2024-1234-01)."
                },
                "name": {
                  "type": "string",
                  "description": "What it's for: the note it was turned off with (your own words), or the attack it stops."
                },
                "source": {
                  "type": "string",
                  "description": "`waf`: a rule of the web application firewall. `wordpress`: a rule of Imunify360's WordPress plugin.",
                  "x-known-values": [
                    "waf",
                    "wordpress"
                  ]
                },
                "siteIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "A site's id."
                  },
                  "description": "The sites it's off for. Empty: the whole server."
                },
                "domains": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "A domain."
                  },
                  "description": "Those sites' domains, as the rule names them. Empty: the whole server."
                }
              },
              "required": [
                "ruleId",
                "name",
                "source",
                "siteIds",
                "domains"
              ],
              "description": "A rule turned off for false alarms."
            },
            "description": "Rules turned off (`servers.security.rules.disable`); `servers.security.rules.enable` turns one back on."
          },
          "scans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "siteId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A site's id."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The site scanned. Null when it couldn't be told which."
                },
                "kind": {
                  "type": "string",
                  "description": "`nightly` (the schedule's), `manual` (asked for: `…/actions/scan`) or `realtime`.",
                  "x-known-values": [
                    "nightly",
                    "manual",
                    "realtime"
                  ]
                },
                "status": {
                  "type": "string",
                  "description": "`running`, `done` or `failed`.",
                  "x-known-values": [
                    "running",
                    "done",
                    "failed"
                  ]
                },
                "startedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "When it started. Null when not known.",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it started. Null when not known."
                },
                "finishedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "When it finished. Null while it runs.",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it finished. Null while it runs."
                },
                "files": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "description": "A count."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Files it checked. Null when not known."
                },
                "found": {
                  "type": "integer",
                  "description": "Threats it found."
                }
              },
              "required": [
                "siteId",
                "kind",
                "status",
                "startedAt",
                "finishedAt",
                "files",
                "found"
              ],
              "description": "A malware scan."
            },
            "description": "Recent scans of the server's sites, newest first."
          },
          "kernelPatching": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "description": "KernelCare on the server: `not_installed`, `installing`, `installed`, or `unknown` (while Imunify360 isn't on).",
                "x-known-values": [
                  "not_installed",
                  "installing",
                  "installed",
                  "unknown"
                ]
              },
              "patchedTo": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "A kernel version."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The kernel version it has patched the server up to. Null when not known."
              }
            },
            "required": [
              "status",
              "patchedTo"
            ],
            "description": "KernelCare: the server's kernel gets security patches without a restart. Free with Imunify360."
          },
          "reputation": {
            "type": "object",
            "properties": {
              "checkedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "When the domains were last checked. Null when they never were.",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "When the domains were last checked. Null when they never were."
              },
              "domains": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string",
                      "description": "The domain."
                    },
                    "siteId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "description": "A site's id."
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The site it belongs to. Null when it's none of the server's sites now."
                    },
                    "listed": {
                      "type": "boolean",
                      "description": "Whether it's on a blacklist."
                    },
                    "lists": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "A blacklist's name."
                      },
                      "description": "The blacklists it's on."
                    }
                  },
                  "required": [
                    "domain",
                    "siteId",
                    "listed",
                    "lists"
                  ],
                  "description": "A domain's check."
                },
                "description": "Each domain of the server's sites, as last checked."
              }
            },
            "required": [
              "checkedAt",
              "domains"
            ],
            "description": "Blacklist checks of the sites' domains (`settings.reputation`)."
          },
          "wordpressPlugin": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Whether the plugin is on for the server: it goes onto every site with malware protection on."
              },
              "sites": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "siteId": {
                      "type": "string",
                      "description": "The site's id."
                    },
                    "status": {
                      "type": "string",
                      "description": "The plugin in the site: `on`, `adding` (about a minute), `failed` (WordPress there didn't work) or `off` (taken off the site).",
                      "x-known-values": [
                        "on",
                        "adding",
                        "failed",
                        "off"
                      ]
                    },
                    "firewall": {
                      "type": "boolean",
                      "description": "The plugin's firewall: rules for known holes in WordPress, its plugins and themes, inside the site."
                    },
                    "aiBotProtection": {
                      "type": "boolean",
                      "description": "AI bot protection: limits how fast bots load pages, and blocks harmful ones."
                    },
                    "preset": {
                      "type": "string",
                      "description": "How strict AI bot protection is: `balanced`, `strict` or `monitor` (records bot traffic only).",
                      "x-known-values": [
                        "balanced",
                        "strict",
                        "monitor"
                      ]
                    }
                  },
                  "required": [
                    "siteId",
                    "status",
                    "firewall",
                    "aiBotProtection",
                    "preset"
                  ],
                  "description": "The plugin in a site."
                },
                "description": "The sites with malware protection on, while the plugin is on."
              }
            },
            "required": [
              "enabled",
              "sites"
            ],
            "description": "Imunify360's WordPress plugin (Imunify Security)."
          },
          "crawlers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The search engine's id on the server (digits): `DELETE /servers/{serverId}/security/crawlers/{crawlerId}` removes it."
                },
                "name": {
                  "type": "string",
                  "description": "Its name: Imunify360's own, or the one it was added with."
                },
                "url": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A web address."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Where it says how to recognise its crawlers, as it was added. Null when none was given."
                },
                "domains": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "A domain, like .googlebot.com."
                  },
                  "description": "Where its crawlers' addresses' names end."
                },
                "builtIn": {
                  "type": "boolean",
                  "description": "One of Imunify360's own (Google, Bing, Yandex, Baidu): always let through, it can't be removed."
                }
              },
              "required": [
                "id",
                "name",
                "url",
                "domains",
                "builtIn"
              ],
              "description": "A search engine the bot checks always let through."
            },
            "description": "Search engines the bot checks always let through."
          }
        },
        "required": [
          "status",
          "available",
          "unavailableReason",
          "lastError",
          "extraSitePriceCents",
          "currency",
          "sites",
          "checkedAt",
          "refreshing",
          "stats",
          "settings",
          "ports",
          "disabledRules",
          "scans",
          "kernelPatching",
          "reputation",
          "wordpressPlugin",
          "crawlers"
        ],
        "description": "Imunify360 on a server: its firewall (IP lists, ports, denial-of-service and password-guessing protection), web application firewall, bot checks, kernel patches and WordPress plugin guard every site there; its malware scanning and cleaning works for each site with malware protection on.",
        "examples": [
          {
            "status": "on",
            "available": true,
            "unavailableReason": null,
            "lastError": null,
            "extraSitePriceCents": 299,
            "currency": "usd",
            "sites": [
              {
                "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                "enabled": true,
                "included": true,
                "enabledAt": "2026-11-21T10:02:11.000Z",
                "openThreats": 1
              },
              {
                "siteId": "7c2e9a41-3b5d-4f68-a1c9-5d2e8f0b4a67",
                "enabled": false,
                "included": false,
                "enabledAt": null,
                "openThreats": 0
              }
            ],
            "checkedAt": "2026-11-25T09:14:02.000Z",
            "refreshing": false,
            "stats": {
              "attacksStopped24h": 53,
              "openThreats": 1,
              "cleaned30d": 2,
              "blockedAddresses": 2,
              "lastScanAt": "2026-11-25T03:00:12.000Z",
              "vulnerable": 1
            },
            "settings": {
              "realtime": true,
              "scanInterval": "day",
              "scanHour": 3,
              "scanDay": 0,
              "intensity": "moderate",
              "dbScan": true,
              "crontabs": true,
              "rapidScan": true,
              "adminTools": true,
              "cleanMode": "auto",
              "keepCopiesDays": 14,
              "dos": true,
              "dosLimit": 250,
              "enhancedDos": false,
              "enhancedDosLimit": 250,
              "enhancedDosSeconds": 30,
              "sshBruteForce": true,
              "intrusionDetection": true,
              "portsMode": "open_except",
              "ruleset": "full",
              "wpBruteForce": true,
              "cmsRules": true,
              "captcha": true,
              "antibot": true,
              "cdnSupport": true,
              "reputation": true,
              "alerts": {
                "malwareFound": true,
                "cleaned": true,
                "blacklisted": true,
                "vulnerable": true
              }
            },
            "ports": [
              {
                "port": 3306,
                "protocol": "tcp",
                "comment": "Database: only the office",
                "allowedAddresses": [
                  "198.51.100.7"
                ]
              }
            ],
            "disabledRules": [
              {
                "ruleId": "77350218",
                "name": "Turned off for the shop's page builder",
                "source": "waf",
                "siteIds": [
                  "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                ],
                "domains": [
                  "shop.example.com"
                ]
              }
            ],
            "scans": [
              {
                "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                "kind": "nightly",
                "status": "done",
                "startedAt": "2026-11-25T03:00:12.000Z",
                "finishedAt": "2026-11-25T03:02:40.000Z",
                "files": 4334,
                "found": 1
              }
            ],
            "kernelPatching": {
              "status": "installed",
              "patchedTo": "6.8.0-49-generic"
            },
            "reputation": {
              "checkedAt": "2026-11-25T04:00:00.000Z",
              "domains": [
                {
                  "domain": "shop.example.com",
                  "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                  "listed": false,
                  "lists": []
                }
              ]
            },
            "wordpressPlugin": {
              "enabled": true,
              "sites": [
                {
                  "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                  "status": "on",
                  "firewall": true,
                  "aiBotProtection": true,
                  "preset": "balanced"
                }
              ]
            },
            "crawlers": [
              {
                "id": "1",
                "name": "Google",
                "url": "https://support.google.com/webmasters/answer/80553?hl=en",
                "domains": [
                  ".google.com",
                  ".googlebot.com"
                ],
                "builtIn": true
              },
              {
                "id": "12",
                "name": "DuckDuckGo",
                "url": "https://duckduckgo.com/duckduckbot",
                "domains": [
                  ".duckduckgo.com"
                ],
                "builtIn": false
              }
            ]
          }
        ]
      },
      "ServerSecurityIncidents": {
        "type": "object",
        "properties": {
          "incidents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecurityIncident"
            },
            "description": "The attacks of the last 24 hours (at most 500), newest first. Not paged: an incident's id isn't kept from one look to the next, so look again for a newer list. Empty while Imunify360 isn't on."
          }
        },
        "required": [
          "incidents"
        ],
        "description": "The attacks Imunify360 stopped (or logged) on a server in the last 24 hours.",
        "examples": [
          {
            "incidents": [
              {
                "id": "1",
                "occurredAt": "2026-11-25T09:10:02.000Z",
                "ip": "45.146.165.10",
                "country": "DE",
                "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                "domain": "shop.example.com",
                "kind": "waf",
                "description": "Information disclosure attempt via WordPress plugins",
                "ruleId": "77350218",
                "severity": "high",
                "action": "challenged",
                "times": 12,
                "wordpress": null
              }
            ]
          }
        ]
      },
      "ServerSecuritySettings": {
        "type": "object",
        "properties": {
          "realtime": {
            "type": "boolean",
            "description": "Real-time scanning: each file written to a site is checked at once."
          },
          "scanInterval": {
            "type": "string",
            "description": "How often every site with malware protection on is scanned: `none`, `day`, `week` or `month`.",
            "x-known-values": [
              "none",
              "day",
              "week",
              "month"
            ]
          },
          "scanHour": {
            "type": "integer",
            "description": "The hour scheduled scans start, 0 to 23, in UTC."
          },
          "scanDay": {
            "type": "integer",
            "description": "The day scheduled scans run: 0 (Sunday) to 6 for weekly scans, 1 to 28 for monthly ones."
          },
          "intensity": {
            "type": "string",
            "description": "How much of the server's processor and disk scans may use: `low`, `moderate` or `high`.",
            "x-known-values": [
              "low",
              "moderate",
              "high"
            ]
          },
          "dbScan": {
            "type": "boolean",
            "description": "Scheduled scans check the sites' databases too."
          },
          "crontabs": {
            "type": "boolean",
            "description": "Scans check the server's scheduled tasks too."
          },
          "rapidScan": {
            "type": "boolean",
            "description": "Scheduled scans skip files unchanged since the last one."
          },
          "adminTools": {
            "type": "boolean",
            "description": "Database and file managers uploaded to sites count as threats."
          },
          "cleanMode": {
            "type": "string",
            "description": "What happens when malware is found: `auto` (cleaned at once, a copy kept for undoing) or `alert` (only listed and emailed: clean it yourself).",
            "x-known-values": [
              "auto",
              "alert"
            ]
          },
          "keepCopiesDays": {
            "type": "integer",
            "description": "Days a copy of each cleaned file is kept, so a clean-up can be undone (1 to 90)."
          },
          "dos": {
            "type": "boolean",
            "description": "Blocks an address that holds too many connections open at once (a denial-of-service attack)."
          },
          "dosLimit": {
            "type": "integer",
            "description": "How many connections an address may hold open at once (100 to 10000)."
          },
          "enhancedDos": {
            "type": "boolean",
            "description": "Also blocks an address that sends too many requests in a short time."
          },
          "enhancedDosLimit": {
            "type": "integer",
            "description": "How many requests an address may send in `enhancedDosSeconds` (100 to 100000)."
          },
          "enhancedDosSeconds": {
            "type": "integer",
            "description": "The time `enhancedDosLimit` counts over, in seconds (10 to 3600)."
          },
          "sshBruteForce": {
            "type": "boolean",
            "description": "Blocks addresses that keep guessing SSH passwords."
          },
          "intrusionDetection": {
            "type": "boolean",
            "description": "Intrusion detection: blocks addresses the server's logs show attacking it."
          },
          "portsMode": {
            "type": "string",
            "description": "`open_except`: every port is open except those in `ports`. `closed_except`: every port is closed except those in `ports` (and TCP 22, 22022, 80 and 443, which always stay open).",
            "x-known-values": [
              "open_except",
              "closed_except"
            ]
          },
          "ruleset": {
            "type": "string",
            "description": "The web application firewall's rules: `full` (recommended) or `minimal` (fewer rules, for sites the full set gets in the way of).",
            "x-known-values": [
              "full",
              "minimal"
            ]
          },
          "wpBruteForce": {
            "type": "boolean",
            "description": "Blocks addresses that keep guessing WordPress passwords."
          },
          "cmsRules": {
            "type": "boolean",
            "description": "Rules for the software a site runs (WordPress and its plugins)."
          },
          "captcha": {
            "type": "boolean",
            "description": "A suspicious visitor is asked to prove it's a person (a CAPTCHA) before being blocked."
          },
          "antibot": {
            "type": "boolean",
            "description": "Bot checks: a browser is checked before it reaches the sites, so bad bots are stopped."
          },
          "cdnSupport": {
            "type": "boolean",
            "description": "Reads a visitor's real address behind a CDN or proxy (Cloudflare and others), so the right address is blocked."
          },
          "reputation": {
            "type": "boolean",
            "description": "Checks the sites' domains against blacklists once a day."
          },
          "alerts": {
            "type": "object",
            "properties": {
              "malwareFound": {
                "type": "boolean",
                "description": "Malware was found and not cleaned at once."
              },
              "cleaned": {
                "type": "boolean",
                "description": "Malware was found and cleaned."
              },
              "blacklisted": {
                "type": "boolean",
                "description": "A site's domain is on a blacklist."
              },
              "vulnerable": {
                "type": "boolean",
                "description": "A plugin, a theme or WordPress with known security holes was found on a site."
              }
            },
            "required": [
              "malwareFound",
              "cleaned",
              "blacklisted",
              "vulnerable"
            ],
            "description": "Which emails the account's owner gets about the server's sites (each site can also turn its own off)."
          }
        },
        "required": [
          "realtime",
          "scanInterval",
          "scanHour",
          "scanDay",
          "intensity",
          "dbScan",
          "crontabs",
          "rapidScan",
          "adminTools",
          "cleanMode",
          "keepCopiesDays",
          "dos",
          "dosLimit",
          "enhancedDos",
          "enhancedDosLimit",
          "enhancedDosSeconds",
          "sshBruteForce",
          "intrusionDetection",
          "portsMode",
          "ruleset",
          "wpBruteForce",
          "cmsRules",
          "captcha",
          "antibot",
          "cdnSupport",
          "reputation",
          "alerts"
        ],
        "description": "Imunify360's settings on a server.",
        "examples": [
          {
            "realtime": true,
            "scanInterval": "day",
            "scanHour": 3,
            "scanDay": 0,
            "intensity": "moderate",
            "dbScan": true,
            "crontabs": true,
            "rapidScan": true,
            "adminTools": true,
            "cleanMode": "auto",
            "keepCopiesDays": 14,
            "dos": true,
            "dosLimit": 250,
            "enhancedDos": false,
            "enhancedDosLimit": 250,
            "enhancedDosSeconds": 30,
            "sshBruteForce": true,
            "intrusionDetection": true,
            "portsMode": "open_except",
            "ruleset": "full",
            "wpBruteForce": true,
            "cmsRules": true,
            "captcha": true,
            "antibot": true,
            "cdnSupport": true,
            "reputation": true,
            "alerts": {
              "malwareFound": true,
              "cleaned": true,
              "blacklisted": true,
              "vulnerable": true
            }
          }
        ]
      },
      "ServerSecuritySettingsInput": {
        "type": "object",
        "properties": {
          "realtime": {
            "description": "Real-time scanning: each file written to a site is checked at once.",
            "type": "boolean"
          },
          "scanInterval": {
            "description": "How often every site with malware protection on is scanned: `none`, `day`, `week` or `month`.",
            "type": "string",
            "enum": [
              "none",
              "day",
              "week",
              "month"
            ]
          },
          "scanHour": {
            "description": "The hour scheduled scans start, 0 to 23, in UTC.",
            "type": "integer",
            "minimum": 0,
            "maximum": 23
          },
          "scanDay": {
            "description": "The day scheduled scans run: 0 (Sunday) to 6 for weekly scans, 1 to 28 for monthly ones.",
            "type": "integer",
            "minimum": 0,
            "maximum": 28
          },
          "intensity": {
            "description": "How much of the server's processor and disk scans may use: `low`, `moderate` or `high`.",
            "type": "string",
            "enum": [
              "low",
              "moderate",
              "high"
            ]
          },
          "dbScan": {
            "description": "Scheduled scans check the sites' databases too.",
            "type": "boolean"
          },
          "crontabs": {
            "description": "Scans check the server's scheduled tasks too.",
            "type": "boolean"
          },
          "rapidScan": {
            "description": "Scheduled scans skip files unchanged since the last one.",
            "type": "boolean"
          },
          "adminTools": {
            "description": "Database and file managers uploaded to sites count as threats.",
            "type": "boolean"
          },
          "cleanMode": {
            "description": "What happens when malware is found: `auto` (cleaned at once, a copy kept for undoing) or `alert` (only listed and emailed: clean it yourself).",
            "type": "string",
            "enum": [
              "auto",
              "alert"
            ]
          },
          "keepCopiesDays": {
            "description": "Days a copy of each cleaned file is kept, so a clean-up can be undone (1 to 90).",
            "type": "integer",
            "minimum": 1,
            "maximum": 90
          },
          "dos": {
            "description": "Blocks an address that holds too many connections open at once (a denial-of-service attack).",
            "type": "boolean"
          },
          "dosLimit": {
            "description": "How many connections an address may hold open at once (100 to 10000).",
            "type": "integer",
            "minimum": 100,
            "maximum": 10000
          },
          "enhancedDos": {
            "description": "Also blocks an address that sends too many requests in a short time.",
            "type": "boolean"
          },
          "enhancedDosLimit": {
            "description": "How many requests an address may send in `enhancedDosSeconds` (100 to 100000).",
            "type": "integer",
            "minimum": 100,
            "maximum": 100000
          },
          "enhancedDosSeconds": {
            "description": "The time `enhancedDosLimit` counts over, in seconds (10 to 3600).",
            "type": "integer",
            "minimum": 10,
            "maximum": 3600
          },
          "sshBruteForce": {
            "description": "Blocks addresses that keep guessing SSH passwords.",
            "type": "boolean"
          },
          "intrusionDetection": {
            "description": "Intrusion detection: blocks addresses the server's logs show attacking it.",
            "type": "boolean"
          },
          "portsMode": {
            "description": "`open_except`: every port is open except those in `ports`. `closed_except`: every port is closed except those in `ports` (and TCP 22, 22022, 80 and 443, which always stay open).",
            "type": "string",
            "enum": [
              "open_except",
              "closed_except"
            ]
          },
          "ruleset": {
            "description": "The web application firewall's rules: `full` (recommended) or `minimal` (fewer rules, for sites the full set gets in the way of).",
            "type": "string",
            "enum": [
              "full",
              "minimal"
            ]
          },
          "wpBruteForce": {
            "description": "Blocks addresses that keep guessing WordPress passwords.",
            "type": "boolean"
          },
          "cmsRules": {
            "description": "Rules for the software a site runs (WordPress and its plugins).",
            "type": "boolean"
          },
          "captcha": {
            "description": "A suspicious visitor is asked to prove it's a person (a CAPTCHA) before being blocked.",
            "type": "boolean"
          },
          "antibot": {
            "description": "Bot checks: a browser is checked before it reaches the sites, so bad bots are stopped.",
            "type": "boolean"
          },
          "cdnSupport": {
            "description": "Reads a visitor's real address behind a CDN or proxy (Cloudflare and others), so the right address is blocked.",
            "type": "boolean"
          },
          "reputation": {
            "description": "Checks the sites' domains against blacklists once a day.",
            "type": "boolean"
          },
          "alerts": {
            "description": "Which emails the account's owner gets. Those left out stay as they are.",
            "type": "object",
            "properties": {
              "malwareFound": {
                "description": "Malware was found and not cleaned at once.",
                "type": "boolean"
              },
              "cleaned": {
                "description": "Malware was found and cleaned.",
                "type": "boolean"
              },
              "blacklisted": {
                "description": "A site's domain is on a blacklist.",
                "type": "boolean"
              },
              "vulnerable": {
                "description": "Known security holes were found on a site.",
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false,
        "description": "Imunify360 settings to change. Settings left out stay as they are.",
        "examples": [
          {
            "cleanMode": "alert",
            "scanInterval": "week",
            "scanDay": 0,
            "alerts": {
              "cleaned": false
            }
          }
        ]
      },
      "Site": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The site's id."
          },
          "name": {
            "type": "string",
            "description": "The site's name, as shown in the panel."
          },
          "serverId": {
            "type": "string",
            "description": "The id of the server the site is on."
          },
          "server": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The server's id."
              },
              "name": {
                "type": "string",
                "description": "The server's name."
              },
              "status": {
                "type": "string",
                "description": "The server's status (see the Server object).",
                "x-known-values": [
                  "pending_payment",
                  "provisioning",
                  "active",
                  "off",
                  "suspended",
                  "failed",
                  "deleting",
                  "deleted"
                ]
              },
              "cloud": {
                "type": "string",
                "description": "Where the server runs (see the Server object).",
                "x-known-values": [
                  "digitalocean",
                  "vultr",
                  "hetzner",
                  "linode",
                  "gcp",
                  "edge",
                  "custom"
                ]
              },
              "region": {
                "type": "string",
                "description": "The server's location id."
              },
              "ipv4": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "An IPv4 address."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The server's public IPv4 address. Null until it has one."
              },
              "ipv6": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "An IPv6 address."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The server's public IPv6 address. Null when it has none."
              }
            },
            "required": [
              "id",
              "name",
              "status",
              "cloud",
              "region",
              "ipv4",
              "ipv6"
            ],
            "description": "The server the site is on, at a glance."
          },
          "status": {
            "type": "string",
            "description": "`queued`: waiting for its server. `installing`: WordPress is being installed (see `stage`). `active`: live. `failed`: the install failed (see `lastError`). `deleting`: being deleted. `deleted`: deleted.",
            "x-known-values": [
              "queued",
              "installing",
              "active",
              "failed",
              "deleting",
              "deleted"
            ]
          },
          "stage": {
            "type": "string",
            "description": "How far the install has got: `queued`, `wordpress` (installing WordPress), `ssl` (issuing its certificate), then `complete`, or `failed`.",
            "x-known-values": [
              "queued",
              "wordpress",
              "ssl",
              "complete",
              "failed"
            ]
          },
          "pendingAction": {
            "description": "A change in progress on the site: `domain` (updating its domains), `ssl` (issuing a certificate), `delete` or `restore` (restoring a backup). Another change waits until it's done (409 `busy`). Null when there's none.",
            "x-known-values": [
              "domain",
              "ssl",
              "delete",
              "restore"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "description": "The site's address, on its primary domain (https once its certificate is active)."
          },
          "adminUrl": {
            "type": "string",
            "description": "The address of the site's WordPress dashboard."
          },
          "builtInDomain": {
            "type": "string",
            "description": "The address every site gets, which keeps working whatever domains it has."
          },
          "primaryDomain": {
            "type": "string",
            "description": "The domain the site is served on; other domains redirect to it."
          },
          "siteTitle": {
            "type": "string",
            "description": "The site's title in WordPress, as set when it was created."
          },
          "wordpress": {
            "type": "object",
            "properties": {
              "adminUsername": {
                "type": "string",
                "description": "The WordPress administrator's username."
              },
              "adminEmail": {
                "type": "string",
                "description": "The WordPress administrator's email address."
              }
            },
            "required": [
              "adminUsername",
              "adminEmail"
            ],
            "description": "The WordPress administrator made with the site. The password is read with GET /sites/{siteId}/wordpress-login."
          },
          "sslStatus": {
            "type": "string",
            "description": "The site's SSL certificate: `none`, `pending` (being issued), `active` or `failed`.",
            "x-known-values": [
              "none",
              "pending",
              "active",
              "failed"
            ]
          },
          "cdn": {
            "type": "string",
            "description": "The included CDN for the site's static files: `off`, `enabling`, `active` or `failed`.",
            "x-known-values": [
              "off",
              "enabling",
              "active",
              "failed"
            ]
          },
          "firewall": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "description": "`off`, `monitor` (logs attacks, blocks nothing) or `protect` (blocks attacks).",
                "x-known-values": [
                  "off",
                  "monitor",
                  "protect"
                ]
              },
              "status": {
                "type": "string",
                "description": "Whether its settings are in place on the server: `off`, `installing`, `applying`, `active` or `failed`.",
                "x-known-values": [
                  "off",
                  "installing",
                  "applying",
                  "active",
                  "failed"
                ]
              }
            },
            "required": [
              "mode",
              "status"
            ],
            "description": "The site's web application firewall."
          },
          "malwareProtection": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Whether malware protection (Imunify360's scanning and cleaning) is on for the site."
              },
              "included": {
                "type": "boolean",
                "description": "Whether the site is its server's included one, at no charge: the first with it on. Each other site with it on is billed."
              }
            },
            "required": [
              "enabled",
              "included"
            ],
            "description": "The site's malware protection (Imunify360). `GET /sites/{siteId}/malware-protection` has the rest."
          },
          "customResources": {
            "type": "boolean",
            "description": "Whether the site has resource settings of its own (limits, priority or PHP settings) rather than the server's defaults."
          },
          "stagingOf": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The live site's id."
                  },
                  "name": {
                    "type": "string",
                    "description": "The live site's name."
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "description": "The live site."
              },
              {
                "type": "null"
              }
            ],
            "description": "When this site is a staging copy: the live site it copies. Null otherwise."
          },
          "staging": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "The copy's id."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The staging copy's id. Null when it has none now (only restore points, or an operation)."
                  },
                  "status": {
                    "description": "The staging copy's status (as a site's). Null when it has none.",
                    "x-known-values": [
                      "queued",
                      "installing",
                      "active",
                      "failed",
                      "deleting",
                      "deleted"
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "busy": {
                    "description": "The staging operation running now: `create`, `refresh`, `push` or `undo`. Null when none is.",
                    "x-known-values": [
                      "create",
                      "refresh",
                      "push",
                      "undo"
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "attention": {
                    "type": "boolean",
                    "description": "Whether the running staging operation is waiting for our team."
                  }
                },
                "required": [
                  "id",
                  "status",
                  "busy",
                  "attention"
                ],
                "description": "The live site's staging."
              },
              {
                "type": "null"
              }
            ],
            "description": "A live site's staging: its copy and the staging operation running now. Null when it never used staging."
          },
          "clone": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The clone's id."
                  },
                  "status": {
                    "type": "string",
                    "description": "`queued`, `copying`, `finishing`, `done`, `failed` or `cancelled`.",
                    "x-known-values": [
                      "queued",
                      "copying",
                      "finishing",
                      "done",
                      "failed",
                      "cancelled"
                    ]
                  },
                  "stage": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A sentence."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "What's happening now, in words. Null when not known."
                  },
                  "progress": {
                    "anyOf": [
                      {
                        "type": "number",
                        "description": "Percent."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "0 to 100 while copying. Null when not known."
                  },
                  "sourceName": {
                    "type": "string",
                    "description": "The name of the site being copied."
                  },
                  "error": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A sentence."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Why the copy failed. Null otherwise."
                  }
                },
                "required": [
                  "id",
                  "status",
                  "stage",
                  "progress",
                  "sourceName",
                  "error"
                ],
                "description": "The clone being made into this site."
              },
              {
                "type": "null"
              }
            ],
            "description": "When this site is a clone being made (or whose copy failed): the clone. Null once the copy is in, or when it never was a clone."
          },
          "clonedFrom": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "The site's id."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The original site's id. Null once that site is deleted."
                  },
                  "name": {
                    "type": "string",
                    "description": "The original site's name."
                  },
                  "clonedAt": {
                    "type": "string",
                    "description": "When the clone was made.",
                    "format": "date-time"
                  }
                },
                "required": [
                  "id",
                  "name",
                  "clonedAt"
                ],
                "description": "The site this one was cloned from."
              },
              {
                "type": "null"
              }
            ],
            "description": "The site this one was cloned from, and when. Null when it wasn't cloned."
          },
          "beingCloned": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The new site's id."
                  },
                  "name": {
                    "type": "string",
                    "description": "The new site's name."
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "description": "The new site."
              },
              {
                "type": "null"
              }
            ],
            "description": "A clone of this site being made right now: the new site. Null otherwise."
          },
          "iconUrl": {
            "anyOf": [
              {
                "type": "string",
                "description": "An https address."
              },
              {
                "type": "null"
              }
            ],
            "description": "The site's own icon (WordPress's Site Icon), looked up once a day. Null when it has none."
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the install or the last change failed. Null when nothing failed."
          },
          "readyAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the site finished installing. Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the site finished installing. Null until then."
          },
          "createdAt": {
            "type": "string",
            "description": "When the site was created.",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "When the site last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "serverId",
          "server",
          "status",
          "stage",
          "pendingAction",
          "url",
          "adminUrl",
          "builtInDomain",
          "primaryDomain",
          "siteTitle",
          "wordpress",
          "sslStatus",
          "cdn",
          "firewall",
          "malwareProtection",
          "customResources",
          "stagingOf",
          "staging",
          "clone",
          "clonedFrom",
          "beingCloned",
          "iconUrl",
          "lastError",
          "readyAt",
          "createdAt",
          "updatedAt"
        ],
        "description": "A WordPress site on one of your servers.",
        "examples": [
          {
            "id": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "name": "Shop",
            "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
            "server": {
              "id": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
              "name": "Production",
              "status": "active",
              "cloud": "digitalocean",
              "region": "fra1",
              "ipv4": "203.0.113.10",
              "ipv6": "2001:db8::10"
            },
            "status": "active",
            "stage": "complete",
            "pendingAction": null,
            "url": "https://shop.example.com",
            "adminUrl": "https://shop.example.com/wp-admin/",
            "builtInDomain": "shop-x7k2p.rabbitflare.link",
            "primaryDomain": "shop.example.com",
            "siteTitle": "Example Shop",
            "wordpress": {
              "adminUsername": "editor",
              "adminEmail": "you@example.com"
            },
            "sslStatus": "active",
            "cdn": "off",
            "firewall": {
              "mode": "protect",
              "status": "active"
            },
            "malwareProtection": {
              "enabled": true,
              "included": true
            },
            "customResources": false,
            "stagingOf": null,
            "staging": null,
            "clone": null,
            "clonedFrom": null,
            "beingCloned": null,
            "iconUrl": null,
            "lastError": null,
            "readyAt": "2026-11-18T09:12:40.000Z",
            "createdAt": "2026-11-18T09:10:02.000Z",
            "updatedAt": "2026-11-18T09:31:17.000Z"
          }
        ]
      },
      "SiteBackup": {
        "type": "object",
        "properties": {
          "settings": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "destination": {
                    "type": "string",
                    "description": "Where backups go: `rabbitflare` (Rabbitflare Backup), or the id of your storage (`GET /backup-destinations`)."
                  },
                  "region": {
                    "description": "Where Rabbitflare Backup keeps them: `virginia` (United States), `frankfurt` (Europe) or `singapore` (Asia Pacific). Null for storage of your own.",
                    "x-known-values": [
                      "virginia",
                      "frankfurt",
                      "singapore"
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "frequency": {
                    "type": "string",
                    "description": "`daily`, `weekly`, or `manual` (only when one is started).",
                    "x-known-values": [
                      "daily",
                      "weekly",
                      "manual"
                    ]
                  },
                  "hour": {
                    "type": "integer",
                    "description": "The hour of the day (0 to 23, UTC) a scheduled backup starts."
                  },
                  "weekday": {
                    "type": "integer",
                    "description": "The day a weekly backup is made, from 0 (Sunday) to 6 (Saturday)."
                  },
                  "keep": {
                    "type": "integer",
                    "description": "How many backups are kept (1 to 60): when one more completes, the oldest beyond that number are deleted. Backups made just before a restore count too."
                  },
                  "paused": {
                    "type": "boolean",
                    "description": "Whether scheduled backups are paused (see `pausedReason`)."
                  },
                  "pausedReason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A sentence."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Why they're paused, in one plain sentence. Null while they aren't."
                  },
                  "nextRunAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "When the next scheduled backup is due. Null for `manual`, and while they're paused.",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "When the next scheduled backup is due. Null for `manual`, and while they're paused."
                  }
                },
                "required": [
                  "destination",
                  "region",
                  "frequency",
                  "hour",
                  "weekday",
                  "keep",
                  "paused",
                  "pausedReason",
                  "nextRunAt"
                ],
                "description": "Where the site's backups go, and how often."
              },
              {
                "type": "null"
              }
            ],
            "description": "Where the site's backups go and how often. Null while backups are off for the site: `PUT /sites/{siteId}/backup/settings` turns them on."
          },
          "suggestedRegion": {
            "type": "string",
            "description": "The Rabbitflare Backup region nearest the site's server.",
            "x-known-values": [
              "virginia",
              "frankfurt",
              "singapore"
            ]
          },
          "prices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "region": {
                  "type": "string",
                  "description": "The region: `virginia` (United States), `frankfurt` (Europe) or `singapore` (Asia Pacific).",
                  "x-known-values": [
                    "virginia",
                    "frankfurt",
                    "singapore"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "Its name, like `Europe (Frankfurt)`."
                },
                "siteFeeCents": {
                  "type": "integer",
                  "description": "The fee for backing the site up there, per month, in US cents, counted by the day: 0 for sites on Amazon EC2 and Google Cloud servers."
                },
                "centsPerGbMonth": {
                  "type": "number",
                  "description": "What each GB (1,073,741,824 bytes) of the site's backups costs per month, in US cents (it can have decimals)."
                },
                "currency": {
                  "type": "string",
                  "const": "usd",
                  "description": "Always `usd`: amounts are in US cents."
                }
              },
              "required": [
                "region",
                "name",
                "siteFeeCents",
                "centsPerGbMonth",
                "currency"
              ],
              "description": "What Rabbitflare Backup costs the site in one region."
            },
            "description": "What Rabbitflare Backup would cost this site in each region. It's billed by use, after each month: the site's fee for the days it's backed up there, and the space its backups take up. Storage of your own costs nothing."
          },
          "hasCard": {
            "type": "boolean",
            "description": "Whether the account has a saved card, which Rabbitflare Backup needs (`402 payment_method_required` without one): its monthly bill is paid from the wallet first, then the card."
          },
          "storedBytes": {
            "type": "integer",
            "description": "What the site's completed backups in Rabbitflare Backup take up now: what their storage is billed on."
          },
          "latestBackup": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Backup"
              },
              {
                "type": "null"
              }
            ],
            "description": "The site's newest backup: the one running, else the last one made. Null before the first. All of them: `GET /sites/{siteId}/backups`."
          },
          "restore": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BackupRestore"
              },
              {
                "type": "null"
              }
            ],
            "description": "The site's latest restore from the last 24 hours, running or finished. Null when there's none."
          }
        },
        "required": [
          "settings",
          "suggestedRegion",
          "prices",
          "hasCard",
          "storedBytes",
          "latestBackup",
          "restore"
        ],
        "description": "A site's backups at a glance: where they go and how often, what Rabbitflare Backup would cost, the newest backup and the latest restore. The backups themselves are a list of their own (`GET /sites/{siteId}/backups`).",
        "examples": [
          {
            "settings": {
              "destination": "rabbitflare",
              "region": "frankfurt",
              "frequency": "daily",
              "hour": 3,
              "weekday": 0,
              "keep": 14,
              "paused": false,
              "pausedReason": null,
              "nextRunAt": "2026-11-20T03:00:00.000Z"
            },
            "suggestedRegion": "frankfurt",
            "prices": [
              {
                "region": "virginia",
                "name": "United States (Virginia)",
                "siteFeeCents": 200,
                "centsPerGbMonth": 4.6,
                "currency": "usd"
              },
              {
                "region": "frankfurt",
                "name": "Europe (Frankfurt)",
                "siteFeeCents": 200,
                "centsPerGbMonth": 4.9,
                "currency": "usd"
              },
              {
                "region": "singapore",
                "name": "Asia Pacific (Singapore)",
                "siteFeeCents": 200,
                "centsPerGbMonth": 5,
                "currency": "usd"
              }
            ],
            "hasCard": true,
            "storedBytes": 17953243136,
            "latestBackup": {
              "id": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
              "status": "completed",
              "trigger": "scheduled",
              "location": "Rabbitflare Backup (Europe (Frankfurt))",
              "sizeBytes": 1284311552,
              "filesBytes": 1201143808,
              "databaseBytes": 83167744,
              "progress": 1,
              "stage": null,
              "error": null,
              "startedAt": "2026-11-19T03:00:04.000Z",
              "finishedAt": "2026-11-19T03:06:41.000Z",
              "canRestore": true,
              "canDownload": true
            },
            "restore": null
          }
        ]
      },
      "SiteCdn": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`off`: the site serves every file itself. `enabling`: being set up (see `stage`; usually 3 to 10 minutes). `active`: the site's files are served from the CDN. `failed`: setting it up stopped (see `lastError`); switching it on again carries on where it stopped.",
            "x-known-values": [
              "off",
              "enabling",
              "active",
              "failed"
            ]
          },
          "stage": {
            "description": "While `enabling`, or where a failed setup stopped: `creating` (setting up the site's CDN), `deploying` (spreading it to every location), `verifying` (checking it serves the site's files), then `installing` (switching the site's pages to it). Null otherwise.",
            "x-known-values": [
              "creating",
              "deploying",
              "verifying",
              "installing"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "blockedReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the CDN can't be switched on (or changed) for this site right now, in a sentence: the site is a staging copy, is still installing, or is on your own server or a trial server, its server is off, or its built-in address has no SSL certificate yet. Null when nothing stands in the way."
          },
          "domain": {
            "anyOf": [
              {
                "type": "string",
                "description": "A hostname."
              },
              {
                "type": "null"
              }
            ],
            "description": "The CDN's own address for the site's files, which the site's pages use (until a custom hostname is active). Null while the CDN is off or being set up."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the setup started, while `enabling` or `failed`. Null otherwise.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the setup started, while `enabling` or `failed`. Null otherwise."
          },
          "enabledAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the CDN came on, while it's `active`. Null otherwise.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the CDN came on, while it's `active`. Null otherwise."
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the setup failed (with `status: \"failed\"`). Null otherwise."
          },
          "purging": {
            "type": "boolean",
            "description": "Whether files are being cleared from the CDN now (it takes a minute or two)."
          },
          "purgedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When files were last cleared from the CDN. Null when they never were.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When files were last cleared from the CDN. Null when they never were."
          },
          "usage": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "description": "The number of days the figures cover, up to now."
                  },
                  "requests": {
                    "type": "integer",
                    "description": "Requests the CDN served for the site."
                  },
                  "bytes": {
                    "type": "integer",
                    "description": "Bytes the CDN served for the site."
                  }
                },
                "required": [
                  "days",
                  "requests",
                  "bytes"
                ],
                "description": "What the CDN served for the site."
              },
              {
                "type": "null"
              }
            ],
            "description": "What the CDN served for the site over the last `days` days. Null while it's off, or when the figures can't be read just now."
          },
          "deliveryOptions": {
            "type": "boolean",
            "description": "Whether the delivery options are open to the account: choosing the kinds of files the CDN serves and paths it leaves on the server (`PUT /sites/{siteId}/cdn/settings`), a custom hostname, and clearing particular files. When false, those answer 403 feature_unavailable; switching the CDN on and off and clearing everything work either way."
          },
          "settings": {
            "type": "object",
            "properties": {
              "types": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "A kind of file.",
                  "x-known-values": [
                    "images",
                    "css",
                    "js",
                    "fonts",
                    "media",
                    "documents"
                  ]
                },
                "description": "The kinds of files the CDN serves, from the site's /wp-content and /wp-includes folders: `images` (Images: JPG, PNG, GIF, WebP, AVIF, SVG, ICO), `css` (CSS: Stylesheets), `js` (JavaScript: Scripts), `fonts` (Fonts: WOFF2, WOFF, TTF, OTF, EOT), `media` (Video and audio: MP4, WebM, MP3, M4A, WAV, OGG), `documents` (PDFs: PDF documents)."
              },
              "exclude": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "A path."
                },
                "description": "Paths kept on the server: files whose address starts with one of them are never served from the CDN."
              }
            },
            "required": [
              "types",
              "exclude"
            ],
            "description": "What the CDN serves. It applies whenever the CDN is on; a site that never chose serves every kind and keeps no paths."
          },
          "customHostname": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CdnCustomHostname"
              },
              {
                "type": "null"
              }
            ],
            "description": "The site's custom CDN hostname, while the CDN is on. Null when it has none, or when the delivery options aren't open to the account."
          }
        },
        "required": [
          "status",
          "stage",
          "blockedReason",
          "domain",
          "startedAt",
          "enabledAt",
          "lastError",
          "purging",
          "purgedAt",
          "usage",
          "deliveryOptions",
          "settings",
          "customHostname"
        ],
        "description": "A site's CDN, included with Rabbitflare's cloud servers: its images, CSS, JavaScript, fonts and other static files served from 600+ locations worldwide, so visitors get them from nearby. Pages, logins, carts and forms still come from the site's server.",
        "examples": [
          {
            "status": "active",
            "stage": null,
            "blockedReason": null,
            "domain": "d1a2b3c4e5f6g7.cdn.example.net",
            "startedAt": null,
            "enabledAt": "2026-11-18T09:42:10.000Z",
            "lastError": null,
            "purging": false,
            "purgedAt": "2026-11-18T11:05:33.000Z",
            "usage": {
              "days": 7,
              "requests": 184220,
              "bytes": 9310442118
            },
            "deliveryOptions": true,
            "settings": {
              "types": [
                "images",
                "css",
                "js",
                "fonts",
                "media",
                "documents"
              ],
              "exclude": []
            },
            "customHostname": null
          }
        ]
      },
      "SiteClone": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The clone's id."
          },
          "status": {
            "type": "string",
            "description": "`queued`: the new site is being installed. `copying`: the copy is being made (from another server, the site is packed there first). `finishing`: the clone's settings are being applied (it can't be cancelled now). Then `done`, `failed` (see `lastError`; try again with `POST /sites/{siteId}/clone/actions/retry` on the new site) or `cancelled` (the new site is deleted).",
            "x-known-values": [
              "queued",
              "copying",
              "finishing",
              "done",
              "failed",
              "cancelled"
            ]
          },
          "stage": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "What's happening now, in words. Null once it's finished."
          },
          "progress": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Percent."
              },
              {
                "type": "null"
              }
            ],
            "description": "How far the copy has got, 0 to 100. Null when that isn't known."
          },
          "source": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The site's id."
                  },
                  "name": {
                    "type": "string",
                    "description": "The site's name."
                  },
                  "serverName": {
                    "type": "string",
                    "description": "The name of the site's server."
                  }
                },
                "required": [
                  "id",
                  "name",
                  "serverName"
                ],
                "description": "The site that is copied. A clone never changes it."
              },
              {
                "type": "null"
              }
            ],
            "description": "The site that is copied. A clone never changes it. Null when this token can't reach that site's server (a token limited to some servers)."
          },
          "target": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The site's id."
              },
              "name": {
                "type": "string",
                "description": "The site's name."
              },
              "serverName": {
                "type": "string",
                "description": "The name of the site's server."
              }
            },
            "required": [
              "id",
              "name",
              "serverName"
            ],
            "description": "The new site the copy is made into."
          },
          "crossServer": {
            "type": "boolean",
            "description": "Whether the new site is on another server than the original."
          },
          "options": {
            "type": "object",
            "properties": {
              "resources": {
                "type": "boolean",
                "description": "The site's PHP and resource settings were copied, where they fit the destination server."
              },
              "firewall": {
                "type": "boolean",
                "description": "The firewall's mode, sensitivity, login protection, blocked and allowed addresses and exceptions were copied."
              },
              "cron": {
                "type": "boolean",
                "description": "The site's cron jobs were copied, paused (the original keeps running its own)."
              },
              "noindex": {
                "type": "boolean",
                "description": "Search engines are asked not to index the clone (WordPress's “Discourage search engines” setting)."
              }
            },
            "required": [
              "resources",
              "firewall",
              "cron",
              "noindex"
            ],
            "description": "What the clone copies besides the files and the database."
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the clone failed (or was cancelled by itself). Null otherwise."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A sentence."
            },
            "description": "What's worth knowing after the clone: settings that didn't fit the destination, cron jobs copied paused, and the like."
          },
          "health": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "ok": {
                    "type": "boolean",
                    "description": "Whether the new site's pages answered as the original's did."
                  },
                  "problems": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "A sentence."
                    },
                    "description": "What went wrong, page by page."
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A sentence."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Why the pages failed, where the server could tell. Null otherwise."
                  }
                },
                "required": [
                  "ok",
                  "problems",
                  "reason"
                ],
                "description": "The check of the new site's pages."
              },
              {
                "type": "null"
              }
            ],
            "description": "The new site's own pages, checked right after the copy. Null until they're checked."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "The file's path in the site."
                },
                "reason": {
                  "type": "string",
                  "description": "Why it was left out: `unreadable`, `unreadable_folder`, `link_outside_site` (a link pointing outside the site), `changed_while_copying`, `database_password` (it holds the original's database password), `special_file` (not a regular file) or `other`.",
                  "x-known-values": [
                    "unreadable",
                    "unreadable_folder",
                    "link_outside_site",
                    "changed_while_copying",
                    "database_password",
                    "special_file",
                    "other"
                  ]
                }
              },
              "required": [
                "path",
                "reason"
              ],
              "description": "A file the copy left out."
            },
            "description": "Files the copy left out (up to 100 of them)."
          },
          "skippedCount": {
            "type": "integer",
            "description": "How many files the copy left out in all."
          },
          "sizes": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "filesBytes": {
                    "type": "integer",
                    "description": "The site's files, without caches and backup archives, in bytes."
                  },
                  "databaseBytes": {
                    "type": "integer",
                    "description": "The site's database, in bytes."
                  }
                },
                "required": [
                  "filesBytes",
                  "databaseBytes"
                ],
                "description": "The site's size."
              },
              {
                "type": "null"
              }
            ],
            "description": "What was copied. Null until the copy is made."
          },
          "cancellable": {
            "type": "boolean",
            "description": "Whether it can be cancelled now (`POST /sites/{siteId}/clone/actions/cancel` on the new site): until it's switched into the new site."
          },
          "createdAt": {
            "type": "string",
            "description": "When the clone was started.",
            "format": "date-time"
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the copy started. Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the copy started. Null until then."
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it finished. Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it finished. Null until then."
          }
        },
        "required": [
          "id",
          "status",
          "stage",
          "progress",
          "source",
          "target",
          "crossServer",
          "options",
          "lastError",
          "notes",
          "health",
          "skipped",
          "skippedCount",
          "sizes",
          "cancellable",
          "createdAt",
          "startedAt",
          "finishedAt"
        ],
        "description": "A clone: a copy of a site, with every file and its whole database, made into a new site of its own.",
        "examples": [
          {
            "id": "2b7e1c9d-3a4f-4e5b-8d6c-0f1e2a3b4c5d",
            "status": "copying",
            "stage": "Copying the files",
            "progress": 42,
            "source": {
              "id": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
              "name": "Shop",
              "serverName": "Production"
            },
            "target": {
              "id": "6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
              "name": "Shop copy",
              "serverName": "Production"
            },
            "crossServer": false,
            "options": {
              "resources": true,
              "firewall": true,
              "cron": true,
              "noindex": true
            },
            "lastError": null,
            "notes": [],
            "health": null,
            "skipped": [],
            "skippedCount": 0,
            "sizes": null,
            "cancellable": true,
            "createdAt": "2026-11-18T15:40:12.000Z",
            "startedAt": "2026-11-18T15:41:02.000Z",
            "finishedAt": null
          }
        ]
      },
      "SiteCreateInput": {
        "type": "object",
        "properties": {
          "serverId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The server to install the site on. It must be running or being set up."
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9 ._-]*$",
            "description": "The site's name: 2 to 48 letters, numbers, spaces, dots, dashes or underscores, starting with a letter or number."
          },
          "siteTitle": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The site's title in WordPress (up to 120 characters). It can be changed in WordPress later."
          },
          "adminUsername": {
            "type": "string",
            "pattern": "^[a-z0-9._-]{3,32}$",
            "description": "The WordPress administrator's username: 3 to 32 lowercase letters, numbers, dots, dashes or underscores. Not `admin` or `administrator`."
          },
          "adminEmail": {
            "description": "The WordPress administrator's email address.",
            "type": "string",
            "maxLength": 254
          },
          "resources": {
            "description": "What the site may use of its server. Left out: no limits of its own.",
            "$ref": "#/components/schemas/SiteResourcesInput"
          }
        },
        "required": [
          "serverId",
          "name",
          "siteTitle",
          "adminUsername",
          "adminEmail"
        ],
        "additionalProperties": false,
        "description": "A new WordPress site on one of your servers.",
        "examples": [
          {
            "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
            "name": "Shop",
            "siteTitle": "Example Shop",
            "adminUsername": "editor",
            "adminEmail": "you@example.com"
          }
        ]
      },
      "SiteDomain": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The domain's id."
          },
          "siteId": {
            "type": "string",
            "description": "The site it's connected to."
          },
          "serverId": {
            "type": "string",
            "description": "The site's server."
          },
          "hostname": {
            "type": "string",
            "description": "The domain, like shop.example.com."
          },
          "isPrimary": {
            "type": "boolean",
            "description": "Whether the site is served on this domain (the others redirect to it)."
          },
          "isBuiltIn": {
            "type": "boolean",
            "description": "The address every site gets. It can't be removed."
          },
          "primaryOnVerify": {
            "type": "boolean",
            "description": "Still waiting for DNS, and becomes the primary domain once its DNS is verified."
          },
          "status": {
            "type": "string",
            "description": "`pending_dns`: waiting for its DNS to point at the server. `provisioning`: DNS is verified and the domain is being set up with its certificate. `active`: in use. `failed`: see `lastError`.",
            "x-known-values": [
              "pending_dns",
              "provisioning",
              "active",
              "failed"
            ]
          },
          "sslStatus": {
            "type": "string",
            "description": "The domain's SSL certificate: `none`, `pending`, `active` or `failed`.",
            "x-known-values": [
              "none",
              "pending",
              "active",
              "failed"
            ]
          },
          "dnsTarget": {
            "anyOf": [
              {
                "type": "string",
                "description": "An IPv4 address."
              },
              {
                "type": "null"
              }
            ],
            "description": "Point the domain's A record at this address (the server's IPv4). Null until the server has one."
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the last DNS check or setup failed. Null otherwise."
          },
          "verifiedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When its DNS was verified. Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When its DNS was verified. Null until then."
          },
          "createdAt": {
            "type": "string",
            "description": "When the domain was added.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "siteId",
          "serverId",
          "hostname",
          "isPrimary",
          "isBuiltIn",
          "primaryOnVerify",
          "status",
          "sslStatus",
          "dnsTarget",
          "lastError",
          "verifiedAt",
          "createdAt"
        ],
        "description": "A domain connected to a site: its DNS and certificate status.",
        "examples": [
          {
            "id": "c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f",
            "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
            "hostname": "shop.example.com",
            "isPrimary": true,
            "isBuiltIn": false,
            "primaryOnVerify": false,
            "status": "active",
            "sslStatus": "active",
            "dnsTarget": "203.0.113.10",
            "lastError": null,
            "verifiedAt": "2026-11-18T09:20:44.000Z",
            "createdAt": "2026-11-18T09:18:03.000Z"
          }
        ]
      },
      "SiteDomainAddInput": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(?=.{4,253}$)(?:(?!-)[a-z0-9-]{1,63}(?<!-)\\.)+[a-z]{2,63}$",
            "description": "The domain to connect, like shop.example.com or www.example.com (no https:// or path)."
          },
          "makePrimary": {
            "description": "Make it the site's primary domain: at once if its DNS already points at the server, otherwise as soon as its DNS is verified. Default false.",
            "type": "boolean"
          }
        },
        "required": [
          "hostname"
        ],
        "additionalProperties": false,
        "description": "A domain to connect to a site.",
        "examples": [
          {
            "hostname": "shop.example.com",
            "makePrimary": true
          }
        ]
      },
      "SiteFirewall": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "description": "`protect`: attacks are blocked before WordPress sees them (new sites start so). `monitor`: every request is checked and attacks are logged, but nothing is blocked. `off`: requests reach WordPress unchecked (blocked addresses are still refused).",
            "x-known-values": [
              "off",
              "monitor",
              "protect"
            ]
          },
          "sensitivity": {
            "type": "string",
            "description": "`standard` (recommended): stops known attacks with very few false alarms. `strict`: catches subtler attacks too, but may flag some plugins (add exceptions if it does).",
            "x-known-values": [
              "standard",
              "strict"
            ]
          },
          "loginProtection": {
            "type": "boolean",
            "description": "Whether repeated sign-ins from one address are slowed down (after a few quick tries, one every 6 seconds), so password-guessing bots can't hammer wp-login.php. It works while the firewall is on."
          },
          "status": {
            "type": "string",
            "description": "Whether the settings are in place on the site's server: `off`, `installing` (the firewall is being set up on the server first, a few minutes), `applying` (the latest settings are on their way, usually seconds), `active`, or `failed` (see `lastError`; apply them again with `POST /sites/{siteId}/firewall/actions/apply`).",
            "x-known-values": [
              "off",
              "installing",
              "applying",
              "active",
              "failed"
            ]
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the settings couldn't be put in place (with `status: \"failed\"`). Null otherwise."
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the settings or rules last changed.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the settings or rules last changed. Null when they never did."
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FirewallRule"
            },
            "description": "The site's allowed addresses (up to 100), blocked addresses (up to 500) and exceptions (up to 30), oldest first."
          }
        },
        "required": [
          "mode",
          "sensitivity",
          "loginProtection",
          "status",
          "lastError",
          "updatedAt",
          "rules"
        ],
        "description": "A site's web application firewall: it checks every request before WordPress runs it and stops SQL injection, cross-site scripting, file and code injection, known exploits and hacking tools. Included on every plan.",
        "examples": [
          {
            "mode": "protect",
            "sensitivity": "standard",
            "loginProtection": true,
            "status": "active",
            "lastError": null,
            "updatedAt": "2026-11-18T09:31:17.000Z",
            "rules": [
              {
                "id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
                "kind": "block",
                "address": "198.51.100.0/24",
                "ruleIds": [],
                "path": null,
                "note": "Login attempts from a scanner",
                "createdAt": "2026-11-18T09:20:03.000Z"
              },
              {
                "id": "f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c",
                "kind": "exception",
                "address": null,
                "ruleIds": [
                  942270,
                  942360
                ],
                "path": "/wp-admin/admin-ajax.php",
                "note": "Page builder saves",
                "createdAt": "2026-11-18T09:31:17.000Z"
              }
            ]
          }
        ]
      },
      "SiteMalwareProtection": {
        "type": "object",
        "properties": {
          "serverId": {
            "type": "string",
            "description": "The site's server."
          },
          "available": {
            "type": "boolean",
            "description": "Whether the site can have malware protection: a live site (not a staging copy) on a server that can run Imunify360."
          },
          "unavailableReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it can't (with `available: false`). Null otherwise."
          },
          "serverSecurityStatus": {
            "type": "string",
            "description": "Imunify360 on the site's server (malware protection needs it `on`): `off`, `installing` (a few minutes; then `server.security_enabled`), `on`, `failed` (see `lastError`; turn it on again to retry), or `removing` (being turned off).",
            "x-known-values": [
              "off",
              "installing",
              "on",
              "failed",
              "removing"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether malware protection is on for the site."
          },
          "included": {
            "type": "boolean",
            "description": "The site that comes with the server at no charge: the first to have it on."
          },
          "priceCents": {
            "type": "integer",
            "description": "What the site's malware protection costs a month, in US cents: 0 while the site is the included one (or would be, turned on now, with no other site on), else 299. Billed after each month, by the days it was on."
          },
          "currency": {
            "type": "string",
            "const": "usd",
            "description": "Always `usd`: amounts are in US cents."
          },
          "sitesEnabledOnServer": {
            "type": "integer",
            "description": "How many of the server's sites have it on (this one too, when it has)."
          },
          "checkedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the server last reported its figures. Null while Imunify360 isn't on.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the server last reported its figures. Null while Imunify360 isn't on."
          },
          "refreshing": {
            "type": "boolean",
            "description": "Newer figures are being fetched from the server: read again in a few seconds."
          },
          "realtime": {
            "type": "boolean",
            "description": "Whether the server scans each file written at once (`settings.realtime` of the server's security)."
          },
          "keepCopiesDays": {
            "type": "integer",
            "description": "Days a copy of each cleaned file is kept, so a clean-up can be undone (the server's setting)."
          },
          "alerts": {
            "type": "boolean",
            "description": "Whether the account's owner is emailed about this site (threats, clean-ups, blacklists, security holes)."
          },
          "scans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "description": "`nightly` (the schedule's), `manual` (asked for: `…/actions/scan`) or `realtime`.",
                  "x-known-values": [
                    "nightly",
                    "manual",
                    "realtime"
                  ]
                },
                "status": {
                  "type": "string",
                  "description": "`running`, `done` or `failed`.",
                  "x-known-values": [
                    "running",
                    "done",
                    "failed"
                  ]
                },
                "startedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "When it started. Null when not known.",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it started. Null when not known."
                },
                "finishedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "When it finished. Null while it runs.",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it finished. Null while it runs."
                },
                "files": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "description": "A count."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Files it checked. Null when not known."
                },
                "found": {
                  "type": "integer",
                  "description": "Threats it found."
                }
              },
              "required": [
                "kind",
                "status",
                "startedAt",
                "finishedAt",
                "files",
                "found"
              ],
              "description": "A malware scan."
            },
            "description": "Recent scans of the site, newest first."
          },
          "ignoredPaths": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The entry's id (digits): `DELETE /sites/{siteId}/malware-protection/ignored-paths/{ignoredPathId}` removes it."
                },
                "path": {
                  "type": "string",
                  "description": "The file or folder, inside the site's folder, as it was added."
                },
                "addedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "When it was added. Null when not known.",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it was added. Null when not known."
                }
              },
              "required": [
                "id",
                "path",
                "addedAt"
              ],
              "description": "A file or folder scans skip."
            },
            "description": "Files and folders scans skip."
          },
          "vulnerabilities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Its id."
                },
                "kind": {
                  "type": "string",
                  "description": "A `plugin`, a `theme`, WordPress itself (`core`), or `other` files.",
                  "x-known-values": [
                    "plugin",
                    "theme",
                    "core",
                    "other"
                  ]
                },
                "folder": {
                  "type": "string",
                  "description": "Its folder, like contact-form-7; `wordpress` for WordPress itself; empty for other files."
                },
                "name": {
                  "type": "string",
                  "description": "Its name, like Contact Form 7."
                },
                "version": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A version."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The version installed. Null when it doesn't say."
                },
                "status": {
                  "type": "string",
                  "description": "`vulnerable` (update it) or `patched` (Imunify360 patched the holes).",
                  "x-known-values": [
                    "vulnerable",
                    "patched"
                  ]
                },
                "files": {
                  "type": "integer",
                  "description": "How many of its files carry the holes."
                },
                "holes": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "cve": {
                        "anyOf": [
                          {
                            "type": "string",
                            "description": "A CVE id."
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "The hole's CVE id. Null when it has none."
                      },
                      "type": {
                        "type": "string",
                        "description": "The kind of hole, like Upload or XSS."
                      },
                      "description": {
                        "type": "string",
                        "description": "What it lets an attacker do."
                      }
                    },
                    "required": [
                      "cve",
                      "type",
                      "description"
                    ],
                    "description": "A known security hole."
                  },
                  "description": "Its known holes."
                }
              },
              "required": [
                "id",
                "kind",
                "folder",
                "name",
                "version",
                "status",
                "files",
                "holes"
              ],
              "description": "A plugin, theme or WordPress install with known security holes."
            },
            "description": "What the site has installed with known security holes."
          },
          "wordpressPlugin": {
            "type": "object",
            "properties": {
              "serverEnabled": {
                "type": "boolean",
                "description": "Whether Imunify360's WordPress plugin is on for the server (`servers.security.wordpressPlugin.enable`)."
              },
              "status": {
                "description": "The plugin in this site: `on`, `adding` (about a minute), `failed` (WordPress there didn't work) or `off` (taken off). Null while it's off for the server, or the site's malware protection is off.",
                "x-known-values": [
                  "on",
                  "adding",
                  "failed",
                  "off"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "firewall": {
                "anyOf": [
                  {
                    "type": "boolean",
                    "description": "On or off."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The plugin's firewall in the site. Null as for `status`."
              },
              "aiBotProtection": {
                "anyOf": [
                  {
                    "type": "boolean",
                    "description": "On or off."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "AI bot protection in the site. Null as for `status`."
              },
              "preset": {
                "description": "How strict AI bot protection is: `balanced`, `strict` or `monitor`. Null as for `status`.",
                "x-known-values": [
                  "balanced",
                  "strict",
                  "monitor"
                ],
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "serverEnabled",
              "status",
              "firewall",
              "aiBotProtection",
              "preset"
            ],
            "description": "Imunify360's WordPress plugin (Imunify Security) in this site."
          },
          "incidents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecurityIncident"
            },
            "description": "Attacks on this site in the last 24 hours (at most 500), newest first. Not paged: an incident's id isn't kept from one look to the next."
          },
          "disabledRules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ruleId": {
                  "type": "string",
                  "description": "The rule: a web application firewall rule's number, or a WordPress plugin rule's name (like RULE-CVE-2024-1234-01)."
                },
                "name": {
                  "type": "string",
                  "description": "What it's for: the note it was turned off with (your own words), or the attack it stops."
                },
                "source": {
                  "type": "string",
                  "description": "`waf`: a rule of the web application firewall. `wordpress`: a rule of Imunify360's WordPress plugin.",
                  "x-known-values": [
                    "waf",
                    "wordpress"
                  ]
                },
                "siteIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "A site's id."
                  },
                  "description": "The sites it's off for. Empty: the whole server."
                },
                "domains": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "A domain."
                  },
                  "description": "Those sites' domains, as the rule names them. Empty: the whole server."
                }
              },
              "required": [
                "ruleId",
                "name",
                "source",
                "siteIds",
                "domains"
              ],
              "description": "A rule turned off for false alarms."
            },
            "description": "Rules turned off for this site, or for the whole server (`servers.security.rules.disable`)."
          }
        },
        "required": [
          "serverId",
          "available",
          "unavailableReason",
          "serverSecurityStatus",
          "enabled",
          "included",
          "priceCents",
          "currency",
          "sitesEnabledOnServer",
          "checkedAt",
          "refreshing",
          "realtime",
          "keepCopiesDays",
          "alerts",
          "scans",
          "ignoredPaths",
          "vulnerabilities",
          "wordpressPlugin",
          "incidents",
          "disabledRules"
        ],
        "description": "A site's malware protection: Imunify360 scans the site, cleans what it finds (each clean-up can be undone) and watches what it has installed for known security holes. The server's first site to have it on is included; each other site is $2.99 a month.",
        "examples": [
          {
            "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
            "available": true,
            "unavailableReason": null,
            "serverSecurityStatus": "on",
            "enabled": true,
            "included": true,
            "priceCents": 0,
            "currency": "usd",
            "sitesEnabledOnServer": 1,
            "checkedAt": "2026-11-25T09:14:02.000Z",
            "refreshing": false,
            "realtime": true,
            "keepCopiesDays": 14,
            "alerts": true,
            "scans": [
              {
                "kind": "nightly",
                "status": "done",
                "startedAt": "2026-11-25T03:00:12.000Z",
                "finishedAt": "2026-11-25T03:02:40.000Z",
                "files": 4334,
                "found": 1
              }
            ],
            "ignoredPaths": [
              {
                "id": "3",
                "path": "wp-content/plugins/my-backup-tool/restore.php",
                "addedAt": "2026-11-24T16:20:00.000Z"
              }
            ],
            "vulnerabilities": [
              {
                "id": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d:plugin:contact-form-7",
                "kind": "plugin",
                "folder": "contact-form-7",
                "name": "Contact Form 7",
                "version": "5.3.1",
                "status": "vulnerable",
                "files": 2,
                "holes": [
                  {
                    "cve": "CVE-2020-35489",
                    "type": "Upload",
                    "description": "Unrestricted file upload vulnerability"
                  }
                ]
              }
            ],
            "wordpressPlugin": {
              "serverEnabled": true,
              "status": "on",
              "firewall": true,
              "aiBotProtection": true,
              "preset": "balanced"
            },
            "incidents": [
              {
                "id": "1",
                "occurredAt": "2026-11-25T09:10:02.000Z",
                "ip": "45.146.165.10",
                "country": "DE",
                "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                "domain": "shop.example.com",
                "kind": "waf",
                "description": "Information disclosure attempt via WordPress plugins",
                "ruleId": "77350218",
                "severity": "high",
                "action": "challenged",
                "times": 12,
                "wordpress": null
              }
            ],
            "disabledRules": [
              {
                "ruleId": "77350218",
                "name": "Turned off for the shop's page builder",
                "source": "waf",
                "siteIds": [
                  "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                ],
                "domains": [
                  "shop.example.com"
                ]
              }
            ]
          }
        ]
      },
      "SiteMediaOffload": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`off`, `setting_up` (being turned on: storage readied, the server set up, the first full copy made), `active`, `turning_off` (every file is on the server again; storage is let go) or `failed` (setting up didn't finish: see `lastError`, then retry or cancel the setup).",
            "x-known-values": [
              "off",
              "setting_up",
              "active",
              "turning_off",
              "failed"
            ]
          },
          "blockedReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the site can't have Media Offload right now: a server of your own or a trial server, a staging copy, a site still installing, a stopped server, and the like. Null when it can."
          },
          "settings": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "description": "`copy`: files stay on the server and are copied to storage. `free` (free up disk): once storage holds them, files older than `freeAfterDays` are removed from the server and served from storage.",
                "x-known-values": [
                  "copy",
                  "free"
                ]
              },
              "freeAfterDays": {
                "type": "integer",
                "description": "In free up disk mode, how many days new files stay on the server before their copy there is removed (image plugins finish their work first): 1, 3, 7, 14, 30, 90."
              },
              "kinds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "A kind of file: `image` (Images: JPEG, PNG, WebP, AVIF, GIF, SVG), `video` (Video: MP4, MOV, WebM), `audio` (Audio: MP3, M4A, WAV, OGG), `document` (Documents: PDF, Word, Excel, PowerPoint, text), `archive` (Archives: ZIP, RAR, 7z, tar), `font` (Fonts: WOFF2, WOFF, TTF, OTF), `other` (Everything else: Any other file plugins keep there (CSS, JSON, logs…)).",
                  "x-known-values": [
                    "image",
                    "video",
                    "audio",
                    "document",
                    "archive",
                    "font",
                    "other"
                  ]
                },
                "description": "The kinds of files kept in storage."
              },
              "keep": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "A folder in the uploads folder, like `2019/archive`."
                },
                "description": "Folders of the uploads folder kept on the server, besides the ones always kept there (private downloads and form uploads, backups and logs, files plugins rebuild, code)."
              }
            },
            "required": [
              "mode",
              "freeAfterDays",
              "kinds",
              "keep"
            ],
            "description": "The site's Media Offload settings."
          },
          "settingsStatus": {
            "type": "string",
            "description": "Whether the settings are in place on the site's server: `applied`, `applying` (usually within a minute) or `failed` (see `lastError`; save them again).",
            "x-known-values": [
              "applied",
              "applying",
              "failed"
            ]
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why setting it up, applying the settings or turning it off didn't finish. Null when nothing failed."
          },
          "pausedReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why new files aren't copied to storage right now (an unpaid Media Offload bill). Everything already in storage keeps being served. Null otherwise."
          },
          "enabledAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it was turned on. Null while it's off.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was turned on. Null while it's off."
          },
          "stored": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "integer",
                    "description": "Files in storage."
                  },
                  "bytes": {
                    "type": "integer",
                    "description": "Their size, in bytes (decimal: 1 GB is 1,000,000,000 bytes)."
                  },
                  "freedFiles": {
                    "type": "integer",
                    "description": "Of those, files removed from the server to free up disk: storage holds the only copy."
                  },
                  "freedBytes": {
                    "type": "integer",
                    "description": "Their size, in bytes."
                  }
                },
                "required": [
                  "files",
                  "bytes",
                  "freedFiles",
                  "freedBytes"
                ],
                "description": "What storage holds."
              },
              {
                "type": "null"
              }
            ],
            "description": "What storage holds for the site, as its server last reported. Null while it's off, or before the server first reported."
          },
          "kinds": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "description": "A kind of file: `image` (Images: JPEG, PNG, WebP, AVIF, GIF, SVG), `video` (Video: MP4, MOV, WebM), `audio` (Audio: MP3, M4A, WAV, OGG), `document` (Documents: PDF, Word, Excel, PowerPoint, text), `archive` (Archives: ZIP, RAR, 7z, tar), `font` (Fonts: WOFF2, WOFF, TTF, OTF), `other` (Everything else: Any other file plugins keep there (CSS, JSON, logs…)).",
                  "x-known-values": [
                    "image",
                    "video",
                    "audio",
                    "document",
                    "archive",
                    "font",
                    "other"
                  ]
                },
                "files": {
                  "type": "integer",
                  "description": "Files of this kind in storage."
                },
                "bytes": {
                  "type": "integer",
                  "description": "Their size, in bytes."
                },
                "freedFiles": {
                  "type": "integer",
                  "description": "Of those, files removed from the server to free up disk."
                },
                "freedBytes": {
                  "type": "integer",
                  "description": "Their size, in bytes."
                }
              },
              "required": [
                "kind",
                "files",
                "bytes",
                "freedFiles",
                "freedBytes"
              ],
              "description": "What storage holds of one kind of file."
            },
            "description": "What storage holds, by kind of file. Empty while it's off."
          },
          "pending": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "integer",
                    "description": "Files."
                  },
                  "bytes": {
                    "type": "integer",
                    "description": "Their size, in bytes."
                  }
                },
                "required": [
                  "files",
                  "bytes"
                ],
                "description": "Files waiting to be copied."
              },
              {
                "type": "null"
              }
            ],
            "description": "Files waiting to be copied to storage. Null while it's off, or before the server first reported."
          },
          "keptOnServer": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "reason": {
                  "type": "string",
                  "description": "Why they stay: `folder` (a folder always kept, or one in `keep`), `kind` (a kind of file not chosen), `code` (code files), `hidden` (hidden files), `name` (a path too long for storage), `owner` (files that don't belong to the site's own user).",
                  "x-known-values": [
                    "folder",
                    "kind",
                    "code",
                    "hidden",
                    "name",
                    "owner"
                  ]
                },
                "files": {
                  "type": "integer",
                  "description": "Files."
                },
                "bytes": {
                  "type": "integer",
                  "description": "Their size, in bytes."
                }
              },
              "required": [
                "reason",
                "files",
                "bytes"
              ],
              "description": "Files kept on the server for one reason."
            },
            "description": "Files of the uploads folder that stay on the server, by reason."
          },
          "delivery": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "ok": {
                    "type": "boolean",
                    "description": "Whether the last check passed: a test file was fetched from storage through the site."
                  },
                  "checkedAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "When it was last checked. Null before the first check.",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "When it was last checked. Null before the first check."
                  },
                  "error": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A sentence."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Why the last check didn't pass. Null when it passed."
                  }
                },
                "required": [
                  "ok",
                  "checkedAt",
                  "error"
                ],
                "description": "The delivery check."
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the site serves files from storage: checked every 10 minutes, and files stay on the server until it passes. Null while it's off, or before the first check."
          },
          "lastSyncAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When files were last copied to storage. Null before the first copy.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When files were last copied to storage. Null before the first copy."
          },
          "lastVerify": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "verifiedAt": {
                    "type": "string",
                    "description": "When every file was last checked.",
                    "format": "date-time"
                  },
                  "repaired": {
                    "type": "integer",
                    "description": "Files repaired in storage."
                  },
                  "lost": {
                    "type": "integer",
                    "description": "Files missing from storage that the server no longer has either."
                  }
                },
                "required": [
                  "verifiedAt",
                  "repaired",
                  "lost"
                ],
                "description": "The last check of every file."
              },
              {
                "type": "null"
              }
            ],
            "description": "The last check of every file in storage (a `verify` run). Null before the first."
          },
          "fetchedFromStorage": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "month": {
                    "type": "string",
                    "description": "The month, like `2026-11`."
                  },
                  "bytes": {
                    "type": "integer",
                    "description": "Bytes fetched."
                  },
                  "requests": {
                    "type": "integer",
                    "description": "Files fetched."
                  }
                },
                "required": [
                  "month",
                  "bytes",
                  "requests"
                ],
                "description": "This month's fetches."
              },
              {
                "type": "null"
              }
            ],
            "description": "What visitors fetched from storage this month: files that weren't on the server. Null while it's off."
          },
          "popularFiles": {
            "type": "integer",
            "description": "Files visitors fetch often, brought back to the server for 30 days so they're delivered faster."
          },
          "freeingPaused": {
            "type": "boolean",
            "description": "This month visitors fetched more than twice what the site stores, so no more files are removed from the server for now (free up disk). Nothing else changes."
          },
          "failedFiles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "The file, in the uploads folder."
                },
                "failedAt": {
                  "type": "string",
                  "description": "When it last failed.",
                  "format": "date-time"
                }
              },
              "required": [
                "path",
                "failedAt"
              ],
              "description": "A file that couldn't be copied or checked."
            },
            "description": "Up to 10 files that couldn't be copied to storage or checked there. They're tried again by themselves and stay on the server meanwhile."
          },
          "conflictingPlugins": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A plugin's name."
            },
            "description": "Other media offload plugins active on the site. Media Offload pauses while one is: deactivate it in WordPress."
          },
          "run": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MediaOffloadRun"
              },
              {
                "type": "null"
              }
            ],
            "description": "The operation running now, or one that finished in the last minute. Null otherwise."
          },
          "recentRuns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaOffloadRun"
            },
            "description": "Up to 5 earlier operations, newest first."
          },
          "export": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "runId": {
                    "type": "string",
                    "description": "The `export` run that prepares it."
                  },
                  "status": {
                    "type": "string",
                    "description": "`queued`, `running` or `done`.",
                    "x-known-values": [
                      "queued",
                      "running",
                      "done",
                      "failed",
                      "cancelled"
                    ]
                  },
                  "files": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Files."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Files in it. Null until it's ready."
                  },
                  "bytes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Bytes."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Its size, in bytes. Null until it's ready."
                  },
                  "expiresAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "When the download is removed. Null until it's ready.",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "When the download is removed. Null until it's ready."
                  },
                  "createdAt": {
                    "type": "string",
                    "description": "When it was asked for.",
                    "format": "date-time"
                  }
                },
                "required": [
                  "runId",
                  "status",
                  "files",
                  "bytes",
                  "expiresAt",
                  "createdAt"
                ],
                "description": "The download of the whole media library."
              },
              {
                "type": "null"
              }
            ],
            "description": "The download of the whole media library (an `export` run), while it's being prepared or ready. It's downloaded from the panel's Offload tab: its link is a secret, never given by the API. Null otherwise."
          },
          "allowance": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "includedBytes": {
                    "type": "integer",
                    "description": "Storage included with the server, shared by its sites (decimal: 1 GB is 1,000,000,000 bytes)."
                  },
                  "usedBytes": {
                    "type": "integer",
                    "description": "Storage the server's sites use now."
                  },
                  "sites": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "siteId": {
                          "type": "string",
                          "description": "The site's id."
                        },
                        "name": {
                          "type": "string",
                          "description": "The site's name."
                        },
                        "bytes": {
                          "type": "integer",
                          "description": "Storage it uses."
                        }
                      },
                      "required": [
                        "siteId",
                        "name",
                        "bytes"
                      ],
                      "description": "A site using Media Offload."
                    },
                    "description": "The sites using it, largest first."
                  },
                  "extraCentsPerGbMonth": {
                    "type": "number",
                    "description": "The price of each GB stored beyond what's included, per month, in US cents (it can have decimals). Billed after the month ends."
                  },
                  "monthToDateCents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Extra storage this month so far, before it's billed, in US cents."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Extra storage this month so far, before it's billed, in US cents. Null for a token without `billing:read`."
                  },
                  "currency": {
                    "type": "string",
                    "const": "usd",
                    "description": "Always `usd`: amounts are in US cents."
                  }
                },
                "required": [
                  "includedBytes",
                  "usedBytes",
                  "sites",
                  "extraCentsPerGbMonth",
                  "monthToDateCents",
                  "currency"
                ],
                "description": "The server's included storage and who uses it."
              },
              {
                "type": "null"
              }
            ],
            "description": "The storage included with the site's server, shared by its sites, and what uses it. Storage beyond it is billed by use after each month ends. Null on servers of your own."
          },
          "reportedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the site's server last reported its figures. Null before it first did.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the site's server last reported its figures. Null before it first did."
          }
        },
        "required": [
          "status",
          "blockedReason",
          "settings",
          "settingsStatus",
          "lastError",
          "pausedReason",
          "enabledAt",
          "stored",
          "kinds",
          "pending",
          "keptOnServer",
          "delivery",
          "lastSyncAt",
          "lastVerify",
          "fetchedFromStorage",
          "popularFiles",
          "freeingPaused",
          "failedFiles",
          "conflictingPlugins",
          "run",
          "recentRuns",
          "export",
          "allowance",
          "reportedAt"
        ],
        "description": "Media Offload on a site: its media library kept in Rabbitflare's cloud storage, every file at the same address as before, with the settings, what storage holds, the operations running, and the storage included with the server.",
        "examples": [
          {
            "status": "active",
            "blockedReason": null,
            "settings": {
              "mode": "copy",
              "freeAfterDays": 7,
              "kinds": [
                "image",
                "video",
                "audio",
                "document",
                "archive",
                "font"
              ],
              "keep": []
            },
            "settingsStatus": "applied",
            "lastError": null,
            "pausedReason": null,
            "enabledAt": "2026-11-02T09:14:31.000Z",
            "stored": {
              "files": 18412,
              "bytes": 12480000000,
              "freedFiles": 0,
              "freedBytes": 0
            },
            "kinds": [
              {
                "kind": "image",
                "files": 18120,
                "bytes": 9870000000,
                "freedFiles": 0,
                "freedBytes": 0
              },
              {
                "kind": "video",
                "files": 12,
                "bytes": 2410000000,
                "freedFiles": 0,
                "freedBytes": 0
              },
              {
                "kind": "document",
                "files": 280,
                "bytes": 200000000,
                "freedFiles": 0,
                "freedBytes": 0
              }
            ],
            "pending": {
              "files": 0,
              "bytes": 0
            },
            "keptOnServer": [
              {
                "reason": "folder",
                "files": 310,
                "bytes": 41000000
              },
              {
                "reason": "code",
                "files": 4,
                "bytes": 12000
              }
            ],
            "delivery": {
              "ok": true,
              "checkedAt": "2026-11-19T10:00:12.000Z",
              "error": null
            },
            "lastSyncAt": "2026-11-19T10:02:40.000Z",
            "lastVerify": {
              "verifiedAt": "2026-11-16T03:04:41.000Z",
              "repaired": 0,
              "lost": 0
            },
            "fetchedFromStorage": {
              "month": "2026-11",
              "bytes": 1240000000,
              "requests": 5210
            },
            "popularFiles": 0,
            "freeingPaused": false,
            "failedFiles": [],
            "conflictingPlugins": [],
            "run": null,
            "recentRuns": [
              {
                "id": "c4d5e6f7-8a9b-4c0d-9e1f-2a3b4c5d6e7f",
                "operation": "verify",
                "status": "done",
                "stage": null,
                "filesDone": 18412,
                "filesTotal": 18412,
                "filesFailed": 0,
                "bytesDone": 12480000000,
                "bytesTotal": 12480000000,
                "bytesPerSecond": null,
                "filesPerSecond": null,
                "etaSeconds": null,
                "error": null,
                "turnOffAfter": false,
                "startedAt": "2026-11-16T03:00:05.000Z",
                "finishedAt": "2026-11-16T03:04:41.000Z",
                "createdAt": "2026-11-16T03:00:01.000Z"
              }
            ],
            "export": null,
            "allowance": {
              "includedBytes": 100000000000,
              "usedBytes": 12480000000,
              "sites": [
                {
                  "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                  "name": "Shop",
                  "bytes": 12480000000
                }
              ],
              "extraCentsPerGbMonth": 2.085,
              "monthToDateCents": 0,
              "currency": "usd"
            },
            "reportedAt": "2026-11-19T10:02:40.000Z"
          }
        ]
      },
      "SiteProtection": {
        "type": "object",
        "properties": {
          "on": {
            "type": "boolean",
            "description": "Whether Cloudflare protection is switched on for the site."
          },
          "status": {
            "type": "string",
            "description": "`off`, `applying` (being turned on or off: adding the site's domains to Cloudflare, or taking them out, which can take up to 15 minutes), `active`, or `failed` (see `error`; switch it on or off again to retry).",
            "x-known-values": [
              "off",
              "applying",
              "active",
              "failed"
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why turning it on or off failed (with `status: \"failed\"`). Null otherwise."
          },
          "edge": {
            "anyOf": [
              {
                "type": "string",
                "description": "A hostname."
              },
              {
                "type": "null"
              }
            ],
            "description": "The site's own name at Cloudflare, like shop-x7k2p.rabbitflare.net: each domain goes through Cloudflare once its DNS points here. Null when the site can't be protected (contact support)."
          },
          "needs": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "What the site needs before protection can go on (a domain of your own as its primary domain). Null when nothing, and while it's on."
          },
          "domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProtectionDomain"
            },
            "description": "The site's own domains, while protection is on (its built-in address isn't listed). Empty while it's off."
          },
          "locked": {
            "type": "boolean",
            "description": "Whether the site's server already refuses visitors who skip Cloudflare on its protected domains (an hour after a domain starts coming through Cloudflare)."
          },
          "stillPointed": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A domain."
            },
            "description": "While it's off: domains whose DNS still points at the site's name at Cloudflare. They keep working (that name now leads straight to the server); point them back at the server when you like."
          },
          "connectFor": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A domain."
            },
            "description": "While it's on: domains whose DNS is in a Cloudflare account that isn't connected to Rabbitflare. Connect that account in the panel and Rabbitflare switches them for you; otherwise set their `record` yourself."
          }
        },
        "required": [
          "on",
          "status",
          "error",
          "edge",
          "needs",
          "domains",
          "locked",
          "stillPointed",
          "connectFor"
        ],
        "description": "A site's Cloudflare protection: its visitors reach it through Cloudflare first, which stops DDoS attacks, applies its managed rules and browser check, and keeps out the addresses on Rabbitflare's blocklist. The site's own firewall still checks everything that gets through. No Cloudflare account of your own is needed.",
        "examples": [
          {
            "on": true,
            "status": "active",
            "error": null,
            "edge": "shop-x7k2p.rabbitflare.net",
            "needs": null,
            "domains": [
              {
                "domainId": "c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f",
                "hostname": "shop.example.com",
                "status": "ready",
                "detail": "Its certificate is ready. Change the record now.",
                "record": {
                  "type": "CNAME",
                  "name": "shop.example.com",
                  "value": "shop-x7k2p.rabbitflare.net"
                },
                "dnsBy": "you",
                "dnsCompany": {
                  "id": "godaddy",
                  "name": "GoDaddy",
                  "root": "none"
                }
              }
            ],
            "locked": false,
            "stillPointed": [],
            "connectFor": []
          }
        ]
      },
      "SiteRabbitPress": {
        "type": "object",
        "properties": {
          "installed": {
            "type": "boolean",
            "description": "Whether the plugin is installed on the site, as the site's server reports it. False too while the server is off or doesn't answer."
          },
          "version": {
            "anyOf": [
              {
                "type": "string",
                "description": "A version, like `2.0.10`."
              },
              {
                "type": "null"
              }
            ],
            "description": "The installed version. Null when the plugin isn't installed (or the server didn't say)."
          },
          "latestVersion": {
            "anyOf": [
              {
                "type": "string",
                "description": "A version, like `2.0.10`."
              },
              {
                "type": "null"
              }
            ],
            "description": "The newest version Rabbitflare installs: installing again on a site with an older version updates it. Null when none can be installed right now."
          },
          "serving": {
            "type": "boolean",
            "description": "Whether the web server sends the site's cached pages itself, without PHP: the fastest way."
          },
          "notServingReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the web server doesn't send the site's cached pages itself (PHP serves them instead, or the plugin isn't caching yet). Null while it does, or when the server didn't say."
          },
          "busy": {
            "type": "boolean",
            "description": "An install, update or removal is running: usually done within a minute or two."
          },
          "licenseRequired": {
            "type": "boolean",
            "description": "Whether the site needs one of your RabbitPress Cache licences: sites on servers of your own do. On servers Rabbitflare creates it's included, without a licence."
          },
          "licenseId": {
            "anyOf": [
              {
                "type": "string",
                "description": "A licence's id."
              },
              {
                "type": "null"
              }
            ],
            "description": "The licence the site uses, on a server of your own. Null on servers Rabbitflare creates, or before a licence was chosen for the site."
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the last install, update or removal didn't finish. Null when it did."
          },
          "blockedReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why RabbitPress Cache can't be installed, updated or removed on this site right now: a staging copy, a site still installing, or a server that isn't running. Null when it can."
          }
        },
        "required": [
          "installed",
          "version",
          "latestVersion",
          "serving",
          "notServingReason",
          "busy",
          "licenseRequired",
          "licenseId",
          "lastError",
          "blockedReason"
        ],
        "description": "RabbitPress Cache, Rabbitflare's WordPress cache plugin, on a site: whether it's installed and which version, and whether the web server sends the site's cached pages itself.",
        "examples": [
          {
            "installed": true,
            "version": "2.0.10",
            "latestVersion": "2.0.10",
            "serving": true,
            "notServingReason": null,
            "busy": false,
            "licenseRequired": false,
            "licenseId": null,
            "lastError": null,
            "blockedReason": null
          }
        ]
      },
      "SiteResources": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Whether the settings are in place on the site's server: `applied`, `applying` (on their way, usually within a minute) or `failed` (see `lastError`: the site keeps its previous settings).",
            "x-known-values": [
              "applied",
              "applying",
              "failed"
            ]
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the settings couldn't be put in place (with `status: \"failed\"`). Null otherwise."
          },
          "blockedReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the site can't have settings of its own right now: a staging copy (set them on the live site), a site on its server's original one-site setup, a site still installing, or a stopped server. Null when it can."
          },
          "settings": {
            "type": "object",
            "properties": {
              "cpuPercent": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The share of the server's processor the site may use, in percent of all its cores. Null: no limit of its own."
              },
              "memoryMb": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The memory the site may use (its PHP and scheduled tasks), in MB. Null: no limit of its own."
              },
              "processes": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "How many processes the site may run at once. Null: no limit of its own."
              },
              "priority": {
                "type": "string",
                "description": "The site's share of the processor when the server is busy: `low`, `normal` (the default) or `high`.",
                "x-known-values": [
                  "low",
                  "normal",
                  "high"
                ]
              },
              "workers": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "How many PHP workers the site may run (requests served at once). Null: set by the server's memory (`server.autoWorkers`)."
              },
              "phpMemoryMb": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "PHP's memory limit per request, in MB. Null: the server's (256 MB)."
              },
              "timeLimit": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "How long one request may run, in seconds. Null: the server's (120 seconds)."
              },
              "uploadMb": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The largest upload, in MB. Null: the server's (64 MB)."
              },
              "inputVars": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The most form fields one request may send. Null: the server's (5,000)."
              }
            },
            "required": [
              "cpuPercent",
              "memoryMb",
              "processes",
              "priority",
              "workers",
              "phpMemoryMb",
              "timeLimit",
              "uploadMb",
              "inputVars"
            ],
            "description": "The site's settings. A CPU, memory or process limit, or a priority other than `normal`, gives the site a PHP of its own; the PHP settings apply either way."
          },
          "server": {
            "type": "object",
            "properties": {
              "vcpus": {
                "type": "integer",
                "description": "The server's vCPUs."
              },
              "memoryMb": {
                "type": "integer",
                "description": "The server's memory, in MB."
              },
              "maxMemoryMb": {
                "type": "integer",
                "description": "The largest memory limit a site on this server can have, in MB: the server's memory less what the system, database and web server need."
              },
              "autoWorkers": {
                "type": "integer",
                "description": "The PHP workers a site gets on this server when `workers` is null."
              }
            },
            "required": [
              "vcpus",
              "memoryMb",
              "maxMemoryMb",
              "autoWorkers"
            ],
            "description": "What the site's server has, and what follows from it."
          },
          "applied": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "description": "`isolated`: the site runs a PHP of its own, within its limits. `shared`: it runs on the server's shared PHP.",
                    "x-known-values": [
                      "shared",
                      "isolated"
                    ]
                  },
                  "workers": {
                    "type": "integer",
                    "description": "How many PHP workers the site may run."
                  }
                },
                "required": [
                  "mode",
                  "workers"
                ],
                "description": "What the server last reported."
              },
              {
                "type": "null"
              }
            ],
            "description": "How the site runs on its server, as the server last reported. Null before it first did."
          },
          "otherSites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "siteId": {
                  "type": "string",
                  "description": "The site's id."
                },
                "name": {
                  "type": "string",
                  "description": "The site's name."
                },
                "cpuPercent": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its CPU limit, in percent. Null: none."
                },
                "memoryMb": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its memory limit, in MB. Null: none."
                },
                "processes": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its process limit. Null: none."
                },
                "priority": {
                  "type": "string",
                  "description": "Its CPU priority: `low`, `normal` or `high`.",
                  "x-known-values": [
                    "low",
                    "normal",
                    "high"
                  ]
                }
              },
              "required": [
                "siteId",
                "name",
                "cpuPercent",
                "memoryMb",
                "processes",
                "priority"
              ],
              "description": "Another site on the server."
            },
            "description": "The server's other sites with limits or a priority of their own, by name."
          }
        },
        "required": [
          "status",
          "lastError",
          "blockedReason",
          "settings",
          "server",
          "applied",
          "otherSites"
        ],
        "description": "How much of its server a site may use: CPU, memory and process limits, its CPU priority, and its PHP settings, with whether they're in place on the server.",
        "examples": [
          {
            "status": "applied",
            "lastError": null,
            "blockedReason": null,
            "settings": {
              "cpuPercent": 50,
              "memoryMb": 1024,
              "processes": null,
              "priority": "normal",
              "workers": 8,
              "phpMemoryMb": 512,
              "timeLimit": null,
              "uploadMb": 128,
              "inputVars": null
            },
            "server": {
              "vcpus": 2,
              "memoryMb": 4096,
              "maxMemoryMb": 3840,
              "autoWorkers": 24
            },
            "applied": {
              "mode": "isolated",
              "workers": 8
            },
            "otherSites": [
              {
                "siteId": "9b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
                "name": "Blog",
                "cpuPercent": 25,
                "memoryMb": null,
                "processes": null,
                "priority": "low"
              }
            ]
          }
        ]
      },
      "SiteResourcesInput": {
        "type": "object",
        "properties": {
          "cpuPercent": {
            "description": "The share of the server's processor the site may use, in percent of all its cores. 5 to 100%; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 5,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "memoryMb": {
            "description": "The memory the site may use (its PHP and scheduled tasks), in MB. At most the server's memory less 256 MB. 256 to 1,048,576 MB; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 256,
                "maximum": 1048576
              },
              {
                "type": "null"
              }
            ]
          },
          "processes": {
            "description": "How many processes the site may run at once. 32 to 4,096; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 32,
                "maximum": 4096
              },
              {
                "type": "null"
              }
            ]
          },
          "priority": {
            "description": "The site's share of the processor when the server is busy: `low`, `normal` (the default) or `high`.",
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "workers": {
            "description": "How many PHP workers the site may run (requests served at once). Left out: set by the server's memory. 1 to 64; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "phpMemoryMb": {
            "description": "PHP's memory limit per request, in MB. Left out: 256 MB. 64 to 1,024 MB; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 64,
                "maximum": 1024
              },
              {
                "type": "null"
              }
            ]
          },
          "timeLimit": {
            "description": "How long one request may run, in seconds. Left out: 120 seconds. 30 to 300 seconds; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 30,
                "maximum": 300
              },
              {
                "type": "null"
              }
            ]
          },
          "uploadMb": {
            "description": "The largest upload, in MB. Left out: 64 MB. 8 to 512 MB; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 8,
                "maximum": 512
              },
              {
                "type": "null"
              }
            ]
          },
          "inputVars": {
            "description": "The most form fields one request may send. Left out: 5,000. 1,000 to 20,000; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1000,
                "maximum": 20000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "description": "What a new site may use of its server: CPU, memory and process limits, its CPU priority, and its PHP settings. Left out, the site runs as sites always have: no limits of its own, the server's PHP settings. Applied once WordPress is installed.",
        "examples": [
          {
            "memoryMb": 1024,
            "phpMemoryMb": 512,
            "uploadMb": 128
          }
        ]
      },
      "SiteResourcesUpdateInput": {
        "type": "object",
        "properties": {
          "cpuPercent": {
            "description": "The share of the server's processor the site may use, in percent of all its cores. 5 to 100%; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 5,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "memoryMb": {
            "description": "The memory the site may use (its PHP and scheduled tasks), in MB. At most the server's memory less 256 MB. 256 to 1,048,576 MB; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 256,
                "maximum": 1048576
              },
              {
                "type": "null"
              }
            ]
          },
          "processes": {
            "description": "How many processes the site may run at once. 32 to 4,096; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 32,
                "maximum": 4096
              },
              {
                "type": "null"
              }
            ]
          },
          "priority": {
            "description": "The site's share of the processor when the server is busy: `low`, `normal` (the default) or `high`.",
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "workers": {
            "description": "How many PHP workers the site may run (requests served at once). Left out: set by the server's memory. 1 to 64; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "phpMemoryMb": {
            "description": "PHP's memory limit per request, in MB. Left out: 256 MB. 64 to 1,024 MB; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 64,
                "maximum": 1024
              },
              {
                "type": "null"
              }
            ]
          },
          "timeLimit": {
            "description": "How long one request may run, in seconds. Left out: 120 seconds. 30 to 300 seconds; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 30,
                "maximum": 300
              },
              {
                "type": "null"
              }
            ]
          },
          "uploadMb": {
            "description": "The largest upload, in MB. Left out: 64 MB. 8 to 512 MB; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 8,
                "maximum": 512
              },
              {
                "type": "null"
              }
            ]
          },
          "inputVars": {
            "description": "The most form fields one request may send. Left out: 5,000. 1,000 to 20,000; null or left out: no limit of its own.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1000,
                "maximum": 20000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "description": "Every setting of a site's resources. This replaces them all: a setting left out (or null) goes back to its default, no limit of its own or the server's PHP setting, and `priority` to `normal`. Send `{}` to remove them all.",
        "examples": [
          {
            "cpuPercent": 50,
            "memoryMb": 1024,
            "workers": 8,
            "phpMemoryMb": 512,
            "uploadMb": 128
          },
          {}
        ]
      },
      "SiteSmtp": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "`off`, `setting_up` (being set up on the site's server), `on`, `turning_off`, `failed` (see `lastError`), or stopped: `checking` (the plugin file is being checked), `paused` (see `hold`), `suspended`, or `account_off` (the account's email is off for good: see `accountOff`).",
            "x-known-values": [
              "off",
              "setting_up",
              "on",
              "turning_off",
              "failed",
              "checking",
              "paused",
              "suspended",
              "account_off"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether it's turned on for the site, whatever stop `hold` puts on it."
          },
          "blockedReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the site can't have Rabbitflare SMTP right now: a staging copy, a site still installing, or a server that's stopped or suspended. Null when it can."
          },
          "eligible": {
            "type": "object",
            "properties": {
              "ok": {
                "type": "boolean",
                "description": "Whether the account may turn it on for this site."
              },
              "code": {
                "description": "Why not, as a code (`not_eligible`, `account_off`, …). Null when it may.",
                "x-known-values": [
                  "off",
                  "not_enabled",
                  "not_eligible",
                  "paused",
                  "checking",
                  "suspended",
                  "account_off",
                  "not_checked",
                  "type_not_covered",
                  "bad_message",
                  "recipient_refused",
                  "recipient_suppressed",
                  "notice_unconfirmed",
                  "limit_site_10min",
                  "limit_site_day",
                  "limit_new_site",
                  "limit_account_day",
                  "limit_recipient_hour",
                  "limit_recipient_day",
                  "limit_recipient_all",
                  "limit_new_recipients",
                  "limit_notices",
                  "limit_platform",
                  "no_credit",
                  "temporary",
                  "forms_off",
                  "forms_paused",
                  "forms_stopped",
                  "form_unconfirmed",
                  "form_spam",
                  "form_unchecked",
                  "form_too_long",
                  "limit_form_visitor",
                  "limit_form_10min",
                  "limit_form_day",
                  "limit_form_new_site",
                  "limit_form_account",
                  "limit_form_platform"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "message": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "A sentence."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why not, in a sentence. Null when it may."
              }
            },
            "required": [
              "ok",
              "code",
              "message"
            ],
            "description": "Whether the account may use it for this site: a paid, running server (not a free trial) and a confirmed account email address."
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why setting it up on the site's server, or removing it, didn't finish (with `status: \"failed\"`). Null otherwise."
          },
          "hold": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "description": "`checking` (the plugin file is being checked), `paused` or `suspended`.",
                    "x-known-values": [
                      "checking",
                      "paused",
                      "suspended"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why, in a sentence."
                  },
                  "note": {
                    "type": "string",
                    "description": "What to do about it, in a sentence."
                  },
                  "heldAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "When it was stopped.",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "When it was stopped."
                  },
                  "canResumeAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "A first pause: when it may be turned on again (`POST …/smtp/actions/resume`). Null otherwise.",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "A first pause: when it may be turned on again (`POST …/smtp/actions/resume`). Null otherwise."
                  },
                  "canResume": {
                    "type": "boolean",
                    "description": "Whether it may be turned on again now."
                  }
                },
                "required": [
                  "kind",
                  "reason",
                  "note",
                  "heldAt",
                  "canResumeAt",
                  "canResume"
                ],
                "description": "A stop."
              },
              {
                "type": "null"
              }
            ],
            "description": "A stop on the site's emails: an automatic safety check, or Rabbitflare's team. Null when there's none."
          },
          "accountOff": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Why, in a sentence."
                  },
                  "offAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "When it was switched off.",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "When it was switched off."
                  }
                },
                "required": [
                  "reason",
                  "offAt"
                ],
                "description": "The account's email, switched off."
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the account's email is switched off for good (only support can lift it). Null otherwise."
          },
          "wpMailReplaced": {
            "type": "boolean",
            "description": "Another plugin has replaced WordPress's wp_mail(), so the site's emails don't go through Rabbitflare SMTP."
          },
          "pluginCheck": {
            "type": "object",
            "properties": {
              "ok": {
                "type": "boolean",
                "description": "Whether the Rabbitflare SMTP plugin file on the site is the one Rabbitflare put there."
              },
              "checkedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "When the site's server last checked it. Null before the first check.",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "When the site's server last checked it. Null before the first check."
              }
            },
            "required": [
              "ok",
              "checkedAt"
            ],
            "description": "The site's server checks the plugin file every few minutes: nothing is sent while it's changed or unchecked."
          },
          "firstOnAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it was first turned on for the site. Null if never.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was first turned on for the site. Null if never."
          },
          "newSiteEndsAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "While the site is new to Rabbitflare SMTP (its first 14 days, with lower daily limits): when that ends. Null otherwise.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "While the site is new to Rabbitflare SMTP (its first 14 days, with lower daily limits): when that ends. Null otherwise."
          },
          "from": {
            "type": "string",
            "description": "The sender the recipients see: the site's domain as the name, and the site's own sending address."
          },
          "replyTo": {
            "anyOf": [
              {
                "type": "string",
                "description": "An email address."
              },
              {
                "type": "null"
              }
            ],
            "description": "The confirmed reply address the site's emails carry. Null when it has none."
          },
          "limits": {
            "type": "object",
            "properties": {
              "perSite10Min": {
                "type": "integer",
                "description": "Emails the site may send in 10 minutes."
              },
              "perSiteDay": {
                "type": "integer",
                "description": "Emails the site may send in 24 hours."
              },
              "perAccountDay": {
                "type": "integer",
                "description": "Emails all the account's sites may send in 24 hours."
              },
              "newRecipientsPerDay": {
                "type": "integer",
                "description": "Addresses the site has never emailed before that it may email in 24 hours."
              },
              "newSitePerDay": {
                "type": "integer",
                "description": "Emails a site may send in 24 hours while it's new to Rabbitflare SMTP (its first 14 days)."
              },
              "newRecipientsPerDayFirst14": {
                "type": "integer",
                "description": "New addresses a site may email in 24 hours in its first 14 days."
              },
              "perRecipientHour": {
                "type": "integer",
                "description": "Emails one address may be sent from the site in an hour."
              },
              "perRecipientDay": {
                "type": "integer",
                "description": "Emails one address may be sent from the site in 24 hours."
              },
              "noticePerSiteDay": {
                "type": "integer",
                "description": "Admin notices to confirmed addresses in 24 hours (their own allowance)."
              },
              "noticeAddressesPerSite": {
                "type": "integer",
                "description": "Notice addresses a site may add."
              }
            },
            "required": [
              "perSite10Min",
              "perSiteDay",
              "perAccountDay",
              "newRecipientsPerDay",
              "newSitePerDay",
              "newRecipientsPerDayFirst14",
              "perRecipientHour",
              "perRecipientDay",
              "noticePerSiteDay",
              "noticeAddressesPerSite"
            ],
            "description": "The limits in force. Times are rolling: 24 hours, not a calendar day."
          },
          "usage": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "tenMinutes": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer",
                        "description": "Emails counted so far."
                      },
                      "limit": {
                        "type": "integer",
                        "description": "The most allowed."
                      }
                    },
                    "required": [
                      "used",
                      "limit"
                    ],
                    "description": "The site's emails in the last 10 minutes."
                  },
                  "today": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer",
                        "description": "Emails counted so far."
                      },
                      "limit": {
                        "type": "integer",
                        "description": "The most allowed."
                      }
                    },
                    "required": [
                      "used",
                      "limit"
                    ],
                    "description": "The site's emails in the last 24 hours."
                  },
                  "account": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "used": {
                            "type": "integer",
                            "description": "Emails counted so far."
                          },
                          "limit": {
                            "type": "integer",
                            "description": "The most allowed."
                          }
                        },
                        "required": [
                          "used",
                          "limit"
                        ],
                        "description": "All the account's sites' emails in the last 24 hours."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "All the account's sites' emails in the last 24 hours. Null for a token limited to some servers: it counts the sites on every server."
                  },
                  "newRecipients": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer",
                        "description": "Emails counted so far."
                      },
                      "limit": {
                        "type": "integer",
                        "description": "The most allowed."
                      }
                    },
                    "required": [
                      "used",
                      "limit"
                    ],
                    "description": "New addresses the site emailed in the last 24 hours."
                  },
                  "notices": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer",
                        "description": "Emails counted so far."
                      },
                      "limit": {
                        "type": "integer",
                        "description": "The most allowed."
                      }
                    },
                    "required": [
                      "used",
                      "limit"
                    ],
                    "description": "Admin notices to confirmed addresses in the last 24 hours."
                  },
                  "refusedToday": {
                    "type": "integer",
                    "description": "Emails refused in the last 24 hours."
                  },
                  "paidToday": {
                    "type": "integer",
                    "description": "Emails paid from the account's email credit in the last 24 hours."
                  },
                  "days": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "date": {
                          "type": "string",
                          "description": "The day (UTC), like `2026-11-19`."
                        },
                        "sent": {
                          "type": "integer",
                          "description": "Emails sent."
                        },
                        "delivered": {
                          "type": "integer",
                          "description": "Emails delivered."
                        },
                        "bounced": {
                          "type": "integer",
                          "description": "Emails that bounced."
                        },
                        "complained": {
                          "type": "integer",
                          "description": "Emails marked as spam."
                        },
                        "refused": {
                          "type": "integer",
                          "description": "Emails refused before sending."
                        }
                      },
                      "required": [
                        "date",
                        "sent",
                        "delivered",
                        "bounced",
                        "complained",
                        "refused"
                      ],
                      "description": "One day."
                    },
                    "description": "The last 30 days, oldest first."
                  }
                },
                "required": [
                  "tenMinutes",
                  "today",
                  "account",
                  "newRecipients",
                  "notices",
                  "refusedToday",
                  "paidToday",
                  "days"
                ],
                "description": "What the site sent."
              },
              {
                "type": "null"
              }
            ],
            "description": "What the site sent, against its limits. Null if it was never turned on, and in a change's answer to a token without `sites:read`."
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SmtpAddress"
            },
            "description": "The account's own addresses first, then the ones added to the site. A token limited to some servers sees only the team members who can reach the site's server; a change's answer to a token without `sites:read` holds only the ones added to the site (no sign-in addresses)."
          },
          "suggestedNoticeAddresses": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An email address."
            },
            "description": "Addresses the site tried to send admin notices to in the last 30 days that aren't confirmed: add them to let notices through. Empty in a change's answer to a token without `sites:read`."
          },
          "recentEmails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The email's id."
                },
                "sentAt": {
                  "type": "string",
                  "description": "When the site sent it.",
                  "format": "date-time"
                },
                "type": {
                  "description": "What kind of email it is: `password_reset` (Password resets), `new_account` (New accounts), `account_change` (Account changes), `admin_notice` (Admin notices), `order` (Order emails), `contact_form` (Contact forms). Null when it couldn't be read.",
                  "x-known-values": [
                    "password_reset",
                    "new_account",
                    "account_change",
                    "admin_notice",
                    "order",
                    "contact_form"
                  ],
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "An email address."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Who it was for (kept 30 days). Null when it was refused before it could be read."
                },
                "subject": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A subject."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its subject. Null when it was refused before it could be read."
                },
                "status": {
                  "type": "string",
                  "description": "What happened to it: `accepted`, `sent`, `delivered`, `bounced`, `complained` (marked as spam), `refused`, `failed` or `unknown`.",
                  "x-known-values": [
                    "accepted",
                    "sent",
                    "failed",
                    "unknown",
                    "refused",
                    "delivered",
                    "bounced",
                    "complained"
                  ]
                },
                "code": {
                  "description": "Why it wasn't sent, as a code (`limit_site_day`, `no_credit`, …). Null when it was.",
                  "x-known-values": [
                    "off",
                    "not_enabled",
                    "not_eligible",
                    "paused",
                    "checking",
                    "suspended",
                    "account_off",
                    "not_checked",
                    "type_not_covered",
                    "bad_message",
                    "recipient_refused",
                    "recipient_suppressed",
                    "notice_unconfirmed",
                    "limit_site_10min",
                    "limit_site_day",
                    "limit_new_site",
                    "limit_account_day",
                    "limit_recipient_hour",
                    "limit_recipient_day",
                    "limit_recipient_all",
                    "limit_new_recipients",
                    "limit_notices",
                    "limit_platform",
                    "no_credit",
                    "temporary",
                    "forms_off",
                    "forms_paused",
                    "forms_stopped",
                    "form_unconfirmed",
                    "form_spam",
                    "form_unchecked",
                    "form_too_long",
                    "limit_form_visitor",
                    "limit_form_10min",
                    "limit_form_day",
                    "limit_form_new_site",
                    "limit_form_account",
                    "limit_form_platform"
                  ],
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A sentence."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Why it wasn't sent, in a sentence. Null when it was."
                },
                "paid": {
                  "type": "boolean",
                  "description": "Paid from the account's email credit: it was beyond the site's included emails."
                }
              },
              "required": [
                "id",
                "sentAt",
                "type",
                "to",
                "subject",
                "status",
                "code",
                "reason",
                "paid"
              ],
              "description": "An email the site sent, or tried to."
            },
            "description": "The site's latest emails, newest first. Empty in a change's answer to a token without `sites:read`: whom they went to and their subjects are people's details."
          }
        },
        "required": [
          "status",
          "enabled",
          "blockedReason",
          "eligible",
          "lastError",
          "hold",
          "accountOff",
          "wpMailReplaced",
          "pluginCheck",
          "firstOnAt",
          "newSiteEndsAt",
          "from",
          "replyTo",
          "limits",
          "usage",
          "addresses",
          "suggestedNoticeAddresses",
          "recentEmails"
        ],
        "description": "Rabbitflare SMTP on a site: WordPress's own emails (password resets, new accounts, account changes, admin notices and order emails) sent through Rabbitflare, with the limits, what the site sent, its addresses and its latest emails.",
        "examples": [
          {
            "status": "on",
            "enabled": true,
            "blockedReason": null,
            "eligible": {
              "ok": true,
              "code": null,
              "message": null
            },
            "lastError": null,
            "hold": null,
            "accountOff": null,
            "wpMailReplaced": false,
            "pluginCheck": {
              "ok": true,
              "checkedAt": "2026-11-19T10:01:00.000Z"
            },
            "firstOnAt": "2026-10-28T14:20:11.000Z",
            "newSiteEndsAt": null,
            "from": "\"shop.example.com\" <shop-x7k2p@sitemail.rabbitflare.com>",
            "replyTo": "orders@example.com",
            "limits": {
              "perSite10Min": 5,
              "perSiteDay": 50,
              "perAccountDay": 150,
              "newRecipientsPerDay": 15,
              "newSitePerDay": 10,
              "newRecipientsPerDayFirst14": 5,
              "perRecipientHour": 3,
              "perRecipientDay": 10,
              "noticePerSiteDay": 10,
              "noticeAddressesPerSite": 5
            },
            "usage": {
              "tenMinutes": {
                "used": 1,
                "limit": 5
              },
              "today": {
                "used": 12,
                "limit": 50
              },
              "account": {
                "used": 19,
                "limit": 150
              },
              "newRecipients": {
                "used": 4,
                "limit": 15
              },
              "notices": {
                "used": 2,
                "limit": 10
              },
              "refusedToday": 0,
              "paidToday": 0,
              "days": [
                {
                  "date": "2026-11-18",
                  "sent": 14,
                  "delivered": 14,
                  "bounced": 0,
                  "complained": 0,
                  "refused": 0
                },
                {
                  "date": "2026-11-19",
                  "sent": 12,
                  "delivered": 11,
                  "bounced": 0,
                  "complained": 0,
                  "refused": 0
                }
              ]
            },
            "addresses": [
              {
                "id": "account:0b9f2c1e-6d3a-4f7e-9a51-2c8e4b7d1f60",
                "kind": "notice",
                "address": "you@example.com",
                "confirmed": true,
                "confirmationSentAt": null,
                "source": "account"
              },
              {
                "id": "6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d",
                "kind": "reply",
                "address": "orders@example.com",
                "confirmed": true,
                "confirmationSentAt": "2026-10-28T14:25:40.000Z",
                "source": "added"
              }
            ],
            "suggestedNoticeAddresses": [],
            "recentEmails": [
              {
                "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
                "sentAt": "2026-11-19T09:58:03.000Z",
                "type": "order",
                "to": "customer@example.net",
                "subject": "Your Shop order has been received!",
                "status": "delivered",
                "code": null,
                "reason": null,
                "paid": false
              }
            ]
          }
        ]
      },
      "SiteStaging": {
        "type": "object",
        "properties": {
          "live": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The live site's id."
              },
              "name": {
                "type": "string",
                "description": "The live site's name."
              },
              "url": {
                "type": "string",
                "description": "The live site's address."
              }
            },
            "required": [
              "id",
              "name",
              "url"
            ],
            "description": "The live site."
          },
          "copy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StagingCopy"
              },
              {
                "type": "null"
              }
            ],
            "description": "The site's staging copy. Null when it has none."
          },
          "activeRun": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StagingRun"
              },
              {
                "type": "null"
              }
            ],
            "description": "The staging operation in progress (or waiting for our team). Null when none is. Poll `GET /sites/{siteId}/staging` every 10 seconds until it's null again; the operation is then first in `recentRuns`."
          },
          "restorePoints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StagingRestorePoint"
            },
            "description": "The restore point of the last push or undo: what it replaced on the live site. Only the newest is kept: the next push or undo replaces it, and the one it replaces is listed `discarding` until it's gone. Newest first."
          },
          "recentRuns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StagingRun"
            },
            "description": "The last 10 finished staging operations, newest first."
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A sentence."
            },
            "description": "Why a staging copy can't be created right now: staging isn't open to the account, the site is still installing, its server is off, an operation is running, or the weekly limit is reached. Empty when one can be, or when the site has a copy."
          },
          "createsLeftThisWeek": {
            "type": "integer",
            "description": "How many more times a copy can be created for this site in the next 7 days (3 a week per site)."
          }
        },
        "required": [
          "live",
          "copy",
          "activeRun",
          "restorePoints",
          "recentRuns",
          "blockers",
          "createsLeftThisWeek"
        ],
        "description": "A live site's staging: its copy, the operation in progress, the restore point of its last push, and what was done lately. One staging copy per live site, on the same server, included with the site.",
        "examples": [
          {
            "live": {
              "id": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
              "name": "Shop",
              "url": "https://shop.example.com"
            },
            "copy": {
              "id": "5c2e8f1a-7b3d-4e6f-9a0b-1c2d3e4f5a6b",
              "name": "Shop (staging)",
              "status": "active",
              "url": "https://staging.shop-x7k2p.rabbitflare.link",
              "adminUrl": "https://staging.shop-x7k2p.rabbitflare.link/wp-admin/",
              "hostname": "staging.shop-x7k2p.rabbitflare.link",
              "sslStatus": "active",
              "certificate": "trusted",
              "certificateRetry": false,
              "createdAt": "2026-11-18T10:02:11.000Z",
              "databaseSyncedAt": "2026-11-18T10:05:47.000Z",
              "filesSyncedAt": "2026-11-18T10:05:47.000Z",
              "settings": {
                "protect": true,
                "username": "staging",
                "holdEmail": true,
                "tasks": false,
                "status": "applied",
                "lastError": null
              }
            },
            "activeRun": null,
            "restorePoints": [
              {
                "runId": "7f1e2d3c-4b5a-4968-8776-655443322110",
                "operation": "push",
                "scope": "code",
                "status": "available",
                "createdAt": "2026-11-18T14:21:38.000Z",
                "expiresAt": "2026-11-25T14:21:38.000Z",
                "sizeBytes": 182403211
              }
            ],
            "recentRuns": [
              {
                "id": "7f1e2d3c-4b5a-4968-8776-655443322110",
                "operation": "push",
                "status": "completed",
                "phase": null,
                "stage": null,
                "progress": 100,
                "cancellable": false,
                "options": {
                  "parts": null,
                  "scope": "code",
                  "tables": null,
                  "restoreRunId": null
                },
                "lastError": null,
                "notes": [],
                "createdAt": "2026-11-18T14:20:03.000Z",
                "startedAt": "2026-11-18T14:20:05.000Z",
                "finishedAt": "2026-11-18T14:21:38.000Z"
              }
            ],
            "blockers": [],
            "createsLeftThisWeek": 2
          }
        ]
      },
      "SiteUsage": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "description": "`isolated`: the site runs a PHP of its own, counted exactly. `shared`: it runs on the server's shared PHP, counted by the site's own processes.",
            "x-known-values": [
              "shared",
              "isolated"
            ]
          },
          "cpuPercent": {
            "type": "number",
            "description": "The processor the site used over the last second, in percent of the whole server."
          },
          "memoryMb": {
            "type": "integer",
            "description": "The memory the site uses now, in MB."
          },
          "processes": {
            "type": "integer",
            "description": "How many processes the site runs now (its PHP and scheduled tasks)."
          },
          "measuredAt": {
            "type": "string",
            "description": "When it was measured.",
            "format": "date-time"
          }
        },
        "required": [
          "mode",
          "cpuPercent",
          "memoryMb",
          "processes",
          "measuredAt"
        ],
        "description": "What a site uses of its server right now: its PHP and its scheduled tasks (database work is shared by all sites and isn't counted).",
        "examples": [
          {
            "mode": "isolated",
            "cpuPercent": 12.5,
            "memoryMb": 386,
            "processes": 9,
            "measuredAt": "2026-11-19T10:02:44.000Z"
          }
        ]
      },
      "SmtpAddress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The address's id. The account's own addresses have ids starting `account:` or `team:`: they can't be removed or sent a confirmation."
          },
          "kind": {
            "type": "string",
            "description": "`notice`: admin notices may go to it. `reply`: the reply address of the site's emails (a site has at most one).",
            "x-known-values": [
              "notice",
              "reply"
            ]
          },
          "address": {
            "type": "string",
            "description": "The email address."
          },
          "confirmed": {
            "type": "boolean",
            "description": "Whether its owner confirmed it from the link in the confirmation email. Only confirmed addresses are used."
          },
          "confirmationSentAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the last confirmation email was sent to it. Null for the account's own addresses.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the last confirmation email was sent to it. Null for the account's own addresses."
          },
          "source": {
            "type": "string",
            "description": "`added`: added to this site (it can be removed). `account` and `team`: the account owner's and team members' own sign-in addresses, always confirmed for admin notices.",
            "x-known-values": [
              "added",
              "account",
              "team"
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "address",
          "confirmed",
          "confirmationSentAt",
          "source"
        ],
        "description": "An address of a site's Rabbitflare SMTP: one its admin notices may go to, or its reply address.",
        "examples": [
          {
            "id": "6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d",
            "kind": "reply",
            "address": "orders@example.com",
            "confirmed": true,
            "confirmationSentAt": "2026-10-28T14:25:40.000Z",
            "source": "added"
          }
        ]
      },
      "SmtpAddressInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "notice",
              "reply"
            ],
            "description": "`notice`: admin notices may go to it. `reply`: the reply address of the site's emails."
          },
          "address": {
            "description": "The email address: one of yours, not a Rabbitflare address.",
            "type": "string",
            "maxLength": 254
          }
        },
        "required": [
          "kind",
          "address"
        ],
        "additionalProperties": false,
        "description": "An address to add to a site's Rabbitflare SMTP. It's used once its owner confirms it from the confirmation email.",
        "examples": [
          {
            "kind": "notice",
            "address": "shop.manager@example.com"
          }
        ]
      },
      "Snapshot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The snapshot's or backup's id: a number on some clouds, a UUID on others and for Rabbitflare's copies. Pass it as `imageId` to restore it."
          },
          "name": {
            "type": "string",
            "description": "Its name. An automatic backup without a name of its own is named by the day it was taken where the server is (its location's time zone), as the server's activity names it: `Weekly backup 2026-11-16` for Rabbitflare's, `Backup 2026-11-16` for the cloud's."
          },
          "kind": {
            "type": "string",
            "description": "`snapshot`: one taken on request. `backup`: an automatic backup, the cloud's or Rabbitflare's (`takenBy`).",
            "x-known-values": [
              "snapshot",
              "backup"
            ]
          },
          "takenBy": {
            "type": "string",
            "description": "Who took it and keeps it: `cloud`, the server's cloud; `rabbitflare`, Rabbitflare itself: its weekly backups of the server (it keeps the most recent ones), and a Linode server's snapshots once the server is on Rabbitflare's backups. Restoring one of Rabbitflare's copies works a little differently (see the restore operation).",
            "x-known-values": [
              "rabbitflare",
              "cloud"
            ]
          },
          "sizeGb": {
            "type": "number",
            "description": "Its size, in GB."
          },
          "createdAt": {
            "type": "string",
            "description": "When it was taken.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "takenBy",
          "sizeGb",
          "createdAt"
        ],
        "description": "A copy of the whole server that it can be restored from: a snapshot, or an automatic backup, kept by the server's cloud or by Rabbitflare (`takenBy`).",
        "examples": [
          {
            "id": "171824639",
            "name": "Before the theme update",
            "kind": "snapshot",
            "takenBy": "cloud",
            "sizeGb": 6.31,
            "createdAt": "2026-11-17T22:14:05.000Z"
          },
          {
            "id": "5b0e7c1d-2f4a-4e8b-9a6c-3d1f2e4a5b6c",
            "name": "Weekly backup 2026-11-16",
            "kind": "backup",
            "takenBy": "rabbitflare",
            "sizeGb": 4.82,
            "createdAt": "2026-11-16T01:10:11.000Z"
          }
        ]
      },
      "SnapshotCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9 ._-]+$",
            "description": "A name for the snapshot: up to 64 letters, numbers, spaces, dots, dashes or underscores."
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "description": "A name for a new snapshot.",
        "examples": [
          {
            "name": "Before the theme update"
          }
        ]
      },
      "StagingCopy": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The copy's id. It's a site of its own (`GET /sites/{siteId}` shows it), changed through its live site's staging operations."
          },
          "name": {
            "type": "string",
            "description": "The copy's name: the live site's, with “(staging)”."
          },
          "status": {
            "type": "string",
            "description": "`installing`: being created (see the staging's `activeRun`). `active`: ready. `failed`: creating it failed, and it's being removed. `deleting`: being deleted.",
            "x-known-values": [
              "installing",
              "active",
              "failed",
              "deleting"
            ]
          },
          "url": {
            "type": "string",
            "description": "The copy's address."
          },
          "adminUrl": {
            "type": "string",
            "description": "The address of the copy's WordPress dashboard. Its users and passwords are the live site's, as of the last copy of the database."
          },
          "hostname": {
            "type": "string",
            "description": "The copy's own address: `staging.` and the live site's built-in address. Search engines are always asked not to index it."
          },
          "sslStatus": {
            "type": "string",
            "description": "The copy's SSL certificate: `none`, `pending` (being issued), `active` or `failed`.",
            "x-known-values": [
              "none",
              "pending",
              "active",
              "failed"
            ]
          },
          "certificate": {
            "type": "string",
            "description": "Which certificate the copy is served with: `trusted` (no browser warning), `securing` (a trusted one is being set up; meanwhile a temporary one, which browsers warn about), or `temporary` (only one made on its server, which browsers warn about).",
            "x-known-values": [
              "trusted",
              "securing",
              "temporary"
            ]
          },
          "certificateRetry": {
            "type": "boolean",
            "description": "Whether a trusted certificate can be asked for again (the last tries gave up): `POST /sites/{siteId}/actions/reissue-ssl` with the copy's id."
          },
          "createdAt": {
            "type": "string",
            "description": "When the copy was created.",
            "format": "date-time"
          },
          "databaseSyncedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the live site's database was last copied into it (when it was made or refreshed). Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the live site's database was last copied into it (when it was made or refreshed). Null until then."
          },
          "filesSyncedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the live site's files were last copied into it. Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the live site's files were last copied into it. Null until then."
          },
          "settings": {
            "type": "object",
            "properties": {
              "protect": {
                "type": "boolean",
                "description": "Password protection: visitors must enter `username` and its password to see the copy (`GET /sites/{siteId}/staging/password-protection`). On by default. The copy has the live site's user accounts, so keep it on unless you need to share the copy."
              },
              "username": {
                "type": "string",
                "description": "The username visitors enter while password protection is on."
              },
              "holdEmail": {
                "type": "boolean",
                "description": "Whether the copy's outgoing email is held, so it sends no orders, password resets or newsletters. On by default."
              },
              "tasks": {
                "type": "boolean",
                "description": "Whether scheduled tasks (WP-Cron, Action Scheduler) run on the copy. Off by default, so the copy doesn't repeat the live site's work (renewals, newsletters)."
              },
              "status": {
                "type": "string",
                "description": "Whether these settings are in place on the server: `applying` (being put in place, a few seconds), `applied`, or `failed` (see `lastError`; send them again).",
                "x-known-values": [
                  "applied",
                  "applying",
                  "failed"
                ]
              },
              "lastError": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "A sentence."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why the settings couldn't be put in place (with `status: \"failed\"`). Null otherwise."
              }
            },
            "required": [
              "protect",
              "username",
              "holdEmail",
              "tasks",
              "status",
              "lastError"
            ],
            "description": "The staging copy's settings."
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "url",
          "adminUrl",
          "hostname",
          "sslStatus",
          "certificate",
          "certificateRetry",
          "createdAt",
          "databaseSyncedAt",
          "filesSyncedAt",
          "settings"
        ],
        "description": "A live site's staging copy: a private copy of the site on the same server, to try changes on before they go live.",
        "examples": [
          {
            "id": "5c2e8f1a-7b3d-4e6f-9a0b-1c2d3e4f5a6b",
            "name": "Shop (staging)",
            "status": "active",
            "url": "https://staging.shop-x7k2p.rabbitflare.link",
            "adminUrl": "https://staging.shop-x7k2p.rabbitflare.link/wp-admin/",
            "hostname": "staging.shop-x7k2p.rabbitflare.link",
            "sslStatus": "active",
            "certificate": "trusted",
            "certificateRetry": false,
            "createdAt": "2026-11-18T10:02:11.000Z",
            "databaseSyncedAt": "2026-11-18T10:05:47.000Z",
            "filesSyncedAt": "2026-11-18T10:05:47.000Z",
            "settings": {
              "protect": true,
              "username": "staging",
              "holdEmail": true,
              "tasks": false,
              "status": "applied",
              "lastError": null
            }
          }
        ]
      },
      "StagingPasswordProtection": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "The username."
          },
          "password": {
            "type": "string",
            "description": "The password."
          }
        },
        "required": [
          "username",
          "password"
        ],
        "description": "What visitors enter to see a staging copy while its password protection is on. Not the WordPress login: the copy's WordPress users are the live site's.",
        "examples": [
          {
            "username": "staging",
            "password": "k7Qm2vXc9RtLp4Wz8NbY"
          }
        ]
      },
      "StagingPreview": {
        "type": "object",
        "properties": {
          "sizes": {
            "type": "object",
            "properties": {
              "liveFilesBytes": {
                "type": "integer",
                "description": "The live site's files the operation copies, in bytes (0 when it copies none)."
              },
              "liveDatabaseBytes": {
                "type": "integer",
                "description": "The live site's database, in bytes."
              },
              "stagingFilesBytes": {
                "type": "integer",
                "description": "The copy's code a push copies, in bytes (0 when it copies none)."
              },
              "stagingDatabaseBytes": {
                "type": "integer",
                "description": "The copy's database, in bytes."
              },
              "freeBytes": {
                "type": "integer",
                "description": "Free room on the server's disk, in bytes."
              },
              "neededBytes": {
                "type": "integer",
                "description": "The room the operation needs on the server's disk while it runs, in bytes."
              }
            },
            "required": [
              "liveFilesBytes",
              "liveDatabaseBytes",
              "stagingFilesBytes",
              "stagingDatabaseBytes",
              "freeBytes",
              "neededBytes"
            ],
            "description": "What the operation would copy, and the room it needs."
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A sentence."
            },
            "description": "Why the operation would be refused, or fail. Empty when nothing stands in the way."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A sentence."
            },
            "description": "What's worth knowing before going ahead."
          },
          "changes": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "since": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "Since when: the copy's last database copy (for a push), or the push (for an undo). Null when not known.",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Since when: the copy's last database copy (for a push), or the push (for an undo). Null when not known."
                  },
                  "orders": {
                    "type": "integer",
                    "description": "New orders."
                  },
                  "users": {
                    "type": "integer",
                    "description": "New users."
                  },
                  "comments": {
                    "type": "integer",
                    "description": "New comments."
                  },
                  "formEntries": {
                    "type": "integer",
                    "description": "New form entries."
                  },
                  "posts": {
                    "type": "integer",
                    "description": "New posts and pages."
                  },
                  "editedPosts": {
                    "type": "integer",
                    "description": "Posts and pages edited."
                  }
                },
                "required": [
                  "since",
                  "orders",
                  "users",
                  "comments",
                  "formEntries",
                  "posts",
                  "editedPosts"
                ],
                "description": "Changes on the live site."
              },
              {
                "type": "null"
              }
            ],
            "description": "For a push of the database or an undo: what changed on the live site since then, which the operation would replace. Null otherwise."
          },
          "tables": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The table's name."
                },
                "rows": {
                  "type": "integer",
                  "description": "Its rows."
                },
                "sizeBytes": {
                  "type": "integer",
                  "description": "Its size, in bytes."
                },
                "onLive": {
                  "type": "boolean",
                  "description": "Whether the live site has a table of this name."
                },
                "keptOnLive": {
                  "type": "boolean",
                  "description": "Whether the push leaves the live site's own table in place (as it does for the tables that hold the site's own state, unless they're named in `tables`)."
                }
              },
              "required": [
                "name",
                "rows",
                "sizeBytes",
                "onLive",
                "keptOnLive"
              ],
              "description": "A table of the copy's database."
            },
            "description": "For a push of the database: the copy's tables. Empty otherwise."
          },
          "liveOnlyTables": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A table's name."
            },
            "description": "For a push of the database: tables only the live site has, which the push leaves in place."
          },
          "downgrades": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "description": "`core` (WordPress itself), `plugin` or `theme`.",
                  "x-known-values": [
                    "core",
                    "plugin",
                    "theme"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "Its folder's name (`core` for WordPress itself): what `allowDowngrade` takes after `plugin:` or `theme:`."
                },
                "title": {
                  "type": "string",
                  "description": "Its name, as WordPress shows it."
                },
                "liveVersion": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A version."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its version on the live site. Null when the live site doesn't have it."
                },
                "stagingVersion": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A version."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its version on the copy. Null when the copy doesn't have it."
                }
              },
              "required": [
                "kind",
                "name",
                "title",
                "liveVersion",
                "stagingVersion"
              ],
              "description": "WordPress itself, a plugin or a theme, with its version on each side."
            },
            "description": "For a push of the code: what's newer on the live site than on the copy. The push puts these back to the copy's version only when they're named in its `allowDowngrade`; otherwise it fails, changing nothing."
          },
          "removedFromLive": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "description": "`core` (WordPress itself), `plugin` or `theme`.",
                  "x-known-values": [
                    "core",
                    "plugin",
                    "theme"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "Its folder's name (`core` for WordPress itself): what `allowDowngrade` takes after `plugin:` or `theme:`."
                },
                "title": {
                  "type": "string",
                  "description": "Its name, as WordPress shows it."
                },
                "liveVersion": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A version."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its version on the live site. Null when the live site doesn't have it."
                },
                "stagingVersion": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "A version."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Its version on the copy. Null when the copy doesn't have it."
                }
              },
              "required": [
                "kind",
                "name",
                "title",
                "liveVersion",
                "stagingVersion"
              ],
              "description": "WordPress itself, a plugin or a theme, with its version on each side."
            },
            "description": "For a push of the code: plugins and themes on the live site that the copy doesn't have, which the push removes."
          },
          "overdueTasks": {
            "type": "integer",
            "description": "For a push of the database: scheduled tasks on the copy that are already due (they'd run on the live site after the push, unless `cancelOverdue`)."
          },
          "paymentsScheduled": {
            "type": "boolean",
            "description": "For a push of the database: whether the copy's store has subscription renewals or other payments scheduled, which need care before replacing the live site's database."
          }
        },
        "required": [
          "sizes",
          "blockers",
          "warnings",
          "changes",
          "tables",
          "liveOnlyTables",
          "downgrades",
          "removedFromLive",
          "overdueTasks",
          "paymentsScheduled"
        ],
        "description": "What a staging operation would do and need, checked on the server (it takes a few seconds), before you start it.",
        "examples": [
          {
            "sizes": {
              "liveFilesBytes": 0,
              "liveDatabaseBytes": 48211456,
              "stagingFilesBytes": 0,
              "stagingDatabaseBytes": 51380224,
              "freeBytes": 41871163392,
              "neededBytes": 113036492
            },
            "blockers": [],
            "warnings": [
              "The live site has new orders or users since the copy; pushing the database replaces them"
            ],
            "changes": {
              "since": "2026-11-18T10:05:47.000Z",
              "orders": 3,
              "users": 1,
              "comments": 0,
              "formEntries": 2,
              "posts": 0,
              "editedPosts": 1
            },
            "tables": [
              {
                "name": "wp_options",
                "rows": 412,
                "sizeBytes": 1212416,
                "onLive": true,
                "keptOnLive": false
              },
              {
                "name": "wp_posts",
                "rows": 1874,
                "sizeBytes": 9453568,
                "onLive": true,
                "keptOnLive": false
              },
              {
                "name": "wp_users",
                "rows": 12,
                "sizeBytes": 16384,
                "onLive": true,
                "keptOnLive": false
              }
            ],
            "liveOnlyTables": [
              "wp_shop_audit_log"
            ],
            "downgrades": [
              {
                "kind": "plugin",
                "name": "woocommerce",
                "title": "WooCommerce",
                "liveVersion": "9.4.2",
                "stagingVersion": "9.4.1"
              }
            ],
            "removedFromLive": [],
            "overdueTasks": 0,
            "paymentsScheduled": false
          }
        ]
      },
      "StagingPushInput": {
        "type": "object",
        "properties": {
          "scope": {
            "description": "What to copy to the live site: `code` (WordPress itself, plugins, themes, must-use plugins and languages), `database` (the database, and media added on the copy) or `everything` (both). Default `code`.",
            "type": "string",
            "enum": [
              "code",
              "database",
              "everything"
            ]
          },
          "tables": {
            "description": "Only with `database` or `everything` (advanced): copy only these tables of the copy's database; the live site's other tables stay as they are. Left out: all of them, except those that hold the live site's own state (`keptOnLive` in the preview).",
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_$]{1,64}$",
              "description": "A table's name."
            }
          },
          "allowDowngrade": {
            "description": "What you agree to put back to the copy's older version, where the live site has a newer one: `plugin:<name>`, `theme:<name>` or `core`, as the preview's `downgrades` list them (`kind` and `name`). A push that would put back anything not named here fails, changing nothing.",
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^(?:core|(?:plugin|theme):[^\\s:/\\\\]{1,110})$",
              "description": "`plugin:<name>`, `theme:<name>` or `core`."
            }
          },
          "cancelOverdue": {
            "description": "For a push of tables that include the scheduled tasks: cancel the copy's tasks that are already due, so they don't run on the live site. Default true.",
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "What a push copies from the staging copy to the live site. Send no body to push the code.",
        "examples": [
          {
            "scope": "everything",
            "allowDowngrade": [
              "plugin:woocommerce"
            ]
          }
        ]
      },
      "StagingRefreshInput": {
        "type": "object",
        "properties": {
          "parts": {
            "description": "What to copy from the live site into the copy: `all` (the default), `files` or `database`.",
            "type": "string",
            "enum": [
              "all",
              "files",
              "database"
            ]
          }
        },
        "additionalProperties": false,
        "description": "What a refresh copies from the live site. Send no body to copy everything.",
        "examples": [
          {
            "parts": "database"
          }
        ]
      },
      "StagingRestorePoint": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "description": "The id of the push (or undo) that made it. Send it to `POST /sites/{siteId}/staging/actions/undo-push` to put the live site back to it, or delete it with `DELETE /sites/{siteId}/staging/restore-points/{runId}`."
          },
          "operation": {
            "type": "string",
            "description": "What made it: a `push`, or an `undo` (so the undo itself can be undone).",
            "x-known-values": [
              "push",
              "undo"
            ]
          },
          "scope": {
            "description": "What it holds of the live site, as it was before: `code` (WordPress itself, plugins, themes, must-use plugins and languages), `database` (the database, and media added on the copy) or `everything` (both). Null when not known.",
            "x-known-values": [
              "code",
              "database",
              "everything"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "description": "`available`: an undo can use it. `using`: an undo is using it now. `held`: kept while our team puts the site right. `discarding`: being deleted.",
            "x-known-values": [
              "available",
              "using",
              "held",
              "discarding"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "When it was made.",
            "format": "date-time"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it's deleted by itself (7 days after it was made), unless the next push or undo replaces it first. Null when it's kept for now.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it's deleted by itself (7 days after it was made), unless the next push or undo replaces it first. Null when it's kept for now."
          },
          "sizeBytes": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Bytes."
              },
              {
                "type": "null"
              }
            ],
            "description": "The room it takes on the server's disk. Null when not known."
          }
        },
        "required": [
          "runId",
          "operation",
          "scope",
          "status",
          "createdAt",
          "expiresAt",
          "sizeBytes"
        ],
        "description": "What the last push (or undo) replaced on the live site, kept for 7 days so it can be undone. A site keeps only its newest restore point: the next push or undo replaces it.",
        "examples": [
          {
            "runId": "7f1e2d3c-4b5a-4968-8776-655443322110",
            "operation": "push",
            "scope": "code",
            "status": "available",
            "createdAt": "2026-11-18T14:21:38.000Z",
            "expiresAt": "2026-11-25T14:21:38.000Z",
            "sizeBytes": 182403211
          }
        ]
      },
      "StagingRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The operation's id."
          },
          "operation": {
            "type": "string",
            "description": "`create` (make the copy), `refresh` (copy the live site into it again), `push` (copy it to the live site) or `undo` (put the live site back to a restore point).",
            "x-known-values": [
              "create",
              "refresh",
              "push",
              "undo"
            ]
          },
          "status": {
            "type": "string",
            "description": "`queued`: waiting to start (one staging operation runs on a server at a time). `running`: under way (see `stage` and `progress`). `completed`. `failed`: see `lastError`; what it was changing is as it was. `cancelled`. `attention`: something went wrong while switching the live site over, and our team is putting it right.",
            "x-known-values": [
              "queued",
              "running",
              "completed",
              "failed",
              "cancelled",
              "attention"
            ]
          },
          "phase": {
            "description": "While it runs: `prepare` (getting everything ready; the live site hasn't been touched and it can be cancelled), `apply` (switching over, which takes seconds) or `recovering` (being put right). Null while queued and once it's finished.",
            "x-known-values": [
              "prepare",
              "apply",
              "recovering"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "stage": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "What's happening now, in words. Null once it's finished."
          },
          "progress": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Percent."
              },
              {
                "type": "null"
              }
            ],
            "description": "How far it has got, 0 to 100. Null when that isn't known."
          },
          "cancellable": {
            "type": "boolean",
            "description": "Whether it can be cancelled now (`POST /sites/{siteId}/staging/actions/cancel`): while it's queued, or still preparing."
          },
          "options": {
            "type": "object",
            "properties": {
              "parts": {
                "description": "For a refresh: what it copies from the live site: `all`, `files` or `database`. Null otherwise.",
                "x-known-values": [
                  "all",
                  "files",
                  "database"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "scope": {
                "description": "For a push: what it copies to the live site: `code` (WordPress itself, plugins, themes, must-use plugins and languages), `database` (the database, and media added on the copy) or `everything` (both). Null otherwise.",
                "x-known-values": [
                  "code",
                  "database",
                  "everything"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "tables": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "A table's name."
                    },
                    "description": "Table names."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "For a push of the database: the only tables it copies. Null: all of them."
              },
              "restoreRunId": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "A restore point's `runId`."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "For an undo: the restore point it puts the live site back to (the `runId` of the push or undo that made it). Null otherwise."
              }
            },
            "required": [
              "parts",
              "scope",
              "tables",
              "restoreRunId"
            ],
            "description": "What the operation was asked to do."
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string",
                "description": "A sentence."
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it failed, or why it waits for our team. Null otherwise."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A sentence."
            },
            "description": "For a finished operation: facts worth knowing (files left out, places that still mention the other address…)."
          },
          "createdAt": {
            "type": "string",
            "description": "When it was asked for.",
            "format": "date-time"
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it started on the server. Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it started on the server. Null until then."
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it finished. Null until then.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it finished. Null until then."
          }
        },
        "required": [
          "id",
          "operation",
          "status",
          "phase",
          "stage",
          "progress",
          "cancellable",
          "options",
          "lastError",
          "notes",
          "createdAt",
          "startedAt",
          "finishedAt"
        ],
        "description": "A staging operation: creating the copy, refreshing it, pushing it to the live site, or undoing a push.",
        "examples": [
          {
            "id": "7f1e2d3c-4b5a-4968-8776-655443322110",
            "operation": "push",
            "status": "completed",
            "phase": null,
            "stage": null,
            "progress": 100,
            "cancellable": false,
            "options": {
              "parts": null,
              "scope": "code",
              "tables": null,
              "restoreRunId": null
            },
            "lastError": null,
            "notes": [],
            "createdAt": "2026-11-18T14:20:03.000Z",
            "startedAt": "2026-11-18T14:20:05.000Z",
            "finishedAt": "2026-11-18T14:21:38.000Z"
          }
        ]
      },
      "StagingSettingsInput": {
        "type": "object",
        "properties": {
          "protect": {
            "description": "Turn password protection on or off.",
            "type": "boolean"
          },
          "holdEmail": {
            "description": "Hold the copy's outgoing email (true) or send it (false).",
            "type": "boolean"
          },
          "tasks": {
            "description": "Run scheduled tasks (WP-Cron, Action Scheduler) on the copy (true) or pause them (false).",
            "type": "boolean"
          },
          "username": {
            "description": "A new username for password protection: up to 32 letters, digits, dots, dashes and underscores.",
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,32}$"
          },
          "regeneratePassword": {
            "description": "Send `true` for a new password, made for you.",
            "type": "boolean",
            "const": true
          },
          "password": {
            "description": "A password of your own for password protection: 12 to 128 characters, without colons or line breaks.",
            "type": "string",
            "minLength": 12,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "description": "The staging copy's settings to change. Settings left out stay as they are. They're put in place on the server within seconds.",
        "examples": [
          {
            "protect": true,
            "holdEmail": true,
            "tasks": false,
            "regeneratePassword": true
          }
        ]
      },
      "StagingUndoInput": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "The restore point to put the live site back to: its `runId`, from `restorePoints` in `GET /sites/{siteId}/staging`."
          }
        },
        "required": [
          "runId"
        ],
        "additionalProperties": false,
        "description": "The restore point an undo puts the live site back to.",
        "examples": [
          {
            "runId": "7f1e2d3c-4b5a-4968-8776-655443322110"
          }
        ]
      },
      "Ticket": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ticket's reference, like `RF-7KQ2MX`: its id here (`ticketRef` in paths), in the panel and in the emails about it."
          },
          "subject": {
            "type": "string",
            "description": "The ticket's subject."
          },
          "status": {
            "type": "string",
            "description": "Where it stands: `open` (waiting for support: new, or you wrote last), `answered` (support replied and waits for you) or `closed` (closed by you, by support, or by itself after reminders went unanswered).",
            "x-known-values": [
              "open",
              "answered",
              "closed"
            ]
          },
          "topic": {
            "type": "string",
            "description": "What it's about: `server` (a server or site problem), `billing`, `domains` (domains and SSL), `cdn`, `migration` (moving a site to Rabbitflare), `account` (the account and signing in), `sales` (plans and features) or `other`.",
            "x-known-values": [
              "server",
              "billing",
              "domains",
              "cdn",
              "migration",
              "account",
              "sales",
              "other"
            ]
          },
          "priority": {
            "type": "string",
            "description": "How urgent it was when opened: `normal` (a general question), `high` (something isn't working) or `urgent` (a site is down).",
            "x-known-values": [
              "normal",
              "high",
              "urgent"
            ]
          },
          "about": {
            "description": "The site or server it's about, as the panel shows it: `Site: <name>` or `Server: <name>`, with the name it had when the ticket was opened. Null: the account in general.",
            "type": [
              "string",
              "null"
            ]
          },
          "messageCount": {
            "type": "integer",
            "description": "How many messages the conversation has."
          },
          "preview": {
            "type": "string",
            "description": "The start of the latest message, as plain text on one line (up to 180 characters). Empty when it was only files."
          },
          "lastMessageAt": {
            "type": "string",
            "description": "When the latest message was sent.",
            "format": "date-time"
          },
          "lastReplyBy": {
            "type": "string",
            "description": "Who wrote the latest message: `customer` (your side) or `support`.",
            "x-known-values": [
              "customer",
              "support"
            ]
          },
          "autoCloseAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it closes by itself",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "While support's answer waits for you (`answered`): when the ticket closes by itself if nobody writes, after a reminder and a final reminder by email. Null otherwise."
          },
          "remindersSent": {
            "type": "integer",
            "description": "Reminders emailed since support's latest answer: 0, 1 or 2."
          },
          "rating": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TicketRating"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your rating of the help, once given. Null: not rated."
          },
          "createdAt": {
            "type": "string",
            "description": "When the ticket was opened.",
            "format": "date-time"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TicketMessage"
            },
            "description": "The conversation, oldest message first."
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TicketHistoryEntry"
            },
            "description": "Reminders, closing and reopening, oldest first."
          }
        },
        "required": [
          "id",
          "subject",
          "status",
          "topic",
          "priority",
          "about",
          "messageCount",
          "preview",
          "lastMessageAt",
          "lastReplyBy",
          "autoCloseAt",
          "remindersSent",
          "rating",
          "createdAt",
          "messages",
          "history"
        ],
        "description": "A support ticket with its whole conversation: a conversation between your account and Rabbitflare's support team.",
        "examples": [
          {
            "id": "RF-7KQ2MX",
            "subject": "Checkout page shows a 502 error",
            "status": "answered",
            "topic": "server",
            "priority": "high",
            "about": "Site: Shop",
            "messageCount": 2,
            "preview": "Thanks for the screenshot. The shop's PHP workers were all busy with a plugin's slow requests, so the server answered 502. We raised the site's PHP worker limit and the checkout pa",
            "lastMessageAt": "2026-11-16T10:12:40.000Z",
            "lastReplyBy": "support",
            "autoCloseAt": "2026-11-22T10:13:05.000Z",
            "remindersSent": 1,
            "rating": null,
            "createdAt": "2026-11-16T09:58:02.000Z",
            "messages": [
              {
                "id": "9d2e4f6a-1b3c-4d5e-8f7a-0b1c2d3e4f5a",
                "author": "customer",
                "authorName": "Jane Doe",
                "body": "Since this morning the checkout page of the shop shows a 502 error. The screenshot shows what customers see.",
                "html": null,
                "via": "panel",
                "createdAt": "2026-11-16T09:58:02.000Z",
                "files": [
                  {
                    "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
                    "filename": "checkout-error.png",
                    "contentType": "image/png",
                    "sizeBytes": 184320
                  }
                ]
              },
              {
                "id": "2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d",
                "author": "support",
                "authorName": "Rabbitflare Support",
                "body": "Thanks for the screenshot. The shop's PHP workers were all busy with a plugin's slow requests, so the server answered 502. We raised the site's PHP worker limit and the checkout page loads again. Could you try an order?",
                "html": "<p>Thanks for the screenshot. The shop's PHP workers were all busy with a plugin's slow requests, so the server answered 502. We raised the site's PHP worker limit and the checkout page loads again. Could you try an order?</p>",
                "via": "email",
                "createdAt": "2026-11-16T10:12:40.000Z",
                "files": []
              }
            ],
            "history": [
              {
                "id": "7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e",
                "kind": "reminder",
                "by": null,
                "createdAt": "2026-11-18T10:13:05.000Z"
              }
            ]
          }
        ]
      },
      "TicketFile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The file's id: what `fileIds` takes, and what `GET /tickets/{ticketRef}/files/{fileId}` downloads once it's sent."
          },
          "filename": {
            "type": "string",
            "description": "The file's name, as it's downloaded."
          },
          "contentType": {
            "type": "string",
            "description": "The file's type, found from its bytes: a PNG, JPEG, GIF or WebP picture, a PDF, or plain text.",
            "x-known-values": [
              "image/png",
              "image/jpeg",
              "image/gif",
              "image/webp",
              "application/pdf",
              "text/plain"
            ]
          },
          "sizeBytes": {
            "type": "integer",
            "description": "The file's size, in bytes."
          }
        },
        "required": [
          "id",
          "filename",
          "contentType",
          "sizeBytes"
        ],
        "description": "A file attached to a ticket's message, or uploaded and waiting to be sent with one.",
        "examples": [
          {
            "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
            "filename": "checkout-error.png",
            "contentType": "image/png",
            "sizeBytes": 184320
          }
        ]
      },
      "TicketHistoryEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The entry's id."
          },
          "kind": {
            "type": "string",
            "description": "What happened: `reminder` and `final_reminder` (support's answer waited for you, and a reminder was emailed), `auto_closed` (it closed by itself after the final reminder), `closed` or `reopened`.",
            "x-known-values": [
              "reminder",
              "final_reminder",
              "auto_closed",
              "closed",
              "reopened"
            ]
          },
          "by": {
            "description": "Who closed or reopened it: `customer` (your side) or `support`. Null for the reminders and the automatic closing.",
            "x-known-values": [
              "customer",
              "support"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "When it happened.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "kind",
          "by",
          "createdAt"
        ],
        "description": "Something that happened to a ticket besides its messages.",
        "examples": [
          {
            "id": "7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e",
            "kind": "reminder",
            "by": null,
            "createdAt": "2026-11-18T10:13:05.000Z"
          }
        ]
      },
      "TicketInput": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "minLength": 3,
            "maxLength": 150,
            "description": "The ticket's subject: 3 to 150 characters."
          },
          "topic": {
            "type": "string",
            "enum": [
              "server",
              "billing",
              "domains",
              "cdn",
              "migration",
              "account",
              "sales",
              "other"
            ],
            "description": "What it's about: `server` (a server or site problem), `billing`, `domains` (domains and SSL), `cdn`, `migration` (moving a site to Rabbitflare), `account` (the account and signing in), `sales` (plans and features) or `other`."
          },
          "priority": {
            "type": "string",
            "enum": [
              "normal",
              "high",
              "urgent"
            ],
            "description": "How urgent it is: `normal` (a general question), `high` (something isn't working) or `urgent` (a site is down)."
          },
          "siteId": {
            "description": "The site it's about, if any. Leave it out (or null) for a question about the account in general.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "serverId": {
            "description": "The server it's about, if any (for a site, send `siteId` instead: a site's ticket is about its server too).",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "message": {
            "type": "string",
            "minLength": 10,
            "maxLength": 10000,
            "description": "What you need help with, as plain text: 10 to 10,000 characters."
          },
          "html": {
            "description": "The message with its formatting, as HTML (optional): paragraphs, line breaks, bold, italics, underline, headings, lists, links (http, https, mailto), quotes, code and tables are kept; anything else (scripts, styles, pictures, colours, classes) is removed. When sent, the message's text is taken from it, and `message` is its plain text. Up to 100,000 characters.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100000
              },
              {
                "type": "null"
              }
            ]
          },
          "fileIds": {
            "description": "Files to send with the message: the ids of files uploaded with `PUT /tickets/uploads` that haven't been sent yet. Up to 5, together up to 25 MB.",
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        },
        "required": [
          "subject",
          "topic",
          "priority",
          "message"
        ],
        "additionalProperties": false,
        "description": "A new support ticket.",
        "examples": [
          {
            "subject": "Checkout page shows a 502 error",
            "topic": "server",
            "priority": "high",
            "siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "message": "Since this morning the checkout page of the shop shows a 502 error. The screenshot shows what customers see.",
            "fileIds": [
              "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9"
            ]
          }
        ]
      },
      "TicketMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The message's id."
          },
          "author": {
            "type": "string",
            "description": "Who wrote it: `customer` (your side) or `support` (Rabbitflare's support team).",
            "x-known-values": [
              "customer",
              "support"
            ]
          },
          "authorName": {
            "type": "string",
            "description": "The writer's name: on your side, the person who wrote it (a message sent through the API carries the account owner's name); on support's, always `Rabbitflare Support`."
          },
          "body": {
            "type": "string",
            "description": "The message as plain text. Empty when it was only files."
          },
          "html": {
            "description": "The message with its formatting, as HTML cleaned to simple formatting (paragraphs, bold, lists, links, quotes, code, tables). Null for a plain-text message.",
            "type": [
              "string",
              "null"
            ]
          },
          "via": {
            "type": "string",
            "description": "How it was written: `panel` (in the panel, or through the API) or `email` (a reply by email).",
            "x-known-values": [
              "panel",
              "email"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "When it was sent.",
            "format": "date-time"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TicketFile"
            },
            "description": "The files sent with it, in the order they were uploaded."
          }
        },
        "required": [
          "id",
          "author",
          "authorName",
          "body",
          "html",
          "via",
          "createdAt",
          "files"
        ],
        "description": "One message of a ticket's conversation.",
        "examples": [
          {
            "id": "9d2e4f6a-1b3c-4d5e-8f7a-0b1c2d3e4f5a",
            "author": "customer",
            "authorName": "Jane Doe",
            "body": "Since this morning the checkout page of the shop shows a 502 error. The screenshot shows what customers see.",
            "html": null,
            "via": "panel",
            "createdAt": "2026-11-16T09:58:02.000Z",
            "files": [
              {
                "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
                "filename": "checkout-error.png",
                "contentType": "image/png",
                "sizeBytes": 184320
              }
            ]
          },
          {
            "id": "2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d",
            "author": "support",
            "authorName": "Rabbitflare Support",
            "body": "Thanks for the screenshot. The shop's PHP workers were all busy with a plugin's slow requests, so the server answered 502. We raised the site's PHP worker limit and the checkout page loads again. Could you try an order?",
            "html": "<p>Thanks for the screenshot. The shop's PHP workers were all busy with a plugin's slow requests, so the server answered 502. We raised the site's PHP worker limit and the checkout page loads again. Could you try an order?</p>",
            "via": "email",
            "createdAt": "2026-11-16T10:12:40.000Z",
            "files": []
          }
        ]
      },
      "TicketRating": {
        "type": "object",
        "properties": {
          "rating": {
            "type": "string",
            "description": "How you rated the help: `great`, `okay` or `not_good`.",
            "x-known-values": [
              "great",
              "okay",
              "not_good"
            ]
          },
          "comment": {
            "description": "What you wrote with it. Null: nothing.",
            "type": [
              "string",
              "null"
            ]
          },
          "ratedAt": {
            "type": "string",
            "description": "When it was rated.",
            "format": "date-time"
          }
        },
        "required": [
          "rating",
          "comment",
          "ratedAt"
        ],
        "description": "Your rating of the help on a ticket (\"How did we do?\").",
        "examples": [
          {
            "rating": "great",
            "comment": "Fixed within the hour, thank you!",
            "ratedAt": "2026-11-19T08:30:12.000Z"
          }
        ]
      },
      "TicketRatingInput": {
        "type": "object",
        "properties": {
          "rating": {
            "type": "string",
            "enum": [
              "great",
              "okay",
              "not_good"
            ],
            "description": "How you rate the help: `great`, `okay` or `not_good`."
          },
          "comment": {
            "description": "A few words with it (optional), up to 2,000 characters.",
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "rating"
        ],
        "additionalProperties": false,
        "description": "Your rating of the help on a ticket.",
        "examples": [
          {
            "rating": "great",
            "comment": "Fixed within the hour, thank you!"
          }
        ]
      },
      "TicketReplyInput": {
        "type": "object",
        "properties": {
          "message": {
            "description": "Your reply, as plain text: up to 10,000 characters. It can be left out when files are sent.",
            "type": "string",
            "maxLength": 10000
          },
          "html": {
            "description": "The message with its formatting, as HTML (optional): paragraphs, line breaks, bold, italics, underline, headings, lists, links (http, https, mailto), quotes, code and tables are kept; anything else (scripts, styles, pictures, colours, classes) is removed. When sent, the message's text is taken from it, and `message` is its plain text. Up to 100,000 characters.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100000
              },
              {
                "type": "null"
              }
            ]
          },
          "fileIds": {
            "description": "Files to send with the message: the ids of files uploaded with `PUT /tickets/uploads` that haven't been sent yet. Up to 5, together up to 25 MB.",
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        },
        "additionalProperties": false,
        "description": "A reply to a ticket: a message, files, or both.",
        "examples": [
          {
            "message": "Orders go through again. Thank you!"
          }
        ]
      },
      "TicketSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ticket's reference, like `RF-7KQ2MX`: its id here (`ticketRef` in paths), in the panel and in the emails about it."
          },
          "subject": {
            "type": "string",
            "description": "The ticket's subject."
          },
          "status": {
            "type": "string",
            "description": "Where it stands: `open` (waiting for support: new, or you wrote last), `answered` (support replied and waits for you) or `closed` (closed by you, by support, or by itself after reminders went unanswered).",
            "x-known-values": [
              "open",
              "answered",
              "closed"
            ]
          },
          "topic": {
            "type": "string",
            "description": "What it's about: `server` (a server or site problem), `billing`, `domains` (domains and SSL), `cdn`, `migration` (moving a site to Rabbitflare), `account` (the account and signing in), `sales` (plans and features) or `other`.",
            "x-known-values": [
              "server",
              "billing",
              "domains",
              "cdn",
              "migration",
              "account",
              "sales",
              "other"
            ]
          },
          "priority": {
            "type": "string",
            "description": "How urgent it was when opened: `normal` (a general question), `high` (something isn't working) or `urgent` (a site is down).",
            "x-known-values": [
              "normal",
              "high",
              "urgent"
            ]
          },
          "about": {
            "description": "The site or server it's about, as the panel shows it: `Site: <name>` or `Server: <name>`, with the name it had when the ticket was opened. Null: the account in general.",
            "type": [
              "string",
              "null"
            ]
          },
          "messageCount": {
            "type": "integer",
            "description": "How many messages the conversation has."
          },
          "preview": {
            "type": "string",
            "description": "The start of the latest message, as plain text on one line (up to 180 characters). Empty when it was only files."
          },
          "lastMessageAt": {
            "type": "string",
            "description": "When the latest message was sent.",
            "format": "date-time"
          },
          "lastReplyBy": {
            "type": "string",
            "description": "Who wrote the latest message: `customer` (your side) or `support`.",
            "x-known-values": [
              "customer",
              "support"
            ]
          },
          "autoCloseAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it closes by itself",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "While support's answer waits for you (`answered`): when the ticket closes by itself if nobody writes, after a reminder and a final reminder by email. Null otherwise."
          },
          "remindersSent": {
            "type": "integer",
            "description": "Reminders emailed since support's latest answer: 0, 1 or 2."
          },
          "rating": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TicketRating"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your rating of the help, once given. Null: not rated."
          },
          "createdAt": {
            "type": "string",
            "description": "When the ticket was opened.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "subject",
          "status",
          "topic",
          "priority",
          "about",
          "messageCount",
          "preview",
          "lastMessageAt",
          "lastReplyBy",
          "autoCloseAt",
          "remindersSent",
          "rating",
          "createdAt"
        ],
        "description": "A support ticket as lists show it, without its conversation.",
        "examples": [
          {
            "id": "RF-7KQ2MX",
            "subject": "Checkout page shows a 502 error",
            "status": "answered",
            "topic": "server",
            "priority": "high",
            "about": "Site: Shop",
            "messageCount": 2,
            "preview": "Thanks for the screenshot. The shop's PHP workers were all busy with a plugin's slow requests, so the server answered 502. We raised the site's PHP worker limit and the checkout pa",
            "lastMessageAt": "2026-11-16T10:12:40.000Z",
            "lastReplyBy": "support",
            "autoCloseAt": "2026-11-22T10:13:05.000Z",
            "remindersSent": 1,
            "rating": null,
            "createdAt": "2026-11-16T09:58:02.000Z"
          }
        ]
      },
      "ToolResult": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "What was done, in a sentence."
          }
        },
        "required": [
          "message"
        ],
        "description": "The answer of a tool that ran: what it did.",
        "examples": [
          {
            "message": "Cache purged"
          }
        ]
      },
      "WebhookAttempt": {
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "description": "When the attempt was made.",
            "format": "date-time"
          },
          "status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The HTTP status your endpoint answered, or `null` when it didn't answer."
          },
          "ms": {
            "type": "integer",
            "description": "How long it took, in milliseconds."
          },
          "error": {
            "description": "Why it failed, in words, or `null` when it succeeded.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "at",
          "status",
          "ms",
          "error"
        ],
        "description": "One attempt to send a delivery."
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The delivery's id (the `Rabbitflare-Delivery-Id` header)."
          },
          "endpointId": {
            "type": "string",
            "description": "The endpoint it was sent to."
          },
          "eventId": {
            "type": "string",
            "description": "The event's id (the payload's `id`): the same for every endpoint and every attempt. A test event's starts with `ping_`."
          },
          "eventType": {
            "type": "string",
            "description": "The event's type."
          },
          "state": {
            "type": "string",
            "description": "`pending` (an attempt is due), `succeeded` (your endpoint answered 2xx) or `failed` (it gave up after 8 attempts, the endpoint answered 410 Gone, or the endpoint was turned off).",
            "x-known-values": [
              "pending",
              "succeeded",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer",
            "description": "Attempts made so far."
          },
          "nextAttemptAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the next attempt is due, while it's `pending`; otherwise `null`.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the next attempt is due, while it's `pending`; otherwise `null`."
          },
          "lastStatus": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The HTTP status your endpoint last answered, or `null` (no answer: a timeout, a refused connection, or no attempt yet)."
          },
          "lastError": {
            "description": "Why the last attempt failed, in words, or `null`.",
            "type": [
              "string",
              "null"
            ]
          },
          "deliveredAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it succeeded, or `null`.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it succeeded, or `null`."
          },
          "createdAt": {
            "type": "string",
            "description": "When it was queued.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "endpointId",
          "eventId",
          "eventType",
          "state",
          "attempts",
          "nextAttemptAt",
          "lastStatus",
          "lastError",
          "deliveredAt",
          "createdAt"
        ],
        "description": "One event sent (or to be sent) to one endpoint: where it stands and how its last attempt went.",
        "examples": [
          {
            "id": "8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a",
            "endpointId": "3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b",
            "eventId": "5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60",
            "eventType": "site.ready",
            "state": "succeeded",
            "attempts": 1,
            "nextAttemptAt": null,
            "lastStatus": 200,
            "lastError": null,
            "deliveredAt": "2026-11-18T08:46:51.000Z",
            "createdAt": "2026-11-18T08:46:50.000Z"
          }
        ]
      },
      "WebhookDeliveryDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The delivery's id (the `Rabbitflare-Delivery-Id` header)."
          },
          "endpointId": {
            "type": "string",
            "description": "The endpoint it was sent to."
          },
          "eventId": {
            "type": "string",
            "description": "The event's id (the payload's `id`): the same for every endpoint and every attempt. A test event's starts with `ping_`."
          },
          "eventType": {
            "type": "string",
            "description": "The event's type."
          },
          "state": {
            "type": "string",
            "description": "`pending` (an attempt is due), `succeeded` (your endpoint answered 2xx) or `failed` (it gave up after 8 attempts, the endpoint answered 410 Gone, or the endpoint was turned off).",
            "x-known-values": [
              "pending",
              "succeeded",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer",
            "description": "Attempts made so far."
          },
          "nextAttemptAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When the next attempt is due, while it's `pending`; otherwise `null`.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the next attempt is due, while it's `pending`; otherwise `null`."
          },
          "lastStatus": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The HTTP status your endpoint last answered, or `null` (no answer: a timeout, a refused connection, or no attempt yet)."
          },
          "lastError": {
            "description": "Why the last attempt failed, in words, or `null`.",
            "type": [
              "string",
              "null"
            ]
          },
          "deliveredAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When it succeeded, or `null`.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it succeeded, or `null`."
          },
          "createdAt": {
            "type": "string",
            "description": "When it was queued.",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/WebhookPayload"
          },
          "responseExcerpt": {
            "description": "The first 1 KB of your endpoint's last answer, or `null`.",
            "type": [
              "string",
              "null"
            ]
          },
          "attemptLog": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookAttempt"
            },
            "description": "The last 10 attempts, oldest first."
          }
        },
        "required": [
          "id",
          "endpointId",
          "eventId",
          "eventType",
          "state",
          "attempts",
          "nextAttemptAt",
          "lastStatus",
          "lastError",
          "deliveredAt",
          "createdAt",
          "payload",
          "responseExcerpt",
          "attemptLog"
        ],
        "description": "One delivery in full: what was sent (byte for byte the same on every attempt), your endpoint's last answer, and the attempts.",
        "examples": [
          {
            "id": "8d2e4f6a-1b3c-4d5e-8f9a-0b1c2d3e4f5a",
            "endpointId": "3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b",
            "eventId": "5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60",
            "eventType": "site.ready",
            "state": "succeeded",
            "attempts": 1,
            "nextAttemptAt": null,
            "lastStatus": 200,
            "lastError": null,
            "deliveredAt": "2026-11-18T08:46:51.000Z",
            "createdAt": "2026-11-18T08:46:50.000Z",
            "payload": {
              "id": "5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60",
              "type": "site.ready",
              "apiVersion": "v1",
              "createdAt": "2026-11-18T08:46:49.000Z",
              "accountId": "0b9f2c1e-5d0b-4b53-9a7e-2f1a3a6d7b11",
              "data": {
                "level": "success",
                "message": "“Blog” is live at https://blog-k3x9q.rabbitflare.link",
                "actor": {
                  "type": "system",
                  "name": null
                },
                "server": {
                  "id": "6f0c6c0e-5d0b-4b53-9a7e-2f1a3a6d7b11",
                  "name": "web-1"
                },
                "site": {
                  "id": "9b1e4f2a-7c3d-4e5f-8a9b-0c1d2e3f4a5b",
                  "name": "Blog"
                },
                "mailDomain": null,
                "resource": {
                  "type": "site",
                  "id": "9b1e4f2a-7c3d-4e5f-8a9b-0c1d2e3f4a5b",
                  "url": "https://api.rabbitflare.com/v1/sites/9b1e4f2a-7c3d-4e5f-8a9b-0c1d2e3f4a5b"
                }
              }
            },
            "responseExcerpt": "ok",
            "attemptLog": [
              {
                "at": "2026-11-18T08:46:51.000Z",
                "status": 200,
                "ms": 182,
                "error": null
              }
            ]
          }
        ]
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint's id."
          },
          "url": {
            "type": "string",
            "description": "Where events are sent: an https URL on port 443 or 8443."
          },
          "description": {
            "description": "Your own note about the endpoint, or `null`.",
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An event type, or `*`."
            },
            "description": "The event types sent to it (see `GET /webhooks/event-types`), or `[\"*\"]` for every type, including types added later. An endpoint added through the API is sent only the types its token may read now."
          },
          "allServers": {
            "type": "boolean",
            "description": "Whether it gets events of every server (and of account-wide things). False: only those in `serverIds`, and account-wide events."
          },
          "serverIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The servers whose events it gets, when `allServers` is false. Empty when `allServers` is true."
          },
          "status": {
            "type": "string",
            "description": "`enabled`: events are sent to it. `disabled`: nothing is sent until it's turned on again.",
            "x-known-values": [
              "enabled",
              "disabled"
            ]
          },
          "disabledReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "Why it's off: `user` (it was turned off by hand), `token` (it went off with the API token that added it: narrowed, expired or revoked), `failing` (its deliveries kept failing, or it answered an event with 410 Gone) or `admin` (support turned it off). In the panel, turning one on again asks for your authenticator code when it went off as `token` or `admin`, or when the token that added it has ended.",
                "x-known-values": [
                  "user",
                  "token",
                  "failing",
                  "admin"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it's off: `user`, `token`, `failing` or `admin`. `null` while it's on."
          },
          "failingSince": {
            "anyOf": [
              {
                "type": "string",
                "description": "Since when its deliveries have failed with no success in between. `null`: it isn't failing. After 5 days of failures it's turned off.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Since when its deliveries have failed with no success in between. `null`: it isn't failing. After 5 days of failures it's turned off."
          },
          "lastSuccessAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When a delivery to it last succeeded, or `null`.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a delivery to it last succeeded, or `null`."
          },
          "lastFailureAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When a delivery attempt to it last failed, or `null`.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a delivery attempt to it last failed, or `null`."
          },
          "createdAt": {
            "type": "string",
            "description": "When it was added.",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "When its settings last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "events",
          "allServers",
          "serverIds",
          "status",
          "disabledReason",
          "failingSince",
          "lastSuccessAt",
          "lastFailureAt",
          "createdAt",
          "updatedAt"
        ],
        "description": "A URL of yours that is told about events. Never its signing secret: that is answered only when the endpoint is made and when the secret is rotated.",
        "examples": [
          {
            "id": "3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b",
            "url": "https://hooks.example.com/rabbitflare",
            "description": "Deploy notifications",
            "events": [
              "server.ready",
              "site.ready",
              "site.install_failed"
            ],
            "allServers": true,
            "serverIds": [],
            "status": "enabled",
            "disabledReason": null,
            "failingSince": null,
            "lastSuccessAt": "2026-11-18T09:12:03.000Z",
            "lastFailureAt": null,
            "createdAt": "2026-11-18T08:46:49.000Z",
            "updatedAt": "2026-11-18T08:46:49.000Z"
          }
        ]
      },
      "WebhookEndpointCreateInput": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Where to send events: an https URL on port 443 or 8443, with a domain name (not an IP address) that resolves to public addresses."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "description": "Your own note about the endpoint (up to 200 characters), or `null`."
          },
          "events": {
            "minItems": 1,
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "description": "An event type, or `*`."
            },
            "description": "The event types to send (see `GET /webhooks/event-types`), or `[\"*\"]` for every type this token may read, including types added later."
          },
          "allServers": {
            "description": "Send events of every server (default true, or false when `serverIds` is sent). False: only those of `serverIds`, and account-wide events.",
            "type": "boolean"
          },
          "serverIds": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
              "description": "A server's id."
            },
            "description": "The servers whose events to send, when `allServers` is false."
          }
        },
        "required": [
          "url",
          "events"
        ],
        "additionalProperties": false,
        "description": "A new webhook endpoint: where to send events and which ones. Sending `serverIds` without `allServers` limits it to those servers.",
        "examples": [
          {
            "url": "https://hooks.example.com/rabbitflare",
            "description": "Deploy notifications",
            "events": [
              "server.ready",
              "site.ready"
            ]
          }
        ]
      },
      "WebhookEndpointUpdateInput": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Where to send events: an https URL on port 443 or 8443, with a domain name (not an IP address) that resolves to public addresses."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "description": "Your own note about the endpoint (up to 200 characters), or `null`."
          },
          "events": {
            "minItems": 1,
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "description": "An event type, or `*`."
            },
            "description": "The event types to send (see `GET /webhooks/event-types`), or `[\"*\"]` for every type this token may read, including types added later."
          },
          "allServers": {
            "description": "Send events of every server. False: only those of `serverIds`.",
            "type": "boolean"
          },
          "serverIds": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
              "description": "A server's id."
            },
            "description": "The servers whose events to send, when `allServers` is false."
          },
          "status": {
            "description": "`enabled` to send it events (and clear a failing streak), `disabled` to stop.",
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          }
        },
        "additionalProperties": false,
        "description": "Changes to a webhook endpoint: only the fields sent change. Sending `serverIds` without `allServers` limits it to those servers.",
        "examples": [
          {
            "status": "enabled"
          }
        ]
      },
      "WebhookEndpointWithSecret": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint's id."
          },
          "url": {
            "type": "string",
            "description": "Where events are sent: an https URL on port 443 or 8443."
          },
          "description": {
            "description": "Your own note about the endpoint, or `null`.",
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An event type, or `*`."
            },
            "description": "The event types sent to it (see `GET /webhooks/event-types`), or `[\"*\"]` for every type, including types added later. An endpoint added through the API is sent only the types its token may read now."
          },
          "allServers": {
            "type": "boolean",
            "description": "Whether it gets events of every server (and of account-wide things). False: only those in `serverIds`, and account-wide events."
          },
          "serverIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The servers whose events it gets, when `allServers` is false. Empty when `allServers` is true."
          },
          "status": {
            "type": "string",
            "description": "`enabled`: events are sent to it. `disabled`: nothing is sent until it's turned on again.",
            "x-known-values": [
              "enabled",
              "disabled"
            ]
          },
          "disabledReason": {
            "anyOf": [
              {
                "type": "string",
                "description": "Why it's off: `user` (it was turned off by hand), `token` (it went off with the API token that added it: narrowed, expired or revoked), `failing` (its deliveries kept failing, or it answered an event with 410 Gone) or `admin` (support turned it off). In the panel, turning one on again asks for your authenticator code when it went off as `token` or `admin`, or when the token that added it has ended.",
                "x-known-values": [
                  "user",
                  "token",
                  "failing",
                  "admin"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it's off: `user`, `token`, `failing` or `admin`. `null` while it's on."
          },
          "failingSince": {
            "anyOf": [
              {
                "type": "string",
                "description": "Since when its deliveries have failed with no success in between. `null`: it isn't failing. After 5 days of failures it's turned off.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Since when its deliveries have failed with no success in between. `null`: it isn't failing. After 5 days of failures it's turned off."
          },
          "lastSuccessAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When a delivery to it last succeeded, or `null`.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a delivery to it last succeeded, or `null`."
          },
          "lastFailureAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When a delivery attempt to it last failed, or `null`.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a delivery attempt to it last failed, or `null`."
          },
          "createdAt": {
            "type": "string",
            "description": "When it was added.",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "When its settings last changed.",
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "description": "The endpoint's signing secret (`rfwhsec_` and 32 characters). Shown this once: keep it where your receiver can read it. Each delivery's `Rabbitflare-Signature` header is made with it."
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "events",
          "allServers",
          "serverIds",
          "status",
          "disabledReason",
          "failingSince",
          "lastSuccessAt",
          "lastFailureAt",
          "createdAt",
          "updatedAt",
          "secret"
        ],
        "description": "A webhook endpoint with its signing secret, answered only when the endpoint is made and when its secret is rotated.",
        "examples": [
          {
            "id": "3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b",
            "url": "https://hooks.example.com/rabbitflare",
            "description": "Deploy notifications",
            "events": [
              "server.ready",
              "site.ready",
              "site.install_failed"
            ],
            "allServers": true,
            "serverIds": [],
            "status": "enabled",
            "disabledReason": null,
            "failingSince": null,
            "lastSuccessAt": "2026-11-18T09:12:03.000Z",
            "lastFailureAt": null,
            "createdAt": "2026-11-18T08:46:49.000Z",
            "updatedAt": "2026-11-18T08:46:49.000Z",
            "secret": "rfwhsec_7Kq2mPq4Xc7Lw9Tn0Bv3YsA1b2C3d4E5"
          }
        ]
      },
      "WebhookPayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event's id: the same for every endpoint and every attempt. Remember it to ignore an event you've handled."
          },
          "type": {
            "type": "string",
            "description": "The event type.",
            "x-known-values": [
              "server.created",
              "server.ready",
              "server.provisioning_failed",
              "server.powered_on",
              "server.powered_off",
              "server.rebooted",
              "server.resized",
              "server.snapshot_created",
              "server.snapshot_deleted",
              "server.restored",
              "server.unreachable",
              "server.missing",
              "server.suspended",
              "server.resumed",
              "server.deleted",
              "server.security_enabled",
              "server.security_disabled",
              "server.security_failed",
              "site.created",
              "site.ready",
              "site.install_failed",
              "site.deleted",
              "site.delete_failed",
              "site.domain_added",
              "site.domain_verified",
              "site.domain_removed",
              "site.primary_domain_changed",
              "site.domains_updated",
              "site.domains_failed",
              "site.cdn_enabled",
              "site.cdn_disabled",
              "site.cdn_failed",
              "site.cdn_purged",
              "site.cdn_purge_failed",
              "site.cdn_hostname_ready",
              "site.cdn_hostname_failed",
              "site.cloned",
              "site.clone_failed",
              "site.resources_updated",
              "site.resources_failed",
              "site.firewall_updated",
              "site.firewall_failed",
              "media_offload.enabled",
              "media_offload.disabled",
              "media_offload.failed",
              "media_offload.run_completed",
              "media_offload.run_failed",
              "smtp.enabled",
              "smtp.disabled",
              "smtp.paused",
              "smtp.resumed",
              "rabbitpress.installed",
              "rabbitpress.removed",
              "rabbitpress.failed",
              "backup.started",
              "backup.completed",
              "backup.failed",
              "backup.restore_started",
              "backup.restored",
              "backup.restore_failed",
              "backup.delete_failed",
              "staging.created",
              "staging.refreshed",
              "staging.pushed",
              "staging.push_undone",
              "staging.failed",
              "staging.deleted",
              "staging.needs_attention",
              "malware_protection.enabled",
              "malware_protection.disabled",
              "malware.found",
              "malware.cleaned",
              "malware.warning",
              "ticket.opened",
              "ticket.answered",
              "api_token.created",
              "api_token.revoked",
              "webhook_endpoint.disabled",
              "ping"
            ]
          },
          "apiVersion": {
            "type": "string",
            "description": "The API version the payload follows: `v1`."
          },
          "createdAt": {
            "type": "string",
            "description": "When the event happened.",
            "format": "date-time"
          },
          "accountId": {
            "type": "string",
            "description": "The account it happened on."
          },
          "data": {
            "type": "object",
            "properties": {
              "level": {
                "type": "string",
                "description": "How it went: `info`, `success`, `warning` or `error`.",
                "x-known-values": [
                  "info",
                  "success",
                  "warning",
                  "error"
                ]
              },
              "message": {
                "type": "string",
                "description": "What happened, as one sentence for people."
              },
              "actor": {
                "$ref": "#/components/schemas/EventActor"
              },
              "server": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/EventSubject"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The server it was about, or `null`."
              },
              "site": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/EventSubject"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The site it was about, or `null`."
              },
              "mailDomain": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/EventSubject"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mail domain it was about, or `null`."
              },
              "resource": {
                "$ref": "#/components/schemas/WebhookResource"
              }
            },
            "required": [
              "level",
              "message",
              "actor",
              "server",
              "site",
              "mailDomain",
              "resource"
            ],
            "description": "Who did what, where, and the resource to read for the full state."
          }
        },
        "required": [
          "id",
          "type",
          "apiVersion",
          "createdAt",
          "accountId",
          "data"
        ],
        "description": "The JSON body of a webhook call. Thin on purpose: what happened, who did it, where, and a link to the resource; read the resource with the API for its full state. Signed in the `Rabbitflare-Signature` header.",
        "examples": [
          {
            "id": "5f0d2a7c-3b1e-4c8d-9a6f-2e7b1c4d5a60",
            "type": "site.ready",
            "apiVersion": "v1",
            "createdAt": "2026-11-18T08:46:49.000Z",
            "accountId": "0b9f2c1e-5d0b-4b53-9a7e-2f1a3a6d7b11",
            "data": {
              "level": "success",
              "message": "“Blog” is live at https://blog-k3x9q.rabbitflare.link",
              "actor": {
                "type": "system",
                "name": null
              },
              "server": {
                "id": "6f0c6c0e-5d0b-4b53-9a7e-2f1a3a6d7b11",
                "name": "web-1"
              },
              "site": {
                "id": "9b1e4f2a-7c3d-4e5f-8a9b-0c1d2e3f4a5b",
                "name": "Blog"
              },
              "mailDomain": null,
              "resource": {
                "type": "site",
                "id": "9b1e4f2a-7c3d-4e5f-8a9b-0c1d2e3f4a5b",
                "url": "https://api.rabbitflare.com/v1/sites/9b1e4f2a-7c3d-4e5f-8a9b-0c1d2e3f4a5b"
              }
            }
          }
        ]
      },
      "WebhookResource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The kind of thing: `site`, `server`, `domain` (a registered domain), `mail_domain`, `account`, or `webhook_endpoint` (in `webhook_endpoint.disabled`, the endpoint turned off).",
            "x-known-values": [
              "site",
              "server",
              "domain",
              "mail_domain",
              "account",
              "webhook_endpoint"
            ]
          },
          "id": {
            "type": "string",
            "description": "Its id."
          },
          "url": {
            "description": "Where to read it with the API, or `null` when there is no single resource to read. Always `null` for a `webhook_endpoint`: read it by its id (`GET /webhooks/endpoints/{id}`, with `webhooks:read`).",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "type",
          "id",
          "url"
        ],
        "description": "The most specific thing an event is about, and where to read its full state."
      },
      "WordPressLogin": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "The WordPress administrator's username."
          },
          "email": {
            "type": "string",
            "description": "The administrator's email address."
          },
          "password": {
            "anyOf": [
              {
                "type": "string",
                "description": "A password."
              },
              {
                "type": "null"
              }
            ],
            "description": "The administrator's password as Rabbitflare set it. Null when it can't be read (reset it to get a new one)."
          }
        },
        "required": [
          "username",
          "email",
          "password"
        ],
        "description": "The WordPress administrator made with the site, with its password. Changing the password inside WordPress isn't seen here.",
        "examples": [
          {
            "username": "editor",
            "email": "you@example.com",
            "password": "kV9#wq2Lx7!pRz4m"
          }
        ]
      }
    },
    "parameters": {
      "WebhookEventId": {
        "name": "Rabbitflare-Event-Id",
        "in": "header",
        "required": true,
        "description": "The event's id, as in the body's `id`: the same on every attempt and for every endpoint. Remember it to ignore an event you've handled.",
        "schema": {
          "type": "string"
        }
      },
      "WebhookEventType": {
        "name": "Rabbitflare-Event-Type",
        "in": "header",
        "required": true,
        "description": "The event type, as in the body's `type`.",
        "schema": {
          "type": "string"
        }
      },
      "WebhookDeliveryId": {
        "name": "Rabbitflare-Delivery-Id",
        "in": "header",
        "required": true,
        "description": "This delivery's id (this event sent to this endpoint), the same on every attempt: `GET /webhooks/deliveries/{deliveryId}` shows it.",
        "schema": {
          "type": "string"
        }
      },
      "WebhookDeliveryAttempt": {
        "name": "Rabbitflare-Delivery-Attempt",
        "in": "header",
        "required": true,
        "description": "Which attempt this is, from 1. A delivery sent again goes on counting.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "WebhookSignature": {
        "name": "Rabbitflare-Signature",
        "in": "header",
        "required": true,
        "description": "`t=<Unix time>,v1=<signature>`: the signature is the hex HMAC-SHA256 of `t`, a dot and the raw body, made with the endpoint's signing secret. For 24 hours after the secret is rotated, a second `v1=` made with the old secret follows. Compare in constant time, and refuse a `t` more than 5 minutes from your clock.",
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "rfp_…",
        "description": "An API token made in the panel, sent as `Authorization: Bearer rfp_…`."
      }
    },
    "headers": {
      "RequestId": {
        "description": "This request's id. Quote it to support.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimitLimit": {
        "description": "Requests allowed in the rate limit window closest to running out.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in that window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "Seconds until that window starts again.",
        "schema": {
          "type": "integer"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before trying again.",
        "schema": {
          "type": "integer"
        }
      },
      "Location": {
        "description": "The new resource's address.",
        "schema": {
          "type": "string"
        }
      },
      "Link": {
        "description": "The next page of the list, as `<url>; rel=\"next\"`. Absent on the last page.",
        "schema": {
          "type": "string"
        }
      },
      "IdempotentReplayed": {
        "description": "`true` when this is the remembered answer to an earlier request with the same Idempotency-Key.",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}