{
  "openapi": "3.1.0",
  "info": {
    "title": "Aegis HTTP API",
    "description": "Control Aegis deployments over HTTP. Authenticate with a session (POST /api/v1/auth/login; send X-CSRF-Token on changes) or an API token (Authorization: Bearer). Requests that change state must send `Content-Type: application/json`.",
    "license": {
      "name": ""
    },
    "version": "1"
  },
  "paths": {
    "/api/v1/apps/check-access": {
      "post": {
        "tags": [
          "sources"
        ],
        "operationId": "check_access",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckAccessRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Whether the GitHub repository can be read without credentials (`ok` false: private, or doesn't exist)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessCheckDto"
                }
              }
            }
          },
          "400": {
            "description": "Not a GitHub repository URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/import": {
      "post": {
        "tags": [
          "sources"
        ],
        "operationId": "import",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Registered (not deployed); per-app errors and next steps",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResultDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/scan": {
      "get": {
        "tags": [
          "sources"
        ],
        "operationId": "scan_info",
        "responses": {
          "200": {
            "description": "The folders scans may look in (empty: scanning is off)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanInfoDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "sources"
        ],
        "operationId": "scan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Apps found (at most 2 levels deep); nothing is changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Not inside an allowed folder",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Scanning is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "operationId": "login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Signed in; sets the aegis_session cookie",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionDto"
                }
              }
            }
          },
          "401": {
            "description": "Wrong username or password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many failed attempts; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "operationId": "logout",
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Session ended; cookie cleared"
          }
        }
      }
    },
    "/api/v1/auth/password": {
      "post": {
        "tags": [
          "auth"
        ],
        "operationId": "change_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Changed; all sessions (including this one) are ended"
          },
          "400": {
            "description": "New password too short",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Current password is wrong",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/session": {
      "get": {
        "tags": [
          "auth"
        ],
        "operationId": "session_info",
        "responses": {
          "200": {
            "description": "Who is calling; includes the CSRF token for sessions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionDto"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/backups": {
      "get": {
        "tags": [
          "backups"
        ],
        "operationId": "list_backups",
        "responses": {
          "200": {
            "description": "Backups, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BackupDto"
                  }
                }
              }
            }
          },
          "403": {
            "description": "API tokens can't manage backups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "backups"
        ],
        "operationId": "create_backup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBackupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created (older backups beyond `[backup] keep` are deleted)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupDto"
                }
              }
            }
          },
          "403": {
            "description": "API tokens can't manage backups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "The backup failed (recorded as a BackupFailed event)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/backups/{name}": {
      "delete": {
        "tags": [
          "backups"
        ],
        "operationId": "delete_backup",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Backup file name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Not a backup name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/backups/{name}/download": {
      "get": {
        "tags": [
          "backups"
        ],
        "operationId": "download_backup",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Backup file name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The archive (application/gzip)",
            "content": {
              "application/gzip": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "format": "int32",
                    "minimum": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not a backup name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/deployments": {
      "get": {
        "tags": [
          "deployments"
        ],
        "operationId": "list_deployments",
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "description": "Project id or name; all projects when omitted.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "`active` (queued or running), or a final status such as `Success`,\n`Failed` or `RolledBack`; all when omitted.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Most recent N deployments (default: all, max 1000 when `offset` is used).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Skip this many of the most recent deployments first (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Oldest first; `X-Total-Count` is the number of matches before paging",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeploymentDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/deployments/{id}": {
      "get": {
        "tags": [
          "deployments"
        ],
        "operationId": "get_deployment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Deployment id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/deployments/{id}/events": {
      "get": {
        "tags": [
          "deployments"
        ],
        "operationId": "deployment_events",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Deployment id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deployment's stage and outcome events, oldest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EventDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/deployments/{id}/log": {
      "get": {
        "tags": [
          "deployments"
        ],
        "operationId": "deployment_log",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Deployment id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lines",
            "in": "query",
            "description": "Number of lines (default 100, max 5000).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Output of the build commands",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuildLogDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/detect": {
      "post": {
        "tags": [
          "projects"
        ],
        "operationId": "detect",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DetectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settings a deployment from this source would use",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetectedDto"
                }
              }
            }
          },
          "409": {
            "description": "The source couldn't be read (e.g. clone failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/docker/containers": {
      "get": {
        "tags": [
          "docker"
        ],
        "operationId": "list_containers",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContainersDto"
                }
              }
            }
          },
          "403": {
            "description": "No Docker access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/docker/containers/{id}/logs": {
      "get": {
        "tags": [
          "docker"
        ],
        "operationId": "container_logs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Container id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lines",
            "in": "path",
            "description": "Lines to return, newest last (default 300, at most 5000).",
            "required": true,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0
            }
          },
          {
            "name": "since",
            "in": "path",
            "description": "Only output since this time (RFC 3339) or age (for example 10m).",
            "required": true,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContainerLogLineDto"
                  }
                }
              }
            }
          },
          "403": {
            "description": "No Docker access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/events": {
      "get": {
        "tags": [
          "events"
        ],
        "operationId": "list_events",
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "description": "Project id or name; all projects when omitted.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Most recent N events (default 50, max 1000).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Skip this many of the most recent events first (default 0), to read\nolder pages. The page itself is returned oldest first.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Oldest first; `X-Total-Count` is the number of visible events before paging",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EventDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/events/stream": {
      "get": {
        "tags": [
          "events"
        ],
        "operationId": "stream_events",
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "description": "Project id or name; all projects when omitted.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One SSE message per new event: `event:` is the event type, `data:` an EventDto. A `lagged` message means some events were dropped for this client.",
            "content": {
              "text/event-stream": {}
            }
          }
        }
      }
    },
    "/api/v1/groups": {
      "get": {
        "tags": [
          "groups"
        ],
        "operationId": "list_groups",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "groups"
        ],
        "operationId": "create_group",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}": {
      "get": {
        "tags": [
          "groups"
        ],
        "operationId": "get_group",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "groups"
        ],
        "operationId": "update_group",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "A member doesn't match the new repository or branch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "groups"
        ],
        "operationId": "delete_group",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted; its apps stay, now outside any group"
          },
          "409": {
            "description": "The group is being deployed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}/deploy": {
      "post": {
        "tags": [
          "groups"
        ],
        "operationId": "deploy_group",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupDeployRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Started; follow it via GET /groups/{group}/deployments or the event stream",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDeployAccepted"
                }
              }
            }
          },
          "409": {
            "description": "Already running, no members, or a member is being deployed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}/deployments": {
      "get": {
        "tags": [
          "groups"
        ],
        "operationId": "list_group_deployments",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Oldest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupDeploymentDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}/members": {
      "put": {
        "tags": [
          "groups"
        ],
        "operationId": "set_members",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "groups"
        ],
        "operationId": "add_member",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}/members/{project}": {
      "put": {
        "tags": [
          "groups"
        ],
        "operationId": "update_member",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "description": "Member project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "groups"
        ],
        "operationId": "remove_member",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "description": "Member project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}/rollback": {
      "post": {
        "tags": [
          "groups"
        ],
        "operationId": "rollback_group",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Every member the latest group deployment switched is back on its previous release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupRollbackDto"
                }
              }
            }
          },
          "409": {
            "description": "Nothing to roll back, or the group is busy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}/updates": {
      "get": {
        "tags": [
          "groups"
        ],
        "operationId": "group_updates",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every app of the group compared with the group's branch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupUpdatesDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}/updates/check": {
      "post": {
        "tags": [
          "groups"
        ],
        "operationId": "check_group_updates",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Checked now (one fetch for the whole group)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupUpdatesDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}/webhook": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "operationId": "webhook_status",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook setup and recent deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupWebhookStatusDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "webhooks"
        ],
        "operationId": "rotate_webhook_secret",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "New secret, shown only in this response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groups/{group}/webhook/test": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "operationId": "test_webhook",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A signed ping went through the group's webhook endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResult"
                }
              }
            }
          },
          "409": {
            "description": "No webhook secret yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/host": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "host",
        "responses": {
          "200": {
            "description": "Host CPU, memory, disk and load (sampled every few seconds)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/host/metrics": {
      "get": {
        "tags": [
          "resources"
        ],
        "operationId": "host_metrics",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "description": "How far back: e.g. `5m`, `15m` (default), `1h`, `6h`, `24h`, `7d`.\nUp to an hour uses 2-second samples; longer uses per-minute rollups.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "points",
            "in": "query",
            "description": "Maximum number of points (default 300, max 2000).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Host CPU (in cores) and memory history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetricsDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/metrics/stream": {
      "get": {
        "tags": [
          "resources"
        ],
        "operationId": "stream_metrics",
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "description": "Only this project (id or name); every app and the host when omitted.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "host",
            "in": "query",
            "description": "With `project`, also send host samples.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`sample` messages, `{\"series\": <project id or \"host\">, \"sample\": SampleDto}`, every sample interval (2 s by default)",
            "content": {
              "text/event-stream": {}
            }
          }
        }
      }
    },
    "/api/v1/processes": {
      "get": {
        "tags": [
          "processes"
        ],
        "operationId": "list_processes",
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "description": "Project id or name; all projects when omitted.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProcessDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/processes/{target}/logs": {
      "get": {
        "tags": [
          "processes"
        ],
        "operationId": "get_logs",
        "parameters": [
          {
            "name": "target",
            "in": "path",
            "description": "Process id, or a project id/name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lines",
            "in": "query",
            "description": "Number of lines (default 100, max 5000).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogsDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/processes/{target}/logs/stream": {
      "get": {
        "tags": [
          "processes"
        ],
        "operationId": "stream_logs",
        "parameters": [
          {
            "name": "target",
            "in": "path",
            "description": "Process id, or a project id/name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lines",
            "in": "query",
            "description": "Number of lines (default 100, max 5000).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`log` messages (LogLineDto): first the requested history, then new lines as they are written (including after a later start). An `end` message follows the history when the daemon isn't supervising the process, so no new lines can arrive.",
            "content": {
              "text/event-stream": {}
            }
          }
        }
      }
    },
    "/api/v1/processes/{target}/{action}": {
      "post": {
        "tags": [
          "processes"
        ],
        "operationId": "process_action",
        "parameters": [
          {
            "name": "target",
            "in": "path",
            "description": "Process id, or a project id/name for its current process",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "path",
            "description": "start, stop or restart",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "E.g. already running, or not the live release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects": {
      "get": {
        "tags": [
          "projects"
        ],
        "operationId": "list_projects",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "projects"
        ],
        "operationId": "create_project",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}": {
      "get": {
        "tags": [
          "projects"
        ],
        "operationId": "get_project",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "projects"
        ],
        "operationId": "delete_project",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "The app's name (or id), repeated to confirm the deletion.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keep_releases",
            "in": "query",
            "description": "Keep the release directories and logs on disk (under\n`<data_dir>/projects/<id>`); they are deleted by default.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted: its processes are stopped, its domains, secrets, deploy key, webhook secret and schedule are gone, and its name and domains can be used again. Its events stay in the history.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedProjectDto"
                }
              }
            }
          },
          "400": {
            "description": "`confirm` doesn't match the app's name or id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Not an admin, or an API token (signed-in users only)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "A deployment of the app is queued or running",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/deploy": {
      "post": {
        "tags": [
          "deployments"
        ],
        "operationId": "deploy",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeployRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Queued; follow it via /deployments/{id} or the event stream",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployAccepted"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/deploy-key": {
      "get": {
        "tags": [
          "sources"
        ],
        "operationId": "get_deploy_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The public key (the private key is never returned)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployKeyDto"
                }
              }
            }
          },
          "404": {
            "description": "No deploy key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "sources"
        ],
        "operationId": "create_deploy_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeployKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Generated (Ed25519); add the public key to the repository, read-only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployKeyDto"
                }
              }
            }
          },
          "409": {
            "description": "The app already has a key; send replace: true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "sources"
        ],
        "operationId": "delete_deploy_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted; also remove it from the repository's deploy keys"
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/deploy-key/test": {
      "post": {
        "tags": [
          "sources"
        ],
        "operationId": "test_deploy_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "`git ls-remote` with the key; `ok` false carries git's error and a hint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessCheckDto"
                }
              }
            }
          },
          "409": {
            "description": "No deploy key, or the source can't use one",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/domains": {
      "get": {
        "tags": [
          "domains"
        ],
        "operationId": "list_domains",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DomainDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "domains"
        ],
        "operationId": "map_domain",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MapDomainRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Mapped. With tls = \"acme\", the certificate is requested in the background; the domain's DNS must point to this server and port 80 must be reachable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid domain, TLS mode or certificate files",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "API tokens can't change domains",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The domain belongs to another app",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/domains/{domain}": {
      "delete": {
        "tags": [
          "domains"
        ],
        "operationId": "unmap_domain",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "description": "The mapped domain",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No longer served"
          },
          "403": {
            "description": "API tokens can't change domains",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/env": {
      "get": {
        "tags": [
          "secrets"
        ],
        "operationId": "env_overview",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Variable names and where each comes from: the env file (read now), aegis.toml, Variables, Secrets. Values are never returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvOverviewDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/env/import": {
      "post": {
        "tags": [
          "secrets"
        ],
        "operationId": "import_env",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnvImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Imported as Variables (settings) and Secrets; applies to the next deployment (Variables) or restart (Secrets)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvImportResult"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/env/import/preview": {
      "post": {
        "tags": [
          "secrets"
        ],
        "operationId": "preview_env_import",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnvImportPreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The variables in the file with a suggested type (values are not returned)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvImportPreviewDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid syntax; the message names the line, never a value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/hide": {
      "put": {
        "tags": [
          "access"
        ],
        "operationId": "hide_project",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "The app is hidden from everyone until their session unlocks it; this session stays unlocked"
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "access"
        ],
        "operationId": "unhide_project",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The app is visible again (to whoever may see it)"
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/jobs": {
      "get": {
        "tags": [
          "jobs"
        ],
        "operationId": "list_jobs",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "jobs"
        ],
        "operationId": "create_job",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJobRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The app already has a job with that name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/jobs/{job}": {
      "put": {
        "tags": [
          "jobs"
        ],
        "operationId": "update_job",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "job",
            "in": "path",
            "description": "Job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateJobRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "jobs"
        ],
        "operationId": "delete_job",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "job",
            "in": "path",
            "description": "Job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted with its run history"
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/jobs/{job}/run": {
      "post": {
        "tags": [
          "jobs"
        ],
        "operationId": "run_job",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "job",
            "in": "path",
            "description": "Job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Started; follow it with GET .../runs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobRunDto"
                }
              }
            }
          },
          "409": {
            "description": "The job is already running, or the app has no live release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/jobs/{job}/runs": {
      "get": {
        "tags": [
          "jobs"
        ],
        "operationId": "list_job_runs",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "job",
            "in": "path",
            "description": "Job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Newest first; the last 50 runs are kept",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobRunDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/lock": {
      "post": {
        "tags": [
          "access"
        ],
        "operationId": "lock_project",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "The app is hidden again for this session"
          }
        }
      }
    },
    "/api/v1/projects/{project}/metrics": {
      "get": {
        "tags": [
          "resources"
        ],
        "operationId": "project_metrics",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "How far back: e.g. `5m`, `15m` (default), `1h`, `6h`, `24h`, `7d`.\nUp to an hour uses 2-second samples; longer uses per-minute rollups.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "points",
            "in": "query",
            "description": "Maximum number of points (default 300, max 2000).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CPU and memory history with the limits in effect",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetricsDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/releases": {
      "get": {
        "tags": [
          "deployments"
        ],
        "operationId": "list_releases",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Oldest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReleaseDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/resources": {
      "get": {
        "tags": [
          "resources"
        ],
        "operationId": "get_resources",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResourcesDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "resources"
        ],
        "operationId": "set_resources",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetResourcesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Applied to the running app at once (no restart) and to every later start",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResourcesDto"
                }
              }
            }
          },
          "400": {
            "description": "Out of range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "`confirmation_required`: repeat with `force: true`; `failed_precondition`: not supported on this host or refused by the kernel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/rollback": {
      "post": {
        "tags": [
          "deployments"
        ],
        "operationId": "rollback",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RollbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The earlier release is live",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RollbackResult"
                }
              }
            }
          },
          "409": {
            "description": "Nothing to roll back to, or the release didn't become healthy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/schedule": {
      "put": {
        "tags": [
          "projects"
        ],
        "operationId": "set_schedule",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/secrets": {
      "get": {
        "tags": [
          "secrets"
        ],
        "operationId": "list_secrets",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Secret names (values are never returned)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SecretDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/secrets/{name}": {
      "put": {
        "tags": [
          "secrets"
        ],
        "operationId": "set_secret",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "Variable name, e.g. DATABASE_URL",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetSecretRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored encrypted; applies when the app next starts or restarts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretSaved"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "secrets"
        ],
        "operationId": "delete_secret",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "Variable name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted; the running process keeps it until restarted"
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/settings": {
      "put": {
        "tags": [
          "projects"
        ],
        "operationId": "update_settings",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved; applies to the next deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/settings/preview": {
      "post": {
        "tags": [
          "projects"
        ],
        "operationId": "preview_settings",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "aegis.toml before and after the proposed settings, with a line diff",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigPreviewDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/source": {
      "put": {
        "tags": [
          "projects"
        ],
        "operationId": "change_source",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeSourceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved; the next deployment uses the new source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/unlock": {
      "post": {
        "tags": [
          "access"
        ],
        "operationId": "unlock_project",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnlockRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "The app is visible to this session until it ends"
          },
          "403": {
            "description": "Wrong app or password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many wrong passwords; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/updates": {
      "get": {
        "tags": [
          "projects"
        ],
        "operationId": "project_updates",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The latest check (one is run if there is none yet)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatesDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/updates/check": {
      "post": {
        "tags": [
          "projects"
        ],
        "operationId": "check_project_updates",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Checked now (a repository is fetched at most every 3 s; apps of one repository share the fetch)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatesDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/verify": {
      "post": {
        "tags": [
          "deployments"
        ],
        "operationId": "verify_project",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The URL was requested once. `ok` says whether the answer was accepted; when not, `status` or `error` and `error_code` say why, and `rolled_back_to` names the release put back when `rollback` was set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveCheckDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The app has no live release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/webhook": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "operationId": "webhook_status",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook setup and recent deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookStatusDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "webhooks"
        ],
        "operationId": "rotate_webhook_secret",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "New secret, shown only in this response; the previous secret stops working",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/webhook/test": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "operationId": "test_webhook",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id or name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Empty object `{}`",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A signed ping went through the webhook endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResult"
                }
              }
            }
          },
          "409": {
            "description": "No webhook secret yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proxy": {
      "get": {
        "tags": [
          "domains"
        ],
        "operationId": "proxy_status",
        "responses": {
          "200": {
            "description": "Listeners, routes and certificates of the built-in proxy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProxyStatusDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/resources": {
      "get": {
        "tags": [
          "resources"
        ],
        "operationId": "capabilities",
        "responses": {
          "200": {
            "description": "Whether this host can enforce limits, and how much is committed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceCapabilitiesDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/status": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "status",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/grafana-dashboard": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "grafana_dashboard",
        "responses": {
          "200": {
            "description": "A Grafana dashboard (import it in Grafana: Dashboards → New → Import) for the metrics at /metrics",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/v1/system/prometheus": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "prometheus_status",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrometheusDto"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "system"
        ],
        "operationId": "set_prometheus",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPrometheusRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrometheusDto"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/storage": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "storage",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageDto"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/storage/auto": {
      "put": {
        "tags": [
          "system"
        ],
        "operationId": "set_auto",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoCleanupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/storage/cleanup": {
      "post": {
        "tags": [
          "system"
        ],
        "operationId": "cleanup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CleanupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CleanupDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/update": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "update_status",
        "responses": {
          "200": {
            "description": "Whether a newer release is available (cached; checked every `[update] interval_hours`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateStatusDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/update/apply": {
      "post": {
        "tags": [
          "system"
        ],
        "operationId": "apply_update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Started: backup, download and verification, binary swap, restart. Follow `phase` in GET /api/v1/system/update; the daemon restarts at the end",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateStatusDto"
                }
              }
            }
          },
          "403": {
            "description": "Admins only (signed-in users, not API tokens)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Nothing to apply, already running, checks disabled, or this machine needs the update run by an administrator (see the message)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/update/check": {
      "post": {
        "tags": [
          "system"
        ],
        "operationId": "check_update",
        "responses": {
          "200": {
            "description": "Checked GitHub now; a failed check is reported in `check_error`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateStatusDto"
                }
              }
            }
          },
          "403": {
            "description": "Admins only (signed-in users, not API tokens)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Update checks are disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tokens": {
      "get": {
        "tags": [
          "auth"
        ],
        "operationId": "list_tokens",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TokenDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth"
        ],
        "operationId": "create_token",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The token is shown only in this response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewTokenDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tokens/{id}": {
      "delete": {
        "tags": [
          "auth"
        ],
        "operationId": "revoke_token",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Token id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users": {
      "get": {
        "tags": [
          "users"
        ],
        "operationId": "list_users",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "users"
        ],
        "operationId": "create_user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "The username is taken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{username}": {
      "put": {
        "tags": [
          "users"
        ],
        "operationId": "update_user",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Would leave no admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "users"
        ],
        "operationId": "delete_user",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted; their sessions end"
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Would leave no admin, or deleting yourself",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/hooks/github/groups/{group}": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "operationId": "github_group_webhook",
        "parameters": [
          {
            "name": "group",
            "in": "path",
            "description": "Group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "GitHub webhook payload, signed with X-Hub-Signature-256",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "ping, or a redelivery that was already handled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResult"
                }
              }
            }
          },
          "202": {
            "description": "Push to the group's branch: group deployment of the changed apps started (or event ignored)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Unknown group or no webhook configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/hooks/github/{project}": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "operationId": "github_webhook",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "description": "Project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "GitHub webhook payload, signed with X-Hub-Signature-256",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "ping, or a redelivery that was already handled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResult"
                }
              }
            }
          },
          "202": {
            "description": "Push to the project's branch: deployment queued (or event ignored)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Unknown project or no webhook configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AccessCheckDto": {
        "type": "object",
        "description": "Whether a repository could be read (`git ls-remote`).",
        "required": [
          "ok",
          "url",
          "with_deploy_key",
          "branches"
        ],
        "properties": {
          "branch_found": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the app's branch exists (when known)."
          },
          "branches": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Branches seen (when `ok`)."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "git's error message (never key material)."
          },
          "hint": {
            "type": [
              "string",
              "null"
            ],
            "description": "What to do next."
          },
          "ok": {
            "type": "boolean"
          },
          "url": {
            "type": "string",
            "description": "The URL that was checked."
          },
          "with_deploy_key": {
            "type": "boolean"
          }
        }
      },
      "AddMemberRequest": {
        "type": "object",
        "properties": {
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "description": "1-based place in the deploy order; default: last.",
            "default": null,
            "minimum": 0
          },
          "project": {
            "type": "string",
            "description": "Project id or name.",
            "default": ""
          },
          "watch_paths": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": []
          }
        },
        "additionalProperties": false
      },
      "AppStorageDto": {
        "type": "object",
        "required": [
          "project_id",
          "name",
          "releases_bytes",
          "old_builds_bytes",
          "logs_bytes"
        ],
        "properties": {
          "logs_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "name": {
            "type": "string"
          },
          "old_builds_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "project_id": {
            "type": "string"
          },
          "releases_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ApplyUpdateRequest": {
        "type": "object",
        "properties": {
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The version the operator confirmed (e.g. `v0.2.0`); refused if the\nlatest known release is a different one."
          }
        }
      },
      "AutoCleanupRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "log_days": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "1 to 3650.",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "BackupDto": {
        "type": "object",
        "description": "A backup archive.",
        "required": [
          "name",
          "path",
          "size_bytes",
          "created_at",
          "includes_releases",
          "aegis_version",
          "file_count"
        ],
        "properties": {
          "aegis_version": {
            "type": "string",
            "description": "The Aegis version that made it."
          },
          "created_at": {
            "type": "string",
            "description": "RFC 3339."
          },
          "file_count": {
            "type": "integer",
            "minimum": 0
          },
          "includes_releases": {
            "type": "boolean",
            "description": "False for database-and-keys-only backups."
          },
          "name": {
            "type": "string",
            "description": "File name, e.g. `aegis-backup-20261016T030000000Z.tar.gz`."
          },
          "path": {
            "type": "string",
            "description": "Where the archive is on the server (for `aegis-daemon admin restore`)."
          },
          "problem": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when the archive can't be read (it can still be deleted)."
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "BuildLogDto": {
        "type": "object",
        "required": [
          "deployment_id",
          "lines"
        ],
        "properties": {
          "deployment_id": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CertStatusDto": {
        "type": "object",
        "description": "The certificate state of a domain.",
        "required": [
          "state"
        ],
        "properties": {
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "not_after": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the served certificate expires (RFC 3339)."
          },
          "state": {
            "type": "string",
            "description": "\"valid\", \"expiring\" (renewal due), \"expired\", \"pending\" (being\nrequested), \"error\", \"disabled\" (ACME is off) or \"off\" (HTTP only)."
          }
        }
      },
      "ChangePasswordRequest": {
        "type": "object",
        "required": [
          "current_password",
          "new_password"
        ],
        "properties": {
          "current_password": {
            "type": "string"
          },
          "new_password": {
            "type": "string",
            "description": "At least 12 characters."
          }
        },
        "additionalProperties": false
      },
      "ChangeSourceRequest": {
        "type": "object",
        "description": "A new source for an existing app: a git repository (`repository_url`,\noptional `branch` and `source_subdir`) or a folder on the server\n(`source_dir`, optional `source_subdir`). Give exactly one of\n`repository_url` and `source_dir`. Validated like registration; takes\neffect at the next deployment.",
        "properties": {
          "branch": {
            "type": [
              "string",
              "null"
            ],
            "description": "Branch to deploy (default: the app's current branch, else main).",
            "default": null
          },
          "repository_url": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "source_dir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Absolute path of a folder on the server.",
            "default": null
          },
          "source_subdir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Build and run only this folder of the source (monorepos).",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "CheckAccessRequest": {
        "type": "object",
        "properties": {
          "branch": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "repository_url": {
            "type": "string",
            "description": "A GitHub repository URL (any form).",
            "default": ""
          }
        },
        "additionalProperties": false
      },
      "CleanupDto": {
        "type": "object",
        "required": [
          "freed_bytes",
          "freed"
        ],
        "properties": {
          "freed": {
            "type": "object",
            "description": "Bytes freed per target.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "freed_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "CleanupRequest": {
        "type": "object",
        "properties": {
          "targets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Any of old_builds, logs, backups, temp. Empty: all of them."
          }
        },
        "additionalProperties": false
      },
      "CommitDto": {
        "type": "object",
        "required": [
          "sha",
          "author",
          "date",
          "message"
        ],
        "properties": {
          "author": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "description": "ISO 8601."
          },
          "message": {
            "type": "string"
          },
          "sha": {
            "type": "string"
          }
        }
      },
      "ConfigPreviewDto": {
        "type": "object",
        "description": "The project's aegis.toml with current and proposed settings applied.",
        "required": [
          "base",
          "current",
          "proposed",
          "diff",
          "changed"
        ],
        "properties": {
          "base": {
            "type": "string",
            "description": "\"source\" (the project's directory), \"release\" (the live release) or\n\"none\" (no aegis.toml yet)."
          },
          "changed": {
            "type": "boolean"
          },
          "current": {
            "type": "string"
          },
          "diff": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiffLineDto"
            }
          },
          "proposed": {
            "type": "string"
          }
        }
      },
      "ContainerDto": {
        "type": "object",
        "required": [
          "id",
          "name",
          "image",
          "state",
          "status",
          "ports",
          "created",
          "managed"
        ],
        "properties": {
          "created": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "image": {
            "type": "string"
          },
          "managed": {
            "type": "boolean",
            "description": "Started by this Aegis for one of its apps."
          },
          "name": {
            "type": "string"
          },
          "ports": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "description": "running, exited, paused, created, restarting, ..."
          },
          "status": {
            "type": "string",
            "description": "For example \"Up 3 hours\"."
          }
        }
      },
      "ContainerLogLineDto": {
        "type": "object",
        "required": [
          "timestamp",
          "stream",
          "line"
        ],
        "properties": {
          "line": {
            "type": "string"
          },
          "stream": {
            "type": "string",
            "description": "\"out\" or \"err\"."
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "ContainersDto": {
        "type": "object",
        "required": [
          "available",
          "containers"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "False when Docker isn't installed or can't be reached; see `reason`."
          },
          "containers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContainerDto"
            }
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CreateBackupRequest": {
        "type": "object",
        "properties": {
          "include_releases": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Include release directories. Defaults to `[backup] include_releases`."
          }
        }
      },
      "CreateDeployKeyRequest": {
        "type": "object",
        "properties": {
          "replace": {
            "type": "boolean",
            "description": "Replace an existing key (it stops working once removed from the\nrepository). Without it, an existing key makes this a 409.",
            "default": false
          }
        },
        "additionalProperties": false
      },
      "CreateJobRequest": {
        "type": "object",
        "required": [
          "name",
          "schedule",
          "command"
        ],
        "properties": {
          "command": {
            "type": "string",
            "description": "Run with `sh -c` in the live release's directory, with the app's\nvariables and secrets. Output (stdout and stderr) is kept."
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Default true."
          },
          "name": {
            "type": "string",
            "description": "1-64 letters, digits, spaces, `.`, `_`, `-`; unique within the app."
          },
          "schedule": {
            "type": "string",
            "description": "`*/15 * * * *`, `0 3 * * 1-5`, `@daily`... (UTC)."
          },
          "timeout_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Killed (with its child processes) after this many seconds (1-86400, default 3600).",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "CreateProjectRequest": {
        "type": "object",
        "properties": {
          "branch": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "name": {
            "type": "string",
            "default": ""
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reuse an existing project id (e.g. from aegis.toml).",
            "default": null
          },
          "repository_url": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "runtime": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "source_dir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Directory on the server that deployments copy code from.",
            "default": null
          },
          "source_subdir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Build and run only this folder of the source, e.g. `apps/web` in a\nmonorepo (relative, no `..`).",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "CreateTokenRequest": {
        "type": "object",
        "required": [
          "name",
          "scope"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "description": "\"read\" (GET requests only) or \"deploy\" (everything except managing tokens and passwords)."
          }
        },
        "additionalProperties": false
      },
      "CreateUserRequest": {
        "type": "object",
        "required": [
          "username",
          "password",
          "role"
        ],
        "properties": {
          "all_apps": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true` (the default) lets the user see every app."
          },
          "apps": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Names or ids of the only apps the user may see (not for admins).\nApps added later are not included until you add them."
          },
          "docker_access": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Let the user see the server's Docker containers and logs (off by default)."
          },
          "password": {
            "type": "string",
            "description": "At least 12 characters. Give it to the person out of band; they can\nchange it after signing in."
          },
          "role": {
            "type": "string",
            "description": "\"viewer\", \"deployer\" or \"admin\"."
          },
          "username": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "DeletedProjectDto": {
        "type": "object",
        "description": "What deleting an app did.",
        "required": [
          "project_id",
          "name",
          "stopped_processes",
          "domains",
          "secrets_removed",
          "releases_kept"
        ],
        "properties": {
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Domains the built-in proxy no longer serves; they can be mapped\nto another app right away."
          },
          "kept_dir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where they are, with `keep_releases`."
          },
          "name": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "releases_kept": {
            "type": "boolean",
            "description": "The release directories and logs were kept on disk."
          },
          "secrets_removed": {
            "type": "integer",
            "format": "int64",
            "description": "Secrets that were deleted.",
            "minimum": 0
          },
          "stopped_processes": {
            "type": "integer",
            "description": "Processes (instances, standby) that were stopped.",
            "minimum": 0
          }
        }
      },
      "DeployAccepted": {
        "type": "object",
        "required": [
          "deployment_id",
          "project_id",
          "project_name"
        ],
        "properties": {
          "deployment_id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "project_name": {
            "type": "string"
          }
        }
      },
      "DeployKeyDto": {
        "type": "object",
        "description": "A deploy key's public half. The private key is never returned.",
        "required": [
          "public_key",
          "fingerprint",
          "created_at"
        ],
        "properties": {
          "add_key_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where to add the key, for GitHub repositories."
          },
          "clone_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The URL deployments clone with this key (GitHub HTTPS URLs are\nconverted to SSH); `null` when the app's source can't use a key."
          },
          "created_at": {
            "type": "string"
          },
          "fingerprint": {
            "type": "string",
            "description": "`SHA256:...`, as GitHub shows it."
          },
          "public_key": {
            "type": "string",
            "description": "One line, `ssh-ed25519 AAAA... aegis:<app>`: add it to the\nrepository's deploy keys (read-only)."
          }
        }
      },
      "DeployRequest": {
        "type": "object",
        "properties": {
          "branch": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "commit": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "repository_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Clone this repository instead of the project's default source.",
            "default": null
          },
          "source_dir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Copy code from this server directory instead of the project's default source.",
            "default": null
          },
          "strategy": {
            "type": [
              "string",
              "null"
            ],
            "description": "GracefulSwitch (default: the project's setting, else GracefulSwitch),\nImmediate, Rolling or BlueGreen. Rolling and BlueGreen need the app\nto be served by the built-in proxy.",
            "default": null
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release name; generated from the current time when omitted.",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "DeploymentDto": {
        "type": "object",
        "required": [
          "id",
          "project_id",
          "strategy",
          "status",
          "created_at"
        ],
        "properties": {
          "completed_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "release_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last pipeline stage reached."
          },
          "status": {
            "type": "string",
            "description": "Queued, InProgress, Success, Failed or RolledBack."
          },
          "strategy": {
            "type": "string"
          },
          "trigger": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DetectRequest": {
        "type": "object",
        "properties": {
          "branch": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "project": {
            "type": [
              "string",
              "null"
            ],
            "description": "A registered app (id or name) whose deploy key is used to clone,\nand whose source folder is the default.",
            "default": null
          },
          "repository_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "...a git repository to clone (shallow) for detection.",
            "default": null
          },
          "source_dir": {
            "type": [
              "string",
              "null"
            ],
            "description": "A directory on the server, or...",
            "default": null
          },
          "source_subdir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Look inside this folder of the source (monorepo apps).",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "DetectedDto": {
        "type": "object",
        "description": "The settings a deployment from this source would use.",
        "required": [
          "name",
          "runtime",
          "start_command",
          "strategy"
        ],
        "properties": {
          "build_command": {
            "type": [
              "string",
              "null"
            ]
          },
          "health_check_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "install_command": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "runtime": {
            "type": "string"
          },
          "start_command": {
            "type": "string"
          },
          "start_hint": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StartHintDto",
                "description": "The package.json start script hard-codes its port: use\n`suggested_start` (reads `$PORT`) as the start command, and `port`."
              }
            ]
          },
          "strategy": {
            "type": "string"
          },
          "test_command": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DiffLineDto": {
        "type": "object",
        "required": [
          "op",
          "text"
        ],
        "properties": {
          "op": {
            "type": "string",
            "description": "\" \" unchanged, \"-\" removed, \"+\" added."
          },
          "text": {
            "type": "string"
          }
        }
      },
      "DockerStatusDto": {
        "type": "object",
        "description": "Whether container apps (`[run] runtime = \"docker\"`) can run here.",
        "required": [
          "available"
        ],
        "properties": {
          "available": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why Docker can't be used (not installed, daemon not running, no permission)."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Docker Engine version."
          }
        }
      },
      "DomainDto": {
        "type": "object",
        "required": [
          "domain",
          "tls",
          "created_at"
        ],
        "properties": {
          "cert": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CertStatusDto",
                "description": "Absent while the proxy is disabled."
              }
            ]
          },
          "cert_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "domain": {
            "type": "string",
            "description": "Lowercase hostname."
          },
          "key_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "tls": {
            "type": "string",
            "description": "\"acme\", \"files\" or \"off\"."
          }
        }
      },
      "EnvFileStatusDto": {
        "type": "object",
        "description": "An app's env file as the daemon sees it right now.",
        "required": [
          "path",
          "readable",
          "names"
        ],
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it can't be used, e.g. permission denied (never contains values)."
          },
          "names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Variable names it defines (values are never returned)."
          },
          "path": {
            "type": "string"
          },
          "readable": {
            "type": "boolean",
            "description": "The file was read and parsed just now."
          }
        }
      },
      "EnvImportCandidateDto": {
        "type": "object",
        "description": "A variable found in the pasted file. Its value is not returned.",
        "required": [
          "name",
          "suggested",
          "reason",
          "multiline"
        ],
        "properties": {
          "exists_as": {
            "type": [
              "string",
              "null"
            ],
            "description": "`variable` or `secret` when the app already has this name."
          },
          "multiline": {
            "type": "boolean",
            "description": "The value spans several lines (only possible as a secret)."
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "description": "Why this is suggested."
          },
          "suggested": {
            "type": "string",
            "description": "`variable`, `secret` or `skip`."
          }
        }
      },
      "EnvImportPreviewDto": {
        "type": "object",
        "required": [
          "variables"
        ],
        "properties": {
          "variables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnvImportCandidateDto"
            }
          }
        }
      },
      "EnvImportPreviewRequest": {
        "type": "object",
        "description": "The contents of a `.env` file, pasted or read in the browser.",
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "dotenv text, at most 1 MiB. Never stored or logged."
          }
        },
        "additionalProperties": false
      },
      "EnvImportRequest": {
        "type": "object",
        "required": [
          "content",
          "choices"
        ],
        "properties": {
          "choices": {
            "type": "object",
            "description": "Name -> `variable`, `secret` or `skip`. Names not listed are skipped.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "content": {
            "type": "string",
            "description": "The same dotenv text as for the preview; parsed again on the server."
          }
        },
        "additionalProperties": false
      },
      "EnvImportResult": {
        "type": "object",
        "required": [
          "variables",
          "secrets",
          "skipped",
          "restart_required"
        ],
        "properties": {
          "restart_required": {
            "type": "boolean",
            "description": "The running process still has the old environment; restart it to apply secrets."
          },
          "secrets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Saved as Secrets (encrypted). A Variable of the same name was removed."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Saved as Variables (written into the next release's aegis.toml)."
          }
        }
      },
      "EnvOverviewDto": {
        "type": "object",
        "description": "Names and sources of an app's environment variables. Values are never\nincluded. Precedence, lowest first: env file, `[env]` in aegis.toml,\nVariables, Secrets, then `PORT`.",
        "required": [
          "env_file_dirs",
          "variables"
        ],
        "properties": {
          "env_file": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EnvFileStatusDto"
              }
            ]
          },
          "env_file_dirs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Directories env files may be in (`[apps] env_file_dirs`); empty\nmeans env files are turned off on this server."
          },
          "variables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnvSourceDto"
            }
          }
        }
      },
      "EnvSourceDto": {
        "type": "object",
        "description": "One variable the app gets and where its value comes from.",
        "required": [
          "name",
          "source",
          "overrides",
          "build"
        ],
        "properties": {
          "build": {
            "type": "boolean",
            "description": "Build commands see it (env file, `[env]` and Variables; not Secrets)."
          },
          "name": {
            "type": "string"
          },
          "overrides": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Lower-precedence sources that also define it and are overridden."
          },
          "source": {
            "type": "string",
            "description": "`env_file`, `aegis_toml`, `variable`, `secret`, or `aegis` (`PORT`,\nwhich Aegis sets; an env file's `PORT` is ignored)."
          }
        }
      },
      "ErrorBody": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        }
      },
      "ErrorDetail": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "not_found, invalid_argument, failed_precondition, forbidden or internal."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "EventDto": {
        "type": "object",
        "required": [
          "id",
          "event_type",
          "created_at",
          "payload"
        ],
        "properties": {
          "created_at": {
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "payload": {
            "type": "object"
          }
        }
      },
      "GroupDeployAccepted": {
        "type": "object",
        "required": [
          "group_deployment_id",
          "group_id"
        ],
        "properties": {
          "group_deployment_id": {
            "type": "string"
          },
          "group_id": {
            "type": "string"
          }
        }
      },
      "GroupDeployRequest": {
        "type": "object",
        "properties": {
          "commit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Commit to deploy every member at (default: the branch's latest).",
            "default": null
          },
          "only_changed": {
            "type": "boolean",
            "description": "Deploy only members whose watch paths match files changed since\ntheir live commit (members not deployed yet always deploy). Default true.",
            "default": true
          }
        },
        "additionalProperties": false
      },
      "GroupDeploymentDto": {
        "type": "object",
        "description": "A deployment of a whole group at one commit.",
        "required": [
          "id",
          "group_id",
          "only_changed",
          "status",
          "members",
          "created_at"
        ],
        "properties": {
          "commit": {
            "type": [
              "string",
              "null"
            ]
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupMemberRunDto"
            }
          },
          "only_changed": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "description": "Running, Success, Failed or RolledBack."
          },
          "trigger": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "GroupDto": {
        "type": "object",
        "required": [
          "id",
          "name",
          "repository_url",
          "branch",
          "rollback_on_failure",
          "members",
          "created_at",
          "webhook_configured"
        ],
        "properties": {
          "branch": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_deployment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GroupDeploymentDto"
              }
            ]
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupMemberDto"
            },
            "description": "In deploy order."
          },
          "name": {
            "type": "string"
          },
          "repository_url": {
            "type": "string"
          },
          "rollback_on_failure": {
            "type": "boolean",
            "description": "When a member fails, the members already switched in that group\ndeployment go back to their previous release."
          },
          "webhook_configured": {
            "type": "boolean",
            "description": "A webhook secret exists for the group."
          }
        }
      },
      "GroupMemberDto": {
        "type": "object",
        "description": "A member app of a group.",
        "required": [
          "project_id",
          "name",
          "watch_paths",
          "position"
        ],
        "properties": {
          "commit": {
            "type": [
              "string",
              "null"
            ],
            "description": "The commit its live release was built from."
          },
          "current_release": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "description": "1-based place in the deploy order.",
            "minimum": 0
          },
          "project_id": {
            "type": "string"
          },
          "source_subdir": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its process status (Running, Stopped, ...), when it has one."
          },
          "watch_paths": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Repository paths (globs) that concern this app; empty: all of them."
          }
        }
      },
      "GroupMemberRunDto": {
        "type": "object",
        "description": "One member's part in a group deployment.",
        "required": [
          "project_id",
          "name",
          "status"
        ],
        "properties": {
          "deployment_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "previous_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "project_id": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "description": "pending, deploying, deployed, skipped, failed or rolled_back."
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "GroupRequest": {
        "type": "object",
        "properties": {
          "branch": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default: main.",
            "default": null
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemberRequest"
            },
            "description": "Members in deploy order (create only; use the members endpoints later).",
            "default": []
          },
          "name": {
            "type": "string",
            "default": ""
          },
          "repository_url": {
            "type": "string",
            "default": ""
          },
          "rollback_on_failure": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Default: true.",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "GroupRollbackDto": {
        "type": "object",
        "required": [
          "members"
        ],
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemberRollbackDto"
            }
          }
        }
      },
      "GroupUpdatesDto": {
        "type": "object",
        "required": [
          "group_id",
          "checked_at",
          "changed_apps",
          "members"
        ],
        "properties": {
          "changed_apps": {
            "type": "integer",
            "description": "Apps with changes that concern them (or never deployed).",
            "minimum": 0
          },
          "checked_at": {
            "type": "string"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_id": {
            "type": "string"
          },
          "head": {
            "type": [
              "string",
              "null"
            ]
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdatesDto"
            },
            "description": "In deploy order."
          }
        }
      },
      "GroupWebhookStatusDto": {
        "type": "object",
        "required": [
          "configured",
          "path",
          "content_type",
          "events",
          "branch",
          "repository_url",
          "recent"
        ],
        "properties": {
          "branch": {
            "type": "string"
          },
          "configured": {
            "type": "boolean"
          },
          "content_type": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "path": {
            "type": "string",
            "description": "Payload URL path; prefix it with the API's public base URL."
          },
          "recent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryDto"
            },
            "description": "Most recent signed deliveries, newest first."
          },
          "repository_url": {
            "type": "string"
          }
        }
      },
      "HideRequest": {
        "type": "object",
        "required": [
          "password"
        ],
        "properties": {
          "password": {
            "type": "string",
            "description": "At least 12 characters. Needed to see the app again after signing in."
          }
        },
        "additionalProperties": false
      },
      "HostDto": {
        "type": "object",
        "required": [
          "hostname",
          "os",
          "uptime_secs",
          "cpu_count",
          "cpu_percent",
          "load_average",
          "memory_total_bytes",
          "memory_used_bytes",
          "swap_total_bytes",
          "swap_used_bytes",
          "disk_mount_point",
          "disk_total_bytes",
          "disk_available_bytes",
          "sampled_at"
        ],
        "properties": {
          "cpu_count": {
            "type": "integer",
            "minimum": 0
          },
          "cpu_percent": {
            "type": "number",
            "format": "float",
            "description": "0-100, averaged over all cores."
          },
          "disk_available_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "disk_mount_point": {
            "type": "string",
            "description": "Filesystem holding the data directory."
          },
          "disk_total_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "hostname": {
            "type": "string"
          },
          "load_average": {
            "type": "array",
            "items": {
              "type": "number",
              "format": "double"
            },
            "description": "1, 5 and 15 minute load averages."
          },
          "memory_total_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "memory_used_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "os": {
            "type": "string"
          },
          "sampled_at": {
            "type": "string"
          },
          "swap_total_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "swap_used_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "uptime_secs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ImportAppRequest": {
        "type": "object",
        "description": "One app to import. Give a `repository_url` (cloned at each deployment)\nor a `source_dir` (copied at each deployment).",
        "properties": {
          "branch": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "name": {
            "type": "string",
            "default": ""
          },
          "repository_url": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "runtime": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "settings": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectSettingsDto",
                "description": "Dashboard settings to save with the app (start command, port, env\nfile, ...); omitted fields follow aegis.toml and detection."
              }
            ],
            "default": null
          },
          "source_dir": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "source_subdir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Build and run only this folder of the source (monorepo apps).",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "ImportRequest": {
        "type": "object",
        "properties": {
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportAppRequest"
            },
            "default": []
          }
        },
        "additionalProperties": false
      },
      "ImportResultDto": {
        "type": "object",
        "required": [
          "apps"
        ],
        "properties": {
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportedAppDto"
            },
            "description": "One entry per requested app, in order. Imported apps are not deployed."
          }
        }
      },
      "ImportedAppDto": {
        "type": "object",
        "required": [
          "name",
          "next_steps"
        ],
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "next_steps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What to do before the first deployment."
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when the app was registered."
          }
        }
      },
      "InstanceDto": {
        "type": "object",
        "description": "One instance of an app.",
        "required": [
          "process"
        ],
        "properties": {
          "cpu_cores": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "CPU in use (cores) at the latest sample, while it runs."
          },
          "memory_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Memory in use (bytes) at the latest sample, while it runs.",
            "minimum": 0
          },
          "process": {
            "$ref": "#/components/schemas/ProcessDto"
          }
        }
      },
      "JobDto": {
        "type": "object",
        "required": [
          "id",
          "name",
          "schedule",
          "command",
          "timeout_secs",
          "enabled",
          "created_at"
        ],
        "properties": {
          "command": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "last_run": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JobRunDto"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "next_run": {
            "type": [
              "string",
              "null"
            ],
            "description": "The next scheduled start (RFC 3339), while enabled."
          },
          "schedule": {
            "type": "string",
            "description": "Five-field cron expression in UTC, or @hourly, @daily, @weekly, @monthly."
          },
          "timeout_secs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "JobRunDto": {
        "type": "object",
        "required": [
          "id",
          "job_id",
          "trigger",
          "started_at",
          "status",
          "output_tail"
        ],
        "properties": {
          "exit_code": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "job_id": {
            "type": "string"
          },
          "output_tail": {
            "type": "string",
            "description": "The last 32 KB of the combined output."
          },
          "started_at": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "running, success, failed, timeout or skipped."
          },
          "trigger": {
            "type": "string",
            "description": "\"schedule\" or \"manual\"."
          }
        }
      },
      "LastUpdateDto": {
        "type": "object",
        "description": "The last update this data directory saw.",
        "required": [
          "from_version",
          "to_version",
          "at",
          "method",
          "allow_unsigned"
        ],
        "properties": {
          "allow_unsigned": {
            "type": "boolean",
            "description": "Installed with `aegis-daemon self-update --allow-unsigned`: the\nrelease signature was not checked."
          },
          "at": {
            "type": "string",
            "description": "RFC 3339: when the new version first started."
          },
          "from_version": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "description": "`in_place`, `helper`, `self-update` (an admin ran\n`aegis-daemon self-update`) or `external`."
          },
          "signed_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID of the release key whose signature was verified, when known."
          },
          "to_version": {
            "type": "string"
          }
        }
      },
      "LatestReleaseDto": {
        "type": "object",
        "description": "The newest stable release found on GitHub.",
        "required": [
          "version",
          "name",
          "url"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "RFC 3339."
          },
          "url": {
            "type": "string",
            "description": "The release page with its notes."
          },
          "version": {
            "type": "string",
            "description": "The release tag, e.g. `v0.2.0`."
          }
        }
      },
      "LiveCheckDto": {
        "type": "object",
        "description": "What requesting a live URL showed.",
        "required": [
          "url",
          "ok",
          "elapsed_ms",
          "expected"
        ],
        "properties": {
          "elapsed_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why there was no answer (connection failed, timeout, TLS error...)."
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "`http_<status>`, `connection_failed`, `timeout`, `tls_error` or\n`no_response`, when not ok."
          },
          "expected": {
            "type": "string",
            "description": "The statuses that count as up, e.g. `100-499`."
          },
          "ok": {
            "type": "boolean"
          },
          "rollback_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "rolled_back_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "HTTP status, when there was an answer.",
            "minimum": 0
          },
          "url": {
            "type": "string"
          }
        }
      },
      "LogLineDto": {
        "type": "object",
        "required": [
          "timestamp",
          "stream",
          "line"
        ],
        "properties": {
          "line": {
            "type": "string"
          },
          "stream": {
            "type": "string",
            "description": "\"out\", \"err\" or \"sys\" (messages from the supervisor)."
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "password": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "LogsDto": {
        "type": "object",
        "required": [
          "process_id",
          "lines"
        ],
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogLineDto"
            }
          },
          "process_id": {
            "type": "string"
          }
        }
      },
      "MapDomainRequest": {
        "type": "object",
        "required": [
          "domain"
        ],
        "properties": {
          "cert_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "PEM certificate chain on the server, for tls = \"files\"."
          },
          "domain": {
            "type": "string",
            "description": "e.g. \"app.example.com\"; no wildcards."
          },
          "key_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "PEM private key on the server, for tls = \"files\"."
          },
          "tls": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"acme\" (automatic certificate, default), \"files\" or \"off\"."
          }
        }
      },
      "MemberRequest": {
        "type": "object",
        "properties": {
          "project": {
            "type": "string",
            "description": "Project id or name.",
            "default": ""
          },
          "watch_paths": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Globs such as `frontend_v2/**`; empty or omitted: the whole repository.",
            "default": []
          }
        },
        "additionalProperties": false
      },
      "MemberRollbackDto": {
        "type": "object",
        "required": [
          "project_id",
          "name"
        ],
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The release now live; `null` when the app was stopped (it had no\nrelease before) or the rollback failed."
          }
        }
      },
      "MembersRequest": {
        "type": "object",
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemberRequest"
            },
            "description": "The full member list, in deploy order.",
            "default": []
          }
        },
        "additionalProperties": false
      },
      "MetricsDto": {
        "type": "object",
        "required": [
          "series",
          "range_secs",
          "points"
        ],
        "properties": {
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PointDto"
            },
            "description": "Oldest first."
          },
          "range_secs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "series": {
            "type": "string",
            "description": "A project id, or \"host\"."
          }
        }
      },
      "NewTokenDto": {
        "type": "object",
        "required": [
          "token",
          "info"
        ],
        "properties": {
          "info": {
            "$ref": "#/components/schemas/TokenDto"
          },
          "token": {
            "type": "string",
            "description": "Shown once. Send as `Authorization: Bearer <token>`."
          }
        }
      },
      "PointDto": {
        "type": "object",
        "description": "A chart point: average and peak over the bucket starting at `at`.",
        "required": [
          "at",
          "cpu_cores",
          "cpu_cores_max",
          "memory_bytes",
          "memory_bytes_max",
          "throttled_ratio"
        ],
        "properties": {
          "at": {
            "type": "integer",
            "format": "int64"
          },
          "cpu_cores": {
            "type": "number",
            "format": "double"
          },
          "cpu_cores_max": {
            "type": "number",
            "format": "double"
          },
          "cpu_limit_cores": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "memory_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "memory_bytes_max": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "memory_limit_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "throttled_ratio": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ProcessDto": {
        "type": "object",
        "required": [
          "id",
          "project_id",
          "status",
          "desired",
          "restart_count",
          "runtime"
        ],
        "properties": {
          "command": {
            "type": [
              "string",
              "null"
            ]
          },
          "container": {
            "type": [
              "string",
              "null"
            ],
            "description": "The container's name (docker only)."
          },
          "desired": {
            "type": "string",
            "description": "\"running\" or \"stopped\": what the operator last asked for."
          },
          "id": {
            "type": "string"
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "The image the container runs (docker only)."
          },
          "instance": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Instance number (1-based) when the app runs several instances.",
            "minimum": 0
          },
          "last_exit_code": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "last_start": {
            "type": [
              "string",
              "null"
            ]
          },
          "pid": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The port the process listens on (`PORT`).",
            "minimum": 0
          },
          "project_id": {
            "type": "string"
          },
          "release_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "restart_count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "runtime": {
            "type": "string",
            "description": "\"process\" or \"docker\". For \"docker\", `pid` is the container's main\nprocess (as seen from the host)."
          },
          "status": {
            "type": "string",
            "description": "Running, Backoff, Stopping, Stopped, Exited or Failed."
          }
        }
      },
      "ProjectDto": {
        "type": "object",
        "required": [
          "id",
          "name",
          "repository_url",
          "branch",
          "created_at",
          "settings",
          "resources"
        ],
        "properties": {
          "branch": {
            "type": "string"
          },
          "commit": {
            "type": [
              "string",
              "null"
            ],
            "description": "The commit the live release was built from (\"local\" for a folder\noutside git)."
          },
          "created_at": {
            "type": "string"
          },
          "current_release": {
            "type": [
              "string",
              "null"
            ],
            "description": "Version of the live release."
          },
          "group": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectGroupDto",
                "description": "The group the app is deployed with, if any."
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "instances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstanceDto"
            },
            "description": "Every instance serving the live release, in instance order (one\nentry for single-instance apps). Resource limits apply to each\ninstance on its own."
          },
          "name": {
            "type": "string"
          },
          "process": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProcessDto",
                "description": "The process serving the live release."
              }
            ]
          },
          "protected": {
            "type": "boolean",
            "description": "The app is hidden behind a password (and unlocked for you right\nnow, or you wouldn't see it). Set on the project list and `GET\n/projects/{p}`."
          },
          "repository_url": {
            "type": "string"
          },
          "resources": {
            "$ref": "#/components/schemas/ResourceLimitsDto",
            "description": "CPU, memory and process limits."
          },
          "runtime": {
            "type": [
              "string",
              "null"
            ]
          },
          "schedule": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScheduleDto"
              }
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/ProjectSettingsDto",
            "description": "Settings edited in the dashboard (override aegis.toml)."
          },
          "source_dir": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_subdir": {
            "type": [
              "string",
              "null"
            ],
            "description": "The folder of the source that is built and run (monorepo apps)."
          },
          "standby": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StandbyDto",
                "description": "The previous release's instances after a BlueGreen switch."
              }
            ]
          },
          "updates": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateSummaryDto",
                "description": "The latest \"new commits\" check (`GET /projects/{p}/updates` has the\ncommit list), once one has run."
              }
            ]
          },
          "usage": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SampleDto",
                "description": "The latest measurement, while the app runs (all instances together)."
              }
            ]
          }
        }
      },
      "ProjectGroupDto": {
        "type": "object",
        "description": "The group an app belongs to.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ProjectResourcesDto": {
        "type": "object",
        "required": [
          "project_id",
          "limits",
          "capabilities"
        ],
        "properties": {
          "capabilities": {
            "$ref": "#/components/schemas/ResourceCapabilitiesDto"
          },
          "limits": {
            "$ref": "#/components/schemas/ResourceLimitsDto"
          },
          "project_id": {
            "type": "string"
          },
          "usage": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SampleDto"
              }
            ]
          }
        }
      },
      "ProjectSettingsDto": {
        "type": "object",
        "description": "Settings that override aegis.toml for future deployments. Omitted\nfields fall back to aegis.toml and runtime detection. An empty\n`health_check_url` means \"healthy while the process stays up\".",
        "properties": {
          "build_command": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "drain_timeout_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Seconds a stopping release gets to finish in-flight requests and\nexit after SIGTERM (0-3600; aegis.toml `[deploy] drain_timeout_secs`,\ndefault 10).",
            "default": null,
            "minimum": 0
          },
          "env": {
            "type": "object",
            "description": "Plain environment variables, merged over aegis.toml's `[env]` and\nwritten into each release. Use secrets for sensitive values.",
            "default": {},
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "env_file": {
            "type": [
              "string",
              "null"
            ],
            "description": "Absolute path of an env file on the server (dotenv syntax), read at\nevery build and every process start. It must be inside a directory\nlisted in the daemon's `[apps] env_file_dirs`. Its values are never\nstored; Variables and Secrets override them. Omit (or send `null`)\nfor none: like every field here, an omitted value is cleared.",
            "default": null
          },
          "health_check_timeout_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Seconds a new release may take to become healthy (1-3600; aegis.toml\n`[deploy] health_check_timeout_secs`, default 30). Raise it for apps\nthat start slowly.",
            "default": null,
            "minimum": 0
          },
          "health_check_url": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "install_command": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "instances": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Instances to run, 1-16 (more than 1 needs a domain on the built-in\nproxy). Takes effect with the next deployment.",
            "default": null,
            "minimum": 0
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "default": null,
            "minimum": 0
          },
          "start_command": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "strategy": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default deployment strategy: GracefulSwitch, Immediate, Rolling or\nBlueGreen (the last two need a domain on the built-in proxy).",
            "default": null
          },
          "test_command": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "verify_expect": {
            "type": [
              "string",
              "null"
            ],
            "description": "Statuses that count as up: `200` or a range like `200-399` (default\n`100-499`, anything but a server error).",
            "default": null
          },
          "verify_timeout_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Seconds the verify URL may take to come up (1-3600, default 30).",
            "default": null,
            "minimum": 0
          },
          "verify_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "After the new release is live, request this http:// or https:// URL\n(e.g. the public domain). If it isn't up within `verify_timeout_secs`\nthe deployment is rolled back to the previous release and fails with\nthe HTTP status or error seen (`[deploy] verify_url`).",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "PrometheusDto": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether `GET /metrics` answers."
          }
        }
      },
      "ProxyRouteDto": {
        "type": "object",
        "required": [
          "domain",
          "target",
          "upstream_ports",
          "cert"
        ],
        "properties": {
          "cert": {
            "$ref": "#/components/schemas/CertStatusDto"
          },
          "domain": {
            "type": "string"
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "project_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "target": {
            "type": "string",
            "description": "\"project\" or \"dashboard\"."
          },
          "upstream_port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Local port requests go to right now (the first instance's).",
            "minimum": 0
          },
          "upstream_ports": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Every instance's port; requests are spread over them."
          }
        }
      },
      "ProxyStatusDto": {
        "type": "object",
        "required": [
          "enabled",
          "acme_enabled",
          "routes"
        ],
        "properties": {
          "acme_directory": {
            "type": [
              "string",
              "null"
            ]
          },
          "acme_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "acme_enabled": {
            "type": "boolean",
            "description": "Automatic certificates (`[proxy.acme]`)."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the built-in proxy runs (`[proxy] enabled`)."
          },
          "host": {
            "type": [
              "string",
              "null"
            ]
          },
          "http_port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "https_port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "routes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProxyRouteDto"
            }
          }
        }
      },
      "ReleaseDto": {
        "type": "object",
        "required": [
          "id",
          "project_id",
          "version",
          "status",
          "commit_sha",
          "commit_message",
          "created_at"
        ],
        "properties": {
          "checksum": {
            "type": [
              "string",
              "null"
            ]
          },
          "commit_message": {
            "type": "string"
          },
          "commit_sha": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "source_dirty": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Built from a server folder that had uncommitted changes."
          },
          "status": {
            "type": "string",
            "description": "Built, Active, Inactive, Failed or Archived."
          },
          "version": {
            "type": "string"
          }
        }
      },
      "ResourceCapabilitiesDto": {
        "type": "object",
        "required": [
          "backend",
          "cpu",
          "memory",
          "pids",
          "host_cpu_cores",
          "host_memory_bytes",
          "committed_memory_bytes",
          "committed_cpu_cores"
        ],
        "properties": {
          "backend": {
            "type": "string",
            "description": "\"cgroup2\", \"cgroup1\", \"docker\" (a container app's limits, applied by\nDocker) or \"none\"."
          },
          "committed_cpu_cores": {
            "type": "number",
            "format": "double"
          },
          "committed_memory_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Sums of all apps' limits.",
            "minimum": 0
          },
          "cpu": {
            "type": "boolean"
          },
          "docker": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DockerStatusDto",
                "description": "Docker's status, once checked."
              }
            ]
          },
          "host_cpu_cores": {
            "type": "integer",
            "minimum": 0
          },
          "host_memory_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "location": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where app cgroups are created."
          },
          "memory": {
            "type": "boolean"
          },
          "pids": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why limits are unavailable, or partly so."
          }
        }
      },
      "ResourceLimitsDto": {
        "type": "object",
        "description": "Limits for one app; `null` means unlimited.",
        "properties": {
          "cpu_cores": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "CPU time in cores (0.5 = half of one core)."
          },
          "memory_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Hard memory limit in bytes; the soft limit is 90% of it.",
            "minimum": 0
          },
          "pids_max": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Maximum number of processes and threads.",
            "minimum": 0
          }
        }
      },
      "RollbackRequest": {
        "type": "object",
        "properties": {
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Defaults to the release that was live before the current one.",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "RollbackResult": {
        "type": "object",
        "required": [
          "version"
        ],
        "properties": {
          "version": {
            "type": "string",
            "description": "The release that is now live."
          }
        }
      },
      "SampleDto": {
        "type": "object",
        "description": "One measurement.",
        "required": [
          "at",
          "cpu_cores",
          "memory_bytes",
          "throttled_ratio",
          "threads",
          "fds",
          "procs",
          "restarts",
          "oom_kills"
        ],
        "properties": {
          "at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix milliseconds."
          },
          "cpu_cores": {
            "type": "number",
            "format": "double",
            "description": "CPU in use, in cores."
          },
          "cpu_limit_cores": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "fds": {
            "type": "integer",
            "format": "int64",
            "description": "Open file descriptors.",
            "minimum": 0
          },
          "memory_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "memory_limit_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "oom_kills": {
            "type": "integer",
            "format": "int64",
            "description": "Out-of-memory kills in the current process's cgroup.",
            "minimum": 0
          },
          "procs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "restarts": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "threads": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "throttled_ratio": {
            "type": "number",
            "format": "double",
            "description": "Share of CPU periods held back by the CPU limit, 0-1."
          }
        }
      },
      "ScanCandidateDto": {
        "type": "object",
        "description": "An app found by a scan, with the settings an import would use.",
        "required": [
          "path",
          "name",
          "runtime",
          "start_command",
          "remote_kind",
          "deploy_key",
          "env_file_readable",
          "env_names",
          "env_file_allowed",
          "warnings"
        ],
        "properties": {
          "branch": {
            "type": [
              "string",
              "null"
            ]
          },
          "build_command": {
            "type": [
              "string",
              "null"
            ]
          },
          "deploy_key": {
            "type": "string",
            "description": "`required` (SSH remote), `check` (GitHub over HTTPS: may be\nprivate), `unknown` or `no`."
          },
          "env_file": {
            "type": [
              "string",
              "null"
            ],
            "description": "The app's `.env`, if there is one."
          },
          "env_file_allowed": {
            "type": "boolean",
            "description": "The `.env` may be used as the Env file (it is in `env_file_dirs`)."
          },
          "env_file_readable": {
            "type": "boolean"
          },
          "env_names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Variable names in the `.env` (values are never read out)."
          },
          "health_check_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "install_command": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "port_in_use": {
            "type": [
              "string",
              "null"
            ],
            "description": "What listens on the app's port right now."
          },
          "registered_as": {
            "type": [
              "string",
              "null"
            ],
            "description": "The registered app with the same source (skip it)."
          },
          "remote_kind": {
            "type": "string",
            "description": "`github`, `ssh`, `https` or `none`."
          },
          "repo_root": {
            "type": [
              "string",
              "null"
            ],
            "description": "The git checkout the app is in."
          },
          "repository_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The checkout's `origin` remote (credentials removed)."
          },
          "runtime": {
            "type": "string"
          },
          "source_subdir": {
            "type": [
              "string",
              "null"
            ],
            "description": "The app's folder inside the checkout (monorepo apps)."
          },
          "start_command": {
            "type": "string"
          },
          "start_hint": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StartHintDto"
              }
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanWarningDto"
            }
          }
        }
      },
      "ScanInfoDto": {
        "type": "object",
        "description": "Whether scanning is on, and where.",
        "required": [
          "allowed_dirs",
          "env_files_enabled"
        ],
        "properties": {
          "allowed_dirs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`[apps] import_dirs` plus `[apps] env_file_dirs`."
          },
          "env_files_enabled": {
            "type": "boolean",
            "description": "Env files are on (`[apps] env_file_dirs` is set)."
          }
        }
      },
      "ScanRequest": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "An absolute path inside one of the allowed folders.",
            "default": ""
          }
        },
        "additionalProperties": false
      },
      "ScanResultDto": {
        "type": "object",
        "required": [
          "root",
          "candidates",
          "truncated",
          "skipped"
        ],
        "properties": {
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanCandidateDto"
            }
          },
          "root": {
            "type": "string",
            "description": "The scanned folder, resolved."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Folders not looked into, and why."
          },
          "truncated": {
            "type": "boolean",
            "description": "The scan stopped at its depth or entry limit."
          }
        }
      },
      "ScanWarningDto": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "`private_repo`, `ssh_remote`, `credentials_in_url`, `port_in_use`,\n`hardcoded_port`, `env_unreadable`, `env_outside_allowed`,\n`no_remote` or `detached_head`."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ScheduleDto": {
        "type": "object",
        "required": [
          "hour",
          "minute",
          "branch"
        ],
        "properties": {
          "branch": {
            "type": "string"
          },
          "hour": {
            "type": "integer",
            "format": "int32",
            "description": "UTC hour, 0-23.",
            "minimum": 0
          },
          "minute": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "ScheduleRequest": {
        "type": "object",
        "required": [
          "hour"
        ],
        "properties": {
          "branch": {
            "type": [
              "string",
              "null"
            ],
            "description": "Defaults to the project's branch."
          },
          "hour": {
            "type": "integer",
            "format": "int32",
            "description": "UTC hour, 0-23.",
            "minimum": 0
          },
          "minute": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "SecretDto": {
        "type": "object",
        "description": "A secret's name and when it last changed. Values are write-only.",
        "required": [
          "name",
          "updated_at"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        }
      },
      "SecretSaved": {
        "type": "object",
        "required": [
          "name",
          "created",
          "restart_required"
        ],
        "properties": {
          "created": {
            "type": "boolean",
            "description": "False when an existing secret was replaced."
          },
          "name": {
            "type": "string"
          },
          "restart_required": {
            "type": "boolean",
            "description": "The running process still has the old value; restart it to apply."
          }
        }
      },
      "SessionDto": {
        "type": "object",
        "required": [
          "kind",
          "name"
        ],
        "properties": {
          "csrf_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send as `X-CSRF-Token` on requests that change state (sessions only)."
          },
          "docker_access": {
            "type": "boolean",
            "description": "May see the server's Docker containers and logs (users only)."
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "When the session expires if left idle (unix seconds; sessions only)."
          },
          "kind": {
            "type": "string",
            "description": "\"user\" (session cookie) or \"token\" (API token)."
          },
          "name": {
            "type": "string",
            "description": "Username or token name."
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"viewer\", \"deployer\" or \"admin\" (users only)."
          },
          "scope": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"read\" or \"deploy\" (tokens only)."
          }
        }
      },
      "SetPrometheusRequest": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "SetResourcesRequest": {
        "type": "object",
        "description": "New limits. Omitted or `null` fields become unlimited.",
        "properties": {
          "cpu_cores": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "default": null
          },
          "force": {
            "type": "boolean",
            "description": "Apply even if the memory limit is below current use or more memory\nis promised to apps than the host has (otherwise 409\n`confirmation_required`).",
            "default": false
          },
          "memory_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "default": null,
            "minimum": 0
          },
          "pids_max": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "default": null,
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "SetSecretRequest": {
        "type": "object",
        "required": [
          "value"
        ],
        "properties": {
          "value": {
            "type": "string",
            "description": "The value; stored encrypted and never returned."
          }
        },
        "additionalProperties": false
      },
      "StandbyDto": {
        "type": "object",
        "description": "The previous release, kept running after a BlueGreen switch so a\nrollback to it is instant.",
        "required": [
          "version",
          "process_ids",
          "until"
        ],
        "properties": {
          "process_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "until": {
            "type": "string",
            "description": "When it is stopped (RFC 3339)."
          },
          "version": {
            "type": "string"
          }
        }
      },
      "StartHintDto": {
        "type": "object",
        "description": "A start script that fixes the app's port, and its `$PORT` form.",
        "required": [
          "port",
          "script",
          "suggested_start"
        ],
        "properties": {
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "script": {
            "type": "string",
            "description": "The package.json `start` script."
          },
          "suggested_start": {
            "type": "string",
            "description": "The proposed start command, e.g. `npx next start -p $PORT`."
          }
        }
      },
      "StatusDto": {
        "type": "object",
        "required": [
          "version",
          "project_count",
          "running_processes",
          "event_count",
          "data_dir"
        ],
        "properties": {
          "data_dir": {
            "type": "string"
          },
          "event_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "project_count": {
            "type": "integer",
            "minimum": 0
          },
          "running_processes": {
            "type": "integer",
            "minimum": 0
          },
          "version": {
            "type": "string"
          }
        }
      },
      "StorageCategoryDto": {
        "type": "object",
        "required": [
          "key",
          "label",
          "bytes",
          "reclaimable_bytes"
        ],
        "properties": {
          "bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "key": {
            "type": "string",
            "description": "releases, old_builds, logs, backups, database or temp."
          },
          "label": {
            "type": "string"
          },
          "reclaimable_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "What \"Clean up now\" would free in this category.",
            "minimum": 0
          }
        }
      },
      "StorageDto": {
        "type": "object",
        "required": [
          "total_bytes",
          "reclaimable_bytes",
          "categories",
          "apps",
          "auto_cleanup",
          "log_days"
        ],
        "properties": {
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppStorageDto"
            }
          },
          "auto_cleanup": {
            "type": "boolean",
            "description": "Hourly automatic cleanup is on."
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StorageCategoryDto"
            }
          },
          "log_days": {
            "type": "integer",
            "format": "int64",
            "description": "Log files untouched for this many days are removed by a cleanup.",
            "minimum": 0
          },
          "reclaimable_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "total_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "TokenDto": {
        "type": "object",
        "required": [
          "id",
          "name",
          "scope",
          "created_at",
          "revoked"
        ],
        "properties": {
          "created_at": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "revoked": {
            "type": "boolean"
          },
          "scope": {
            "type": "string"
          }
        }
      },
      "UnlockRequest": {
        "type": "object",
        "required": [
          "password"
        ],
        "properties": {
          "password": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "UpdateJobRequest": {
        "type": "object",
        "properties": {
          "command": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "default": null
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "schedule": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "timeout_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "default": null,
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "UpdateMemberRequest": {
        "type": "object",
        "properties": {
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "description": "New 1-based place in the deploy order (omitted: unchanged).",
            "default": null,
            "minimum": 0
          },
          "watch_paths": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "New watch paths (omitted: unchanged).",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "UpdateStatusDto": {
        "type": "object",
        "description": "Update status.",
        "required": [
          "current_version",
          "check_enabled",
          "update_available",
          "mode",
          "mode_detail",
          "can_apply",
          "phase",
          "release_keys"
        ],
        "properties": {
          "blocked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the available update can't be applied from here."
          },
          "can_apply": {
            "type": "boolean",
            "description": "`POST /api/v1/system/update/apply` would be accepted now."
          },
          "check_enabled": {
            "type": "boolean",
            "description": "`[update] check`: when false, Aegis makes no update requests."
          },
          "check_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the last check failed (checks are retried later)."
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "RFC 3339, the last successful check."
          },
          "current_version": {
            "type": "string",
            "description": "The running version."
          },
          "last_update": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LastUpdateDto"
              }
            ]
          },
          "latest": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LatestReleaseDto"
              }
            ]
          },
          "manual_command": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "type": "string",
            "description": "How an update is installed here: `in_place` (Aegis replaces its own\nbinary), `helper` (a root-owned helper service does), `manual` (an\nadministrator runs `manual_command`) or `unsupported`."
          },
          "mode_detail": {
            "type": "string",
            "description": "What applying means on this machine."
          },
          "phase": {
            "type": "string",
            "description": "`idle`, `downloading`, `backing_up`, `installing`,\n`waiting_for_helper`, `restarting` or `failed`."
          },
          "phase_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs of the release signing keys this build verifies releases with.\nEmpty: this build has no key, so updates can't be installed from the\ndashboard (`blocked_reason` says what to do instead)."
          },
          "update_available": {
            "type": "boolean",
            "description": "`latest` is newer than the running version."
          }
        }
      },
      "UpdateSummaryDto": {
        "type": "object",
        "description": "A short form for lists (the Overview).",
        "required": [
          "checked_at",
          "relevant",
          "up_to_date"
        ],
        "properties": {
          "behind": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "checked_at": {
            "type": "string"
          },
          "dirty": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "head": {
            "type": [
              "string",
              "null"
            ]
          },
          "relevant": {
            "type": "boolean"
          },
          "up_to_date": {
            "type": "boolean"
          }
        }
      },
      "UpdateUserRequest": {
        "type": "object",
        "properties": {
          "all_apps": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true`: the user sees every app again.",
            "default": null
          },
          "apps": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Replaces the list of apps the user may see (empty: none).",
            "default": null
          },
          "docker_access": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Grants or removes access to Docker containers and logs.",
            "default": null
          },
          "password": {
            "type": [
              "string",
              "null"
            ],
            "description": "New password; signs the user out everywhere.",
            "default": null
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "New role.",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "UpdatesDto": {
        "type": "object",
        "description": "How an app's live release compares with its source.",
        "required": [
          "project_id",
          "name",
          "checked_at",
          "kind",
          "deployed",
          "commits",
          "changed_files",
          "relevant",
          "up_to_date"
        ],
        "properties": {
          "behind": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Commits after the live one (`null`: unknown).",
            "minimum": 0
          },
          "branch": {
            "type": [
              "string",
              "null"
            ]
          },
          "changed_files": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Files changed since the live commit (only those matching the app's\nwatch paths when it is in a group and has some; at most 500)."
          },
          "checked_at": {
            "type": "string"
          },
          "commits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommitDto"
            },
            "description": "Newest first, at most 50."
          },
          "deployed": {
            "type": "boolean",
            "description": "The app has a live release."
          },
          "dirty": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Folder apps: files with uncommitted changes.",
            "minimum": 0
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the check couldn't be completed (it never blocks anything)."
          },
          "head": {
            "type": [
              "string",
              "null"
            ],
            "description": "The branch head, or the folder's HEAD."
          },
          "kind": {
            "type": "string",
            "description": "\"git\" (a repository branch) or \"folder\" (a server folder's git HEAD)."
          },
          "live_commit": {
            "type": [
              "string",
              "null"
            ],
            "description": "The commit of the live release."
          },
          "name": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "relevant": {
            "type": "boolean",
            "description": "Some change concerns this app, or it was never deployed."
          },
          "up_to_date": {
            "type": "boolean"
          }
        }
      },
      "UserDto": {
        "type": "object",
        "required": [
          "username",
          "role",
          "created_at",
          "password_changed_at",
          "all_apps",
          "apps",
          "docker_access",
          "owner"
        ],
        "properties": {
          "all_apps": {
            "type": "boolean",
            "description": "True: the user sees every app (always the case for admins)."
          },
          "apps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "With `all_apps` false, the names of the only apps the user sees."
          },
          "created_at": {
            "type": "string"
          },
          "docker_access": {
            "type": "boolean",
            "description": "May see the server's Docker containers and their logs. The owner\n(the first admin) always can; everyone else only when granted."
          },
          "owner": {
            "type": "boolean",
            "description": "True for the owner account."
          },
          "password_changed_at": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "\"viewer\", \"deployer\" or \"admin\"."
          },
          "username": {
            "type": "string"
          }
        }
      },
      "VerifyRequest": {
        "type": "object",
        "description": "Request for `POST /projects/{project}/verify`.",
        "properties": {
          "rollback": {
            "type": "boolean",
            "description": "Roll back to the previous release when the URL isn't up.",
            "default": false
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "http:// or https:// URL to request; the app's verify URL when omitted.",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "WebhookDeliveryDto": {
        "type": "object",
        "required": [
          "received_at",
          "delivery",
          "event",
          "status"
        ],
        "properties": {
          "delivery": {
            "type": "string",
            "description": "GitHub's X-GitHub-Delivery id."
          },
          "deployment_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "event": {
            "type": "string",
            "description": "GitHub event name, e.g. \"push\" or \"ping\"."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "received_at": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "\"queued\", \"ignored\", \"duplicate\", \"pong\" or \"error\"."
          }
        }
      },
      "WebhookResult": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "deployment_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "description": "\"queued\", \"ignored\", \"duplicate\" or \"pong\"."
          }
        }
      },
      "WebhookSecretDto": {
        "type": "object",
        "required": [
          "path",
          "secret",
          "content_type",
          "events"
        ],
        "properties": {
          "content_type": {
            "type": "string",
            "description": "\"application/json\""
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Events Aegis acts on (\"push\"; \"ping\" is acknowledged)."
          },
          "path": {
            "type": "string",
            "description": "Payload URL path; prefix it with the API's public base URL."
          },
          "secret": {
            "type": "string",
            "description": "Shown once. Paste into the GitHub webhook's \"Secret\" field."
          }
        }
      },
      "WebhookStatusDto": {
        "type": "object",
        "required": [
          "configured",
          "path",
          "content_type",
          "events",
          "branch",
          "repository_url",
          "recent"
        ],
        "properties": {
          "branch": {
            "type": "string",
            "description": "Branch whose pushes deploy."
          },
          "configured": {
            "type": "boolean",
            "description": "A secret exists, so deliveries are accepted."
          },
          "content_type": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "path": {
            "type": "string",
            "description": "Payload URL path; prefix it with the API's public base URL."
          },
          "recent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryDto"
            },
            "description": "Most recent signed deliveries, newest first."
          },
          "repository_url": {
            "type": "string",
            "description": "Pushes need a repository to clone."
          }
        }
      }
    },
    "securitySchemes": {
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "aegis_session",
        "description": "Session cookie from POST /api/v1/auth/login. Requests that change state also need the X-CSRF-Token header."
      },
      "token": {
        "type": "http",
        "scheme": "bearer",
        "description": "API token created with POST /api/v1/tokens"
      }
    }
  },
  "security": [
    {
      "session": []
    },
    {
      "token": []
    }
  ],
  "tags": [
    {
      "name": "auth"
    },
    {
      "name": "users"
    },
    {
      "name": "access"
    },
    {
      "name": "system"
    },
    {
      "name": "projects"
    },
    {
      "name": "deployments"
    },
    {
      "name": "processes"
    },
    {
      "name": "events"
    },
    {
      "name": "webhooks"
    },
    {
      "name": "resources"
    },
    {
      "name": "domains"
    },
    {
      "name": "secrets"
    },
    {
      "name": "backups"
    },
    {
      "name": "sources"
    },
    {
      "name": "groups"
    },
    {
      "name": "jobs"
    },
    {
      "name": "docker"
    }
  ]
}
