{
  "openapi": "3.0.0",
  "paths": {
    "/v1/auth/me": {
      "get": {
        "operationId": "AuthController_me",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "The signed-in user and their organization",
        "tags": [
          "account"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "account:read",
        "description": "Requires the `account:read` scope."
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "ProjectsController_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "List projects",
        "tags": [
          "account"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "account:read",
        "description": "Requires the `account:read` scope."
      }
    },
    "/v1/projects/default": {
      "get": {
        "operationId": "ProjectsController_findDefault",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "The default project",
        "tags": [
          "account"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "account:read",
        "description": "Requires the `account:read` scope."
      }
    },
    "/v1/projects/{id}": {
      "get": {
        "operationId": "ProjectsController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get a project",
        "tags": [
          "account"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "account:read",
        "description": "Requires the `account:read` scope."
      }
    },
    "/v1/resources/postgres": {
      "post": {
        "operationId": "ResourcesController_createPostgresInstance",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostgresInstanceDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Create a PostgreSQL database (account level 3)",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "databases:write",
        "description": "Requires the `databases:write` scope."
      },
      "get": {
        "operationId": "ResourcesController_findAllPostgresInstances",
        "parameters": [
          {
            "name": "project_id",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "List PostgreSQL databases",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "databases:read",
        "description": "Requires the `databases:read` scope."
      }
    },
    "/v1/resources/postgres/{id}": {
      "get": {
        "operationId": "ResourcesController_findOnePostgresInstance",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get a PostgreSQL database",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "databases:read",
        "description": "Requires the `databases:read` scope."
      }
    },
    "/v1/resources/postgres/{id}/stop": {
      "post": {
        "operationId": "ResourcesController_stopPostgresInstance",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Stop a PostgreSQL database",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "databases:write",
        "description": "Requires the `databases:write` scope."
      }
    },
    "/v1/resources/postgres/{id}/start": {
      "post": {
        "operationId": "ResourcesController_startPostgresInstance",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Start a stopped PostgreSQL database",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "databases:write",
        "description": "Requires the `databases:write` scope."
      }
    },
    "/v1/billing/usage/current": {
      "get": {
        "operationId": "MeteringController_current",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Usage so far in the current period",
        "tags": [
          "billing"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "billing:read",
        "description": "Requires the `billing:read` scope."
      }
    },
    "/v1/billing/usage/months": {
      "get": {
        "operationId": "MeteringController_months",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Months that have usage",
        "tags": [
          "billing"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "billing:read",
        "description": "Requires the `billing:read` scope."
      }
    },
    "/v1/billing/usage": {
      "get": {
        "operationId": "MeteringController_usage",
        "parameters": [
          {
            "name": "month",
            "required": false,
            "in": "query",
            "schema": {
              "pattern": "^\\d{4}-\\d{2}$",
              "type": "string"
            }
          },
          {
            "name": "project_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "product",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "pgs",
                "deploy"
              ],
              "type": "string"
            }
          },
          {
            "name": "instance_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "json",
                "csv"
              ],
              "type": "string"
            }
          },
          {
            "name": "accept-language",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "summary": "Usage detail (JSON or CSV)",
        "tags": [
          "billing"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "billing:read",
        "description": "Requires the `billing:read` scope."
      }
    },
    "/v1/billing/invoices": {
      "get": {
        "operationId": "InvoicesController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "List invoices",
        "tags": [
          "billing"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "billing:read",
        "description": "Requires the `billing:read` scope."
      }
    },
    "/v1/billing/invoices/{id}": {
      "get": {
        "operationId": "InvoicesController_detail",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get an invoice",
        "tags": [
          "billing"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "billing:read",
        "description": "Requires the `billing:read` scope."
      }
    },
    "/v1/resources/deploy": {
      "post": {
        "operationId": "SitesController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSiteDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Create a site",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:deploy",
        "description": "Requires the `sites:deploy` scope."
      },
      "get": {
        "operationId": "SitesController_findAll",
        "parameters": [
          {
            "name": "project_id",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "List sites",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:read",
        "description": "Requires the `sites:read` scope."
      }
    },
    "/v1/resources/deploy/name-availability": {
      "get": {
        "operationId": "SitesController_nameAvailability",
        "parameters": [
          {
            "name": "name",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accept-language",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Check whether a site name is free",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:read",
        "description": "Requires the `sites:read` scope."
      }
    },
    "/v1/resources/deploy/{id}": {
      "get": {
        "operationId": "SitesController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get a site",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:read",
        "description": "Requires the `sites:read` scope."
      },
      "patch": {
        "operationId": "SitesController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSiteDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Change a site (SPA mode, build settings, Git source)",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:deploy",
        "description": "Requires the `sites:deploy` scope."
      },
      "delete": {
        "operationId": "SitesController_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Delete a site",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:delete",
        "description": "Requires the `sites:delete` scope."
      }
    },
    "/v1/resources/deploy/{id}/deployments": {
      "post": {
        "operationId": "SitesController_upload",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": ""
          }
        },
        "summary": "Deploy a zip archive (multipart, field \"archive\")",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:deploy",
        "x-token-hourly-limit": "uploads",
        "description": "Requires the `sites:deploy` scope.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "archive"
                ],
                "properties": {
                  "archive": {
                    "type": "string",
                    "format": "binary",
                    "description": "A zip of the built site (index.html at its root)."
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "SitesController_listDeployments",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "List deployments",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:read",
        "description": "Requires the `sites:read` scope."
      }
    },
    "/v1/resources/deploy/{id}/redeploy": {
      "post": {
        "operationId": "SitesController_redeploy",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": ""
          }
        },
        "summary": "Build the Git source again",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:deploy",
        "description": "Requires the `sites:deploy` scope."
      }
    },
    "/v1/resources/deploy/{id}/deployments/{deploymentId}": {
      "get": {
        "operationId": "SitesController_getDeployment",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deploymentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get a deployment",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:read",
        "description": "Requires the `sites:read` scope."
      }
    },
    "/v1/resources/deploy/{id}/deployments/{deploymentId}/logs": {
      "get": {
        "operationId": "SitesController_getLogs",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deploymentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Build log of a deployment, from a byte offset",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:read",
        "description": "Requires the `sites:read` scope."
      }
    },
    "/v1/resources/deploy/{id}/deployments/{deploymentId}/activate": {
      "post": {
        "operationId": "SitesController_activate",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deploymentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Serve an earlier deployment (rollback)",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:deploy",
        "description": "Requires the `sites:deploy` scope."
      }
    },
    "/v1/resources/deploy/{id}/domains": {
      "get": {
        "operationId": "SitesController_listDomains",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accept-language",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "List custom domains",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:read",
        "description": "Requires the `sites:read` scope."
      },
      "post": {
        "operationId": "SitesController_addDomain",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accept-language",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddDomainDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Add a custom domain",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:deploy",
        "description": "Requires the `sites:deploy` scope."
      }
    },
    "/v1/resources/deploy/{id}/domains/{domainId}": {
      "patch": {
        "operationId": "SitesController_updateDomain",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accept-language",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDomainDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Change a custom domain (e.g. redirect target)",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:deploy",
        "description": "Requires the `sites:deploy` scope."
      },
      "delete": {
        "operationId": "SitesController_removeDomain",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Remove a custom domain",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:delete",
        "description": "Requires the `sites:delete` scope."
      }
    },
    "/v1/resources/deploy/{id}/domains/{domainId}/verify": {
      "post": {
        "operationId": "SitesController_verifyDomain",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accept-language",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Check the DNS records of a custom domain now",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:deploy",
        "description": "Requires the `sites:deploy` scope."
      }
    },
    "/v1/resources/deploy/{id}/analytics": {
      "get": {
        "operationId": "AnalyticsController_report",
        "summary": "Site analytics for a period",
        "description": "Visitors and server traffic of one site.\n\nRequires the `sites:read` scope.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "24h",
                "7d",
                "30d",
                "90d",
                "365d"
              ],
              "type": "string"
            }
          },
          {
            "name": "tz",
            "required": false,
            "in": "query",
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:read"
      }
    },
    "/v1/resources/deploy/{id}/deletion-request": {
      "post": {
        "operationId": "DeletionsController_site",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Request the deletion of a site; a person confirms it in the console",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:delete",
        "description": "Requires the `sites:delete` scope."
      }
    },
    "/v1/resources/deploy/{id}/domains/{domainId}/deletion-request": {
      "post": {
        "operationId": "DeletionsController_domain",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Request the removal of a domain; a person confirms it in the console",
        "tags": [
          "sites"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "sites:delete",
        "description": "Requires the `sites:delete` scope."
      }
    },
    "/v1/resources/postgres/{id}/deletion-request": {
      "post": {
        "operationId": "DeletionsController_database",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Request the deletion of a database; a person confirms it in the console",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "token": []
          }
        ],
        "x-required-scope": "databases:delete",
        "description": "Requires the `databases:delete` scope."
      }
    }
  },
  "info": {
    "title": "Sysnee Cloud API",
    "description": "The routes an access token can call. Create a token in Console → Security → Tokens, or sign in through OAuth (the sysnee CLI and MCP clients do this). Scopes: account:read, sites:read, sites:deploy, sites:delete, databases:read, databases:write, databases:delete, billing:read. Docs: https://docs.sysnee.com/tokens",
    "version": "1",
    "contact": {}
  },
  "tags": [],
  "servers": [
    {
      "url": "https://api.cloud.sysnee.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "token": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http",
        "description": "A sysnee_pat_… or sysnee_oat_… access token."
      }
    },
    "schemas": {
      "CreatePostgresInstanceDto": {
        "type": "object",
        "properties": {
          "instance_id": {
            "type": "string",
            "maxLength": 56,
            "pattern": "^[a-z][a-z0-9-]*$"
          },
          "password": {
            "type": "string",
            "minLength": 14,
            "maxLength": 128,
            "pattern": "^[\\x20-\\x7e]+$"
          },
          "version": {
            "type": "string",
            "enum": [
              "18",
              "17",
              "16"
            ]
          },
          "purpose": {
            "type": "string",
            "enum": [
              "development",
              "staging",
              "production"
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "storage_gb": {
            "type": "number",
            "minimum": 2,
            "maximum": 1024
          },
          "public_access": {
            "type": "boolean"
          },
          "allowed_cidr": {
            "type": "string",
            "pattern": "^(\\d{1,3}\\.){3}\\d{1,3}\\/\\d{1,2}$"
          },
          "project_id": {
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "password",
          "version",
          "purpose",
          "size",
          "storage_gb",
          "public_access",
          "project_id"
        ]
      },
      "GitSourceDto": {
        "type": "object",
        "properties": {
          "connection_id": {
            "type": "string"
          },
          "repo_id": {
            "type": "string",
            "pattern": "^\\d{1,20}$"
          },
          "branch": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._/-]{1,255}$"
          },
          "auto_deploy": {
            "type": "boolean"
          },
          "root_dir": {
            "type": "string",
            "pattern": "^(?!\\/)(?!.*(^|\\/)\\.\\.(\\/|$))[A-Za-z0-9._/@-]{1,200}$"
          },
          "install_command": {
            "type": "string",
            "nullable": true,
            "maxLength": 500
          },
          "build_command": {
            "type": "string",
            "nullable": true,
            "maxLength": 500
          },
          "output_dir": {
            "type": "string",
            "nullable": true,
            "pattern": "^(?!\\/)(?!.*(^|\\/)\\.\\.(\\/|$))[A-Za-z0-9._/@-]{1,200}$"
          },
          "node_version": {
            "type": "string",
            "enum": [
              "20",
              "22",
              "24"
            ]
          }
        },
        "required": [
          "connection_id",
          "repo_id",
          "branch"
        ]
      },
      "CreateSiteDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,48}[a-z0-9]$"
          },
          "project_id": {
            "type": "string"
          },
          "spa": {
            "type": "boolean"
          },
          "git": {
            "description": "Import from GitHub/GitLab instead of uploading archives.",
            "allOf": [
              {
                "$ref": "#/components/schemas/GitSourceDto"
              }
            ]
          }
        },
        "required": [
          "name",
          "project_id"
        ]
      },
      "BuildSettingsDto": {
        "type": "object",
        "properties": {
          "root_dir": {
            "type": "string",
            "pattern": "^(?!\\/)(?!.*(^|\\/)\\.\\.(\\/|$))[A-Za-z0-9._/@-]{1,200}$"
          },
          "install_command": {
            "type": "string",
            "nullable": true,
            "maxLength": 500
          },
          "build_command": {
            "type": "string",
            "nullable": true,
            "maxLength": 500
          },
          "output_dir": {
            "type": "string",
            "nullable": true,
            "pattern": "^(?!\\/)(?!.*(^|\\/)\\.\\.(\\/|$))[A-Za-z0-9._/@-]{1,200}$"
          },
          "node_version": {
            "type": "string",
            "enum": [
              "20",
              "22",
              "24"
            ]
          }
        }
      },
      "UpdateSiteDto": {
        "type": "object",
        "properties": {
          "spa": {
            "type": "boolean"
          },
          "analytics": {
            "type": "boolean",
            "description": "Visitor analytics (script injected by the edge)."
          },
          "auto_deploy": {
            "type": "boolean"
          },
          "build": {
            "$ref": "#/components/schemas/BuildSettingsDto"
          }
        }
      },
      "AddDomainDto": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "maxLength": 300
          },
          "redirect_to_id": {
            "type": "string",
            "description": "Redirect to this other domain of the site instead of serving it."
          }
        },
        "required": [
          "hostname"
        ]
      },
      "UpdateDomainDto": {
        "type": "object",
        "properties": {
          "redirect_to_id": {
            "type": "string",
            "nullable": true,
            "description": "null: serve the site; a domain id: redirect there."
          }
        },
        "required": [
          "redirect_to_id"
        ]
      }
    }
  }
}
