{
  "openapi": "3.0.3",
  "info": {
    "title": "Agiler API",
    "description": "Public developer API. Authenticate with an API token sent as `Authorization: Bearer \u003ctoken\u003e`. Issue tokens from the agiler dashboard at https://app.agiler.io.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.agiler.io/v1"
    }
  ],
  "paths": {
    "/projects": {
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "List your projects",
        "operationId": "listProjects",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "description": "Filter projects to a workspace id.",
            "schema": {
              "type": "string",
              "description": "Filter projects to a workspace id.",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectSummary"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "projects"
        ],
        "summary": "Create a project",
        "operationId": "createProject",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDetail"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}": {
      "delete": {
        "tags": [
          "projects"
        ],
        "summary": "Delete a project",
        "operationId": "deleteProject",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:write"
            ]
          }
        ]
      },
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "Get a project",
        "operationId": "getProject",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDetail"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "projects"
        ],
        "summary": "Update a project",
        "operationId": "updateProject",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDetail"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/backups": {
      "get": {
        "tags": [
          "project-backups"
        ],
        "summary": "List backups for a project",
        "operationId": "listProjectBackups",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectBackupEntry"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.backups:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "project-backups"
        ],
        "summary": "Trigger an on-demand backup",
        "operationId": "createProjectBackup",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBackupEntry"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.backups:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/backups/policy": {
      "get": {
        "tags": [
          "project-backups"
        ],
        "summary": "Get the project's backup policy",
        "operationId": "getProjectBackupPolicy",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBackupPolicyOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.backups:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "project-backups"
        ],
        "summary": "Update the project's backup policy",
        "operationId": "updateProjectBackupPolicy",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectBackupPolicyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBackupPolicyOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.backups:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/backups/{backup}": {
      "delete": {
        "tags": [
          "project-backups"
        ],
        "summary": "Delete a backup",
        "operationId": "deleteProjectBackup",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "backup",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.backups:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/backups/{backup}/database": {
      "get": {
        "tags": [
          "project-backups"
        ],
        "summary": "Download the database dump for a backup",
        "operationId": "downloadProjectBackupDatabase",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "backup",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryStream"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.backups:read"
            ]
          }
        ]
      }
    },
    "/projects/{project}/backups/{backup}/restore": {
      "post": {
        "tags": [
          "project-backups"
        ],
        "summary": "Restore a backup (asynchronous; returns 202)",
        "operationId": "restoreProjectBackup",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "backup",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "drain_requests",
            "in": "query",
            "description": "Wait for in-flight requests to drain before starting the restore. Defaults to false.",
            "schema": {
              "type": "boolean",
              "description": "Wait for in-flight requests to drain before starting the restore. Defaults to false."
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.backups:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/backups/{backup}/storage": {
      "get": {
        "tags": [
          "project-backups"
        ],
        "summary": "Download the storage archive for a backup",
        "operationId": "downloadProjectBackupStorage",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "backup",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryStream"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.backups:read"
            ]
          }
        ]
      }
    },
    "/projects/{project}/domains": {
      "get": {
        "tags": [
          "project-domains"
        ],
        "summary": "List domains attached to a project",
        "operationId": "listProjectDomains",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectDomainOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.domains:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "project-domains"
        ],
        "summary": "Attach a domain to a project",
        "operationId": "createProjectDomain",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectDomainInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDomainOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.domains:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/domains/{domain}": {
      "delete": {
        "tags": [
          "project-domains"
        ],
        "summary": "Detach a domain from a project",
        "operationId": "deleteProjectDomain",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.domains:write"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "project-domains"
        ],
        "summary": "Update a project domain (primary flag only today)",
        "operationId": "updateProjectDomain",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectDomainInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDomainOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.domains:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/files": {
      "get": {
        "tags": [
          "project-files"
        ],
        "summary": "List the root of a project's file tree",
        "operationId": "listProjectFiles",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectFileEntry"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.files:read"
            ]
          }
        ]
      }
    },
    "/projects/{project}/files/{path}": {
      "delete": {
        "tags": [
          "project-files"
        ],
        "summary": "Delete a file or directory",
        "operationId": "deleteProjectFile",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.files:write"
            ]
          }
        ]
      },
      "get": {
        "tags": [
          "project-files"
        ],
        "summary": "List a directory or download a file (response shape depends on path)",
        "operationId": "getProjectFile",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectFileEntry"
                  }
                }
              },
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryStream"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.files:read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "project-files"
        ],
        "summary": "Upload a file, or move/copy via X-Move-Source / X-Copy-Source headers",
        "operationId": "putProjectFile",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectFileEntry"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.files:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/logs": {
      "get": {
        "tags": [
          "project-logs"
        ],
        "summary": "Fetch project request logs",
        "operationId": "getProjectLogs",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "RFC 3339 lower bound on the time window.",
            "schema": {
              "type": "string",
              "description": "RFC 3339 lower bound on the time window.",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "description": "RFC 3339 upper bound on the time window.",
            "schema": {
              "type": "string",
              "description": "RFC 3339 upper bound on the time window.",
              "format": "date-time"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Free-text filter on log lines.",
            "schema": {
              "type": "string",
              "description": "Free-text filter on log lines."
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page.",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectLogEventOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.logs:read"
            ]
          }
        ]
      }
    },
    "/projects/{project}/rules": {
      "get": {
        "tags": [
          "project-rules"
        ],
        "summary": "List a project's rules",
        "operationId": "listProjectRules",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectRuleOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.rules:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "project-rules"
        ],
        "summary": "Create a project rule",
        "operationId": "createProjectRule",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectRuleInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectRuleOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.rules:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/rules/{rule}": {
      "delete": {
        "tags": [
          "project-rules"
        ],
        "summary": "Delete a project rule",
        "operationId": "deleteProjectRule",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rule",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.rules:write"
            ]
          }
        ]
      },
      "get": {
        "tags": [
          "project-rules"
        ],
        "summary": "Fetch a single project rule",
        "operationId": "getProjectRule",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rule",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectRuleOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.rules:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "project-rules"
        ],
        "summary": "Update a project rule",
        "operationId": "updateProjectRule",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rule",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectRuleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectRuleOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.rules:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/sql/statements": {
      "get": {
        "tags": [
          "project-sql"
        ],
        "summary": "List recent SQL statement executions",
        "operationId": "listProjectSQLStatements",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "type": "integer",
              "description": "Maximum number of results to return."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StatementListItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.sql:execute"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "project-sql"
        ],
        "summary": "Execute a SQL statement against the project database",
        "operationId": "runSQLStatement",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSQLStatementInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Freeform JSON object proxied from the edge runtime; the shape is owned by that service and may evolve independently of this API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeformObject"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.sql:execute"
            ]
          }
        ]
      }
    },
    "/projects/{project}/sql/statements/{statement}": {
      "delete": {
        "tags": [
          "project-sql"
        ],
        "summary": "Cancel or delete a SQL statement execution",
        "operationId": "deleteProjectSQLStatement",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statement",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.sql:execute"
            ]
          }
        ]
      },
      "get": {
        "tags": [
          "project-sql"
        ],
        "summary": "Fetch a single SQL statement execution by id",
        "operationId": "getProjectSQLStatement",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statement",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Freeform JSON object proxied from the edge runtime; the shape is owned by that service and may evolve independently of this API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeformObject"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.sql:execute"
            ]
          }
        ]
      }
    },
    "/projects/{project}/usage": {
      "get": {
        "tags": [
          "project-usage"
        ],
        "summary": "Fetch project usage time-series",
        "operationId": "getProjectUsage",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "RFC 3339 lower bound on the time window.",
            "schema": {
              "type": "string",
              "description": "RFC 3339 lower bound on the time window.",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "description": "RFC 3339 upper bound on the time window.",
            "schema": {
              "type": "string",
              "description": "RFC 3339 upper bound on the time window.",
              "format": "date-time"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "description": "Bucket size for the returned series. Defaults to day.",
            "schema": {
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ],
              "type": "string",
              "description": "Bucket size for the returned series. Defaults to day."
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of buckets to return.",
            "schema": {
              "maximum": 365,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of buckets to return.",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUsageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.usage:read"
            ]
          }
        ]
      }
    },
    "/projects/{project}/variables": {
      "get": {
        "tags": [
          "project-variables"
        ],
        "summary": "List project environment variables",
        "operationId": "listProjectVariables",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectVariableOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.variables:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "project-variables"
        ],
        "summary": "Create a project variable",
        "operationId": "createProjectVariable",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectVariableInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectVariableOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.variables:write"
            ]
          }
        ]
      }
    },
    "/projects/{project}/variables/{variable}": {
      "delete": {
        "tags": [
          "project-variables"
        ],
        "summary": "Delete a project variable",
        "operationId": "deleteProjectVariable",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "variable",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.variables:write"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "project-variables"
        ],
        "summary": "Update a project variable",
        "operationId": "updateProjectVariable",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "variable",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectVariableInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectVariableOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects.variables:write"
            ]
          }
        ]
      }
    },
    "/regions": {
      "get": {
        "tags": [
          "regions"
        ],
        "summary": "List public regions",
        "operationId": "listRegions",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RegionOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/regions/{region}": {
      "get": {
        "tags": [
          "regions"
        ],
        "summary": "Fetch a single region",
        "operationId": "getRegion",
        "parameters": [
          {
            "name": "region",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegionOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/rules": {
      "get": {
        "tags": [
          "rules"
        ],
        "summary": "List the rule condition / action catalog",
        "operationId": "listRuleOptions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleOptionsOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/runtimes": {
      "get": {
        "tags": [
          "runtimes"
        ],
        "summary": "List public runtimes",
        "operationId": "listRuntimes",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RuntimeOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/runtimes/{runtimeid}": {
      "get": {
        "tags": [
          "runtimes"
        ],
        "summary": "Fetch a single runtime",
        "operationId": "getRuntime",
        "parameters": [
          {
            "name": "runtimeid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/me": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Fetch the authenticated user",
        "operationId": "getSelfUser",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfUser"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/me/billing": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Get the caller's billing profile",
        "operationId": "getMeBilling",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "billing:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "billing"
        ],
        "summary": "Update billing budget and charge settings",
        "operationId": "updateMeBilling",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBillingInput"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "billing:write"
            ]
          }
        ]
      }
    },
    "/users/me/billing/payment-methods": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "List the caller's billing payment methods",
        "operationId": "listMeBillingPaymentMethods",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PaymentMethodOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "billing:read"
            ]
          }
        ]
      }
    },
    "/users/me/billing/statements/{period}": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Download a monthly billing statement as PDF",
        "operationId": "getMeBillingStatementPDF",
        "parameters": [
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryStream"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "billing:read"
            ]
          }
        ]
      }
    },
    "/users/me/billing/transactions": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "List billing transactions, grouped by month",
        "operationId": "listMeBillingTransactions",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "description": "Filter to transactions in this four-digit year (UTC).",
            "schema": {
              "type": "integer",
              "description": "Filter to transactions in this four-digit year (UTC)."
            }
          },
          {
            "name": "month",
            "in": "query",
            "description": "Filter to transactions in this calendar month (1-12, UTC). Requires year.",
            "schema": {
              "type": "integer",
              "description": "Filter to transactions in this calendar month (1-12, UTC). Requires year."
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BillingTransactionMonth"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "billing:read"
            ]
          }
        ]
      }
    },
    "/users/me/notifications": {
      "get": {
        "tags": [
          "notifications"
        ],
        "summary": "List the caller's notifications",
        "operationId": "listMeNotifications",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\").",
            "schema": {
              "type": "string",
              "description": "Cursor for the next page (opaque; obtained from the previous response's Link rel=\"next\")."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return.",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer",
              "description": "Maximum number of results to return.",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NotificationOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "notifications:read"
            ]
          }
        ]
      }
    },
    "/users/me/notifications/{notification}": {
      "delete": {
        "tags": [
          "notifications"
        ],
        "summary": "Dismiss a notification",
        "operationId": "deleteMeNotification",
        "parameters": [
          {
            "name": "notification",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "notifications:write"
            ]
          }
        ]
      }
    },
    "/users/me/verify": {
      "get": {
        "tags": [
          "verify"
        ],
        "summary": "List the caller's pending verifications",
        "operationId": "listMeVerify",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingVerification"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/workspaces": {
      "get": {
        "tags": [
          "workspaces"
        ],
        "summary": "List your workspaces",
        "operationId": "listWorkspaces",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "workspaces"
        ],
        "summary": "Create a workspace",
        "operationId": "createWorkspace",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409.",
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string",
              "description": "Opaque client-supplied retry token (any string up to 128 chars; UUIDs work well). If the server has seen this key on a prior request with the same body, it replays the recorded response. A different body under the same key returns 409."
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspaceInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:write"
            ]
          }
        ]
      }
    },
    "/workspaces/{workspace}": {
      "get": {
        "tags": [
          "workspaces"
        ],
        "summary": "Get a workspace",
        "operationId": "getWorkspace",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:read"
            ]
          }
        ]
      }
    },
    "/workspaces/{workspace}/billing-transfer": {
      "get": {
        "tags": [
          "workspaces"
        ],
        "summary": "Get pending workspace billing transfer",
        "operationId": "getWorkspaceBillingTransfer",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceBillingTransferOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:read"
            ]
          }
        ]
      }
    },
    "/workspaces/{workspace}/members": {
      "get": {
        "tags": [
          "workspaces"
        ],
        "summary": "List workspace members and pending invites",
        "operationId": "listWorkspaceMembers",
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceMemberOutput"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": [
              "projects:read"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "BillingOutput": {
        "required": [
          "account_id",
          "name",
          "address_line1",
          "address_line2",
          "address_city",
          "address_state",
          "address_zip",
          "address_country",
          "brand",
          "exp_month",
          "exp_year",
          "last4",
          "monthly_budget",
          "budget_alerts",
          "budget_stop",
          "charge_amount",
          "charge_threshold"
        ],
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string"
          },
          "address_city": {
            "type": "string"
          },
          "address_country": {
            "type": "string"
          },
          "address_line1": {
            "type": "string"
          },
          "address_line2": {
            "type": "string"
          },
          "address_state": {
            "type": "string"
          },
          "address_zip": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "budget_alerts": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "budget_stop": {
            "type": "boolean"
          },
          "charge_amount": {
            "minimum": 0,
            "type": "integer"
          },
          "charge_threshold": {
            "minimum": 0,
            "type": "integer"
          },
          "exp_month": {
            "minimum": 0,
            "type": "integer"
          },
          "exp_year": {
            "minimum": 0,
            "type": "integer"
          },
          "force_update": {
            "type": "string",
            "format": "date-time"
          },
          "last4": {
            "type": "string"
          },
          "monthly_budget": {
            "minimum": 0,
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "update": {
            "type": "boolean"
          }
        }
      },
      "BillingTransactionEntry": {
        "required": [
          "created_at",
          "description",
          "amount"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BillingTransactionMonth": {
        "required": [
          "created_at",
          "year",
          "month",
          "balance",
          "tx"
        ],
        "type": "object",
        "properties": {
          "balance": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "month": {
            "type": "integer"
          },
          "tx": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BillingTransactionEntry"
            }
          },
          "year": {
            "type": "integer"
          }
        }
      },
      "BinaryStream": {
        "type": "string",
        "format": "binary"
      },
      "CreateProjectDomainInput": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "primary": {
            "type": "boolean"
          }
        }
      },
      "CreateProjectInput": {
        "required": [
          "region",
          "runtime",
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "runtime": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          }
        }
      },
      "CreateProjectRuleInput": {
        "required": [
          "name",
          "conditions",
          "actions"
        ],
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleStatement"
            }
          },
          "active": {
            "type": "boolean"
          },
          "conditions": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/RuleStatement"
              }
            }
          },
          "name": {
            "type": "string"
          },
          "priority": {
            "type": "number"
          }
        }
      },
      "CreateProjectVariableInput": {
        "required": [
          "name",
          "value"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "sensitive": {
            "type": "boolean"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "CreateSQLStatementInput": {
        "required": [
          "sql",
          "read_only"
        ],
        "type": "object",
        "properties": {
          "read_only": {
            "type": "boolean"
          },
          "sql": {
            "type": "string"
          },
          "timeout": {
            "type": "integer"
          }
        }
      },
      "CreateWorkspaceInput": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "ErrorPayload": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "resource": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorPayload"
          }
        }
      },
      "FreeformObject": {
        "type": "object",
        "additionalProperties": true,
        "description": "Freeform JSON object proxied from the edge runtime; the shape is owned by that service and may evolve independently of this API."
      },
      "NotificationOutput": {
        "required": [
          "id",
          "created_at",
          "priority",
          "name",
          "title",
          "description",
          "url"
        ],
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "PaymentMethodAddressOutput": {
        "required": [
          "line1",
          "line2",
          "city",
          "state",
          "postal_code",
          "country"
        ],
        "type": "object",
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "PaymentMethodBillingDetailsOutput": {
        "required": [
          "name",
          "address"
        ],
        "type": "object",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/PaymentMethodAddressOutput"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "PaymentMethodCardOutput": {
        "required": [
          "brand",
          "exp_month",
          "exp_year",
          "last4"
        ],
        "type": "object",
        "properties": {
          "brand": {
            "type": "string"
          },
          "exp_month": {
            "minimum": 0,
            "type": "integer"
          },
          "exp_year": {
            "minimum": 0,
            "type": "integer"
          },
          "last4": {
            "type": "string"
          }
        }
      },
      "PaymentMethodOutput": {
        "required": [
          "id",
          "type",
          "is_default",
          "billing_details",
          "card"
        ],
        "type": "object",
        "properties": {
          "billing_details": {
            "$ref": "#/components/schemas/PaymentMethodBillingDetailsOutput"
          },
          "card": {
            "$ref": "#/components/schemas/PaymentMethodCardOutput"
          },
          "id": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "PendingVerification": {
        "required": [
          "channel",
          "target"
        ],
        "type": "object",
        "properties": {
          "channel": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "target": {
            "type": "string"
          }
        }
      },
      "ProjectBackupEntry": {
        "required": [
          "id",
          "created_at",
          "status",
          "automatic"
        ],
        "type": "object",
        "properties": {
          "automatic": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "database_size": {
            "type": "integer"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "runtime": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "storage_size": {
            "type": "integer"
          }
        }
      },
      "ProjectBackupPolicyOutput": {
        "required": [
          "frequency_days",
          "retention_days"
        ],
        "type": "object",
        "properties": {
          "frequency_days": {
            "minimum": 0,
            "type": "integer"
          },
          "retention_days": {
            "minimum": 0,
            "type": "integer"
          }
        }
      },
      "ProjectDetail": {
        "required": [
          "id",
          "workspace_id",
          "created_at",
          "updated_at",
          "name",
          "active",
          "status",
          "region",
          "runtime"
        ],
        "type": "object",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "name": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "runtime": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          }
        }
      },
      "ProjectDomainOutput": {
        "required": [
          "id",
          "name",
          "primary",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "name": {
            "type": "string"
          },
          "primary": {
            "type": "boolean"
          }
        }
      },
      "ProjectFileEntry": {
        "required": [
          "name",
          "path",
          "is_dir",
          "size",
          "modified_at"
        ],
        "type": "object",
        "properties": {
          "etag": {
            "type": "string"
          },
          "is_dir": {
            "type": "boolean"
          },
          "modified_at": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          }
        }
      },
      "ProjectLogEventOutput": {
        "required": [
          "request_id",
          "timestamp",
          "priority",
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "request_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectRuleOutput": {
        "required": [
          "id",
          "created_at",
          "updated_at",
          "active",
          "name",
          "priority",
          "conditions",
          "actions"
        ],
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleStatement"
            }
          },
          "active": {
            "type": "boolean"
          },
          "conditions": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/RuleStatement"
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "name": {
            "type": "string"
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectSummary": {
        "required": [
          "id",
          "workspace_id",
          "created_at",
          "updated_at",
          "name",
          "active",
          "status",
          "region",
          "runtime"
        ],
        "type": "object",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "name": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "runtime": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          }
        }
      },
      "ProjectUsageOutput": {
        "required": [
          "events_at",
          "requests_total",
          "requests_worker",
          "responses_1xx",
          "responses_2xx",
          "responses_3xx",
          "responses_4xx",
          "responses_5xx",
          "duration_total",
          "duration_average",
          "datatransfer_out",
          "storage_size",
          "database_size",
          "backup_size"
        ],
        "type": "object",
        "properties": {
          "backup_size": {
            "type": "integer"
          },
          "database_size": {
            "type": "integer"
          },
          "datatransfer_out": {
            "type": "integer"
          },
          "duration_average": {
            "type": "integer"
          },
          "duration_total": {
            "type": "integer"
          },
          "events_at": {
            "type": "string",
            "format": "date-time"
          },
          "requests_total": {
            "type": "integer"
          },
          "requests_worker": {
            "type": "integer"
          },
          "responses_1xx": {
            "type": "integer"
          },
          "responses_2xx": {
            "type": "integer"
          },
          "responses_3xx": {
            "type": "integer"
          },
          "responses_4xx": {
            "type": "integer"
          },
          "responses_5xx": {
            "type": "integer"
          },
          "storage_size": {
            "type": "integer"
          }
        }
      },
      "ProjectUsageResponse": {
        "required": [
          "items",
          "totals"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectUsageOutput"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/ProjectUsageTotals"
          }
        }
      },
      "ProjectUsageTotals": {
        "required": [
          "requests_total",
          "requests_worker",
          "responses_1xx",
          "responses_2xx",
          "responses_3xx",
          "responses_4xx",
          "responses_5xx",
          "duration_total",
          "duration_average",
          "datatransfer_out",
          "storage_size",
          "database_size",
          "backup_size"
        ],
        "type": "object",
        "properties": {
          "backup_size": {
            "type": "integer"
          },
          "database_size": {
            "type": "integer"
          },
          "datatransfer_out": {
            "type": "integer"
          },
          "duration_average": {
            "type": "integer"
          },
          "duration_total": {
            "type": "integer"
          },
          "requests_total": {
            "type": "integer"
          },
          "requests_worker": {
            "type": "integer"
          },
          "responses_1xx": {
            "type": "integer"
          },
          "responses_2xx": {
            "type": "integer"
          },
          "responses_3xx": {
            "type": "integer"
          },
          "responses_4xx": {
            "type": "integer"
          },
          "responses_5xx": {
            "type": "integer"
          },
          "storage_size": {
            "type": "integer"
          }
        }
      },
      "ProjectVariableOutput": {
        "required": [
          "id",
          "name",
          "sensitive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "name": {
            "type": "string"
          },
          "sensitive": {
            "type": "boolean"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "RegionOutput": {
        "required": [
          "id",
          "created_at",
          "updated_at",
          "description"
        ],
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RuleActionOption": {
        "required": [
          "operator"
        ],
        "type": "object",
        "properties": {
          "allowed_values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Domain of allowed values when this action takes one. Omitted for terminal actions that take no value (e.g. \"end\")."
          },
          "description": {
            "type": "string",
            "description": "Human-readable explanation of the action's effect."
          },
          "fact": {
            "type": "string",
            "description": "Dotted fact key the action mutates. Omitted for terminal actions like \"end\"."
          },
          "operator": {
            "type": "string",
            "description": "Action operator code (e.g. \"set\", \"end\")."
          }
        }
      },
      "RuleCatalogNotes": {
        "required": [
          "statement_shape",
          "conditions_shape",
          "terminal_action_end"
        ],
        "type": "object",
        "properties": {
          "conditions_shape": {
            "type": "string",
            "description": "How to build the conditions object: a JSON object containing one or more of 'all' (AND), 'any' (OR), or 'not' (negated AND). Each maps to an array of statements."
          },
          "statement_shape": {
            "type": "string",
            "description": "How to build a single rule statement from a catalog entry: copy fact/operator from the entry, then supply a single string 'value' (NOT 'values') chosen from the entry's 'allowed_values' domain."
          },
          "terminal_action_end": {
            "type": "string",
            "description": "Explanation of the special {\"operator\":\"end\"} action."
          }
        }
      },
      "RuleConditionOption": {
        "required": [
          "fact",
          "operators",
          "allowed_values"
        ],
        "type": "object",
        "properties": {
          "allowed_values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Domain of allowed value strings. A single \"*\" entry means any string is accepted; a literal list like [\"http\",\"https\"] means the value must be one of those exact strings. Each rule statement carries a single value (the request shape's \"value\" field), not this array."
          },
          "description": {
            "type": "string",
            "description": "Human-readable note about when this fact is observable and how the engine evaluates it."
          },
          "fact": {
            "type": "string",
            "description": "Dotted fact key, e.g. \"request.method\". A trailing \".*\" (\"request.header.*\") means any sub-key is accepted."
          },
          "operators": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Operator codes allowed for this fact when used inside conditions.all / .any / .not arrays."
          }
        }
      },
      "RuleOptionsOutput": {
        "required": [
          "conditions",
          "actions",
          "templates",
          "notes"
        ],
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleActionOption"
            }
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleConditionOption"
            }
          },
          "notes": {
            "$ref": "#/components/schemas/RuleCatalogNotes"
          },
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleTemplateOutput"
            }
          }
        }
      },
      "RuleStatement": {
        "type": "object",
        "properties": {
          "fact": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "RuleTemplateOutput": {
        "required": [
          "name",
          "conditions",
          "actions"
        ],
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleStatement"
            }
          },
          "conditions": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/RuleStatement"
              }
            }
          },
          "name": {
            "type": "string"
          }
        }
      },
      "RuntimeOutput": {
        "required": [
          "id",
          "created_at",
          "updated_at",
          "description"
        ],
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deprecated_at": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SelfUser": {
        "required": [
          "id",
          "created_at",
          "email",
          "name",
          "effective_scopes"
        ],
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "effective_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "StatementListItem": {
        "required": [
          "id",
          "status",
          "submitted_at",
          "sql_preview"
        ],
        "type": "object",
        "properties": {
          "duration_ms": {
            "type": "integer",
            "nullable": true
          },
          "id": {
            "type": "string"
          },
          "sql_preview": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "submitted_at": {
            "type": "string"
          }
        }
      },
      "UpdateBillingInput": {
        "type": "object",
        "properties": {
          "budget_alerts": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "budget_stop": {
            "type": "boolean"
          },
          "charge_amount": {
            "minimum": 0,
            "type": "integer"
          },
          "charge_threshold": {
            "minimum": 0,
            "type": "integer"
          },
          "monthly_budget": {
            "minimum": 0,
            "type": "integer"
          }
        }
      },
      "UpdateProjectBackupPolicyInput": {
        "type": "object",
        "properties": {
          "frequency_days": {
            "type": "integer"
          },
          "retention_days": {
            "type": "integer"
          }
        }
      },
      "UpdateProjectDomainInput": {
        "type": "object",
        "properties": {
          "primary": {
            "type": "boolean"
          }
        }
      },
      "UpdateProjectInput": {
        "type": "object",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "runtime": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          }
        }
      },
      "UpdateProjectRuleInput": {
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleStatement"
            }
          },
          "active": {
            "type": "boolean"
          },
          "conditions": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/RuleStatement"
              }
            }
          },
          "name": {
            "type": "string"
          },
          "priority": {
            "type": "number"
          }
        }
      },
      "UpdateProjectVariableInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "sensitive": {
            "type": "boolean"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "WorkspaceBillingTransferOutput": {
        "required": [
          "id",
          "workspace_id",
          "requested_by_user_id",
          "requested_by_email",
          "target_user_id",
          "target_email",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "requested_by_email": {
            "type": "string"
          },
          "requested_by_name": {
            "type": "string"
          },
          "requested_by_user_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "target_email": {
            "type": "string"
          },
          "target_name": {
            "type": "string"
          },
          "target_user_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          }
        }
      },
      "WorkspaceMemberOutput": {
        "required": [
          "status",
          "email",
          "role",
          "created_at",
          "updated_at",
          "is_billing_user"
        ],
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "email": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "invite_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "is_billing_user": {
            "type": "boolean"
          },
          "mfa_enabled": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "user_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          }
        }
      },
      "WorkspaceOutput": {
        "required": [
          "id",
          "created_at",
          "updated_at",
          "name",
          "role",
          "billing_user_id",
          "require_mfa"
        ],
        "type": "object",
        "properties": {
          "billing_user_id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "01935d3d-9d8c-7a30-9b1f-3b3a8e1c5a2f"
          },
          "name": {
            "type": "string"
          },
          "require_mfa": {
            "type": "boolean"
          },
          "role": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key issued by POST /auth/tokens, sent as `Authorization: Bearer \u003ctoken\u003e`. Scopes are fixed at issue time and enforced server-side."
      }
    }
  }
}
