{
  "components": {
    "parameters": {
      "APIKeyID": {
        "in": "path",
        "name": "api_key_id",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "AppID": {
        "in": "path",
        "name": "app_id",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "BuildID": {
        "in": "path",
        "name": "build_id",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "ClaimID": {
        "in": "path",
        "name": "claim_id",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "DatabaseID": {
        "in": "path",
        "name": "database_id",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "MemberEmail": {
        "in": "path",
        "name": "member_email",
        "required": true,
        "schema": {
          "format": "email",
          "type": "string"
        }
      },
      "ReleaseID": {
        "in": "path",
        "name": "release_id",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      }
    },
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Error response"
      }
    },
    "schemas": {
      "APIKey": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "created_at"
        ],
        "type": "object"
      },
      "App": {
        "properties": {
          "access": {
            "description": "Effective access for the authenticated caller.",
            "enum": [
              "read",
              "write"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "maxLength": 175,
            "minLength": 1,
            "type": "string"
          },
          "environment_revision": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lifecycle_state": {
            "enum": [
              "unavailable",
              "active",
              "standbying",
              "standby",
              "waking",
              "archiving",
              "archived",
              "recovering",
              "expired"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string"
          },
          "preview_routing": {
            "description": "Whether configured preview domains delegate requests to this app.",
            "type": "boolean"
          },
          "scope": {
            "enum": [
              "internal",
              "private"
            ],
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "slug",
          "url",
          "scope",
          "access",
          "preview_routing",
          "lifecycle_state",
          "environment_revision",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "AppEnvironment": {
        "properties": {
          "revision": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "variables": {
            "items": {
              "$ref": "#/components/schemas/EnvironmentVariable"
            },
            "type": "array"
          }
        },
        "required": [
          "revision",
          "variables"
        ],
        "type": "object"
      },
      "AppMember": {
        "properties": {
          "access": {
            "enum": [
              "read",
              "write"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "user_id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "email",
          "access",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "AppPublicIngress": {
        "properties": {
          "rules": {
            "items": {
              "$ref": "#/components/schemas/PublicIngressRule"
            },
            "maxItems": 32,
            "type": "array"
          }
        },
        "required": [
          "rules"
        ],
        "type": "object"
      },
      "AppSharing": {
        "properties": {
          "organization_access": {
            "description": "Effective access granted to every authenticated organization user. Present only for internal apps.",
            "enum": [
              "read",
              "write"
            ],
            "type": "string"
          },
          "scope": {
            "enum": [
              "internal",
              "private"
            ],
            "type": "string"
          }
        },
        "required": [
          "scope"
        ],
        "type": "object"
      },
      "Build": {
        "properties": {
          "app_id": {
            "format": "uuid",
            "type": "string"
          },
          "commit": {
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "type": "string"
          },
          "context": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "dockerfile": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "image_digest": {
            "pattern": "^sha256:[a-f0-9]{64}$",
            "type": "string"
          },
          "image_ref": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "cloning",
              "building",
              "pushing",
              "succeeded",
              "failed",
              "cancelled"
            ],
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "app_id",
          "commit",
          "dockerfile",
          "context",
          "platform",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ClaimedIdentity": {
        "properties": {
          "api_key": {
            "$ref": "#/components/schemas/IssuedAPIKey"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          }
        },
        "required": [
          "user",
          "api_key"
        ],
        "type": "object"
      },
      "CreateAppRequest": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "maxLength": 175,
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string"
          },
          "preview_routing": {
            "default": false,
            "type": "boolean"
          },
          "slug": {
            "maxLength": 50,
            "minLength": 3,
            "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$",
            "type": "string"
          }
        },
        "required": [
          "name",
          "description",
          "slug"
        ],
        "type": "object"
      },
      "CreateBuildRequest": {
        "additionalProperties": false,
        "properties": {
          "commit": {
            "pattern": "^([a-f0-9]{40}|[a-f0-9]{64})$",
            "type": "string"
          },
          "context": {
            "default": ".",
            "type": "string"
          },
          "dockerfile": {
            "default": "Dockerfile",
            "type": "string"
          },
          "platform": {
            "default": "linux/amd64",
            "enum": [
              "linux/amd64"
            ],
            "type": "string"
          },
          "target": {
            "type": "string"
          }
        },
        "required": [
          "commit"
        ],
        "type": "object"
      },
      "CreateDatabaseRequest": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "maxLength": 63,
            "minLength": 1,
            "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateImageReleaseRequest": {
        "additionalProperties": false,
        "properties": {
          "build_id": {
            "format": "uuid",
            "type": "string"
          },
          "environment_revision": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "expected_active_release_id": {
            "format": "uuid",
            "type": "string"
          },
          "health_check": {
            "additionalProperties": false,
            "properties": {
              "path": {
                "default": "/",
                "pattern": "^/",
                "type": "string"
              },
              "timeout_seconds": {
                "default": 120,
                "maximum": 1800,
                "minimum": 1,
                "type": "integer"
              }
            },
            "type": "object"
          },
          "port": {
            "default": 3000,
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "promote": {
            "deprecated": true,
            "description": "Accepted for compatibility and ignored; healthy releases activate automatically.",
            "type": "boolean"
          }
        },
        "required": [
          "build_id"
        ],
        "type": "object"
      },
      "Database": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "provisioning",
              "ready",
              "deleting"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "DeploymentPolicy": {
        "properties": {
          "app_id": {
            "format": "uuid",
            "type": "string"
          },
          "auto_deploy": {
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "production_branch": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "app_id",
          "production_branch",
          "auto_deploy",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "EmailClaim": {
        "properties": {
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "retry_after": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "expires_at",
          "retry_after"
        ],
        "type": "object"
      },
      "EnvironmentReference": {
        "additionalProperties": false,
        "properties": {
          "database_id": {
            "format": "uuid",
            "type": "string"
          },
          "type": {
            "enum": [
              "database_url"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "database_id"
        ],
        "type": "object"
      },
      "EnvironmentVariable": {
        "properties": {
          "database_id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "enum": [
              "literal",
              "database_url"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "name",
          "source",
          "updated_at"
        ],
        "type": "object"
      },
      "Error": {
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "recovery": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "GitCredential": {
        "properties": {
          "clone_url": {
            "format": "uri",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "clone_url",
          "username",
          "password",
          "expires_at"
        ],
        "type": "object"
      },
      "GitRepository": {
        "properties": {
          "app_id": {
            "format": "uuid",
            "type": "string"
          },
          "clone_url": {
            "format": "uri",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "default_branch": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "app_id",
          "clone_url",
          "default_branch",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ImageRelease": {
        "properties": {
          "activated_at": {
            "format": "date-time",
            "type": "string"
          },
          "app_id": {
            "format": "uuid",
            "type": "string"
          },
          "attempt_count": {
            "minimum": 0,
            "type": "integer"
          },
          "build_id": {
            "format": "uuid",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "environment_revision": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "health_check": {
            "properties": {
              "path": {
                "type": "string"
              },
              "timeout_seconds": {
                "type": "integer"
              }
            },
            "required": [
              "path",
              "timeout_seconds"
            ],
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "image_digest": {
            "pattern": "^sha256:[a-f0-9]{64}$",
            "type": "string"
          },
          "image_ref": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "sequence": {
            "format": "int64",
            "type": "integer"
          },
          "state": {
            "enum": [
              "queued",
              "preparing",
              "starting",
              "active",
              "retired",
              "failed"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "app_id",
          "build_id",
          "sequence",
          "state",
          "environment_revision",
          "image_ref",
          "image_digest",
          "port",
          "health_check",
          "attempt_count",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "IssuedAPIKey": {
        "allOf": [
          {
            "$ref": "#/components/schemas/APIKey"
          },
          {
            "properties": {
              "token": {
                "type": "string"
              }
            },
            "required": [
              "token"
            ],
            "type": "object"
          }
        ]
      },
      "PublicIngressRule": {
        "additionalProperties": false,
        "properties": {
          "methods": {
            "items": {
              "enum": [
                "GET",
                "HEAD",
                "POST",
                "PUT",
                "PATCH",
                "DELETE",
                "OPTIONS"
              ],
              "type": "string",
              "x-enum-varnames": [
                "PublicIngressMethodGet",
                "PublicIngressMethodHead",
                "PublicIngressMethodPost",
                "PublicIngressMethodPut",
                "PublicIngressMethodPatch",
                "PublicIngressMethodDelete",
                "PublicIngressMethodOptions"
              ]
            },
            "maxItems": 7,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "path": {
            "description": "Exact URL path to expose. Query parameters do not affect matching.",
            "maxLength": 2048,
            "minLength": 1,
            "pattern": "^/",
            "type": "string"
          }
        },
        "required": [
          "path",
          "methods"
        ],
        "type": "object"
      },
      "PutAppMemberRequest": {
        "additionalProperties": false,
        "properties": {
          "access": {
            "enum": [
              "read",
              "write"
            ],
            "type": "string"
          }
        },
        "required": [
          "access"
        ],
        "type": "object"
      },
      "PutDeploymentPolicyRequest": {
        "additionalProperties": false,
        "properties": {
          "auto_deploy": {
            "type": "boolean"
          },
          "production_branch": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "production_branch",
          "auto_deploy"
        ],
        "type": "object"
      },
      "RequestEmailClaim": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "format": "email",
            "maxLength": 254,
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "UpdateAppEnvironment": {
        "additionalProperties": false,
        "properties": {
          "expected_revision": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "set": {
            "additionalProperties": {
              "maxLength": 32768,
              "type": "string"
            },
            "maxProperties": 100,
            "type": "object"
          },
          "set_references": {
            "additionalProperties": {
              "$ref": "#/components/schemas/EnvironmentReference"
            },
            "maxProperties": 100,
            "type": "object"
          },
          "unset": {
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "type": "array",
            "uniqueItems": true
          }
        },
        "required": [
          "set",
          "unset",
          "expected_revision"
        ],
        "type": "object"
      },
      "UpdateAppPublicIngress": {
        "additionalProperties": false,
        "properties": {
          "rules": {
            "items": {
              "$ref": "#/components/schemas/PublicIngressRule"
            },
            "maxItems": 32,
            "type": "array"
          }
        },
        "required": [
          "rules"
        ],
        "type": "object"
      },
      "UpdateAppSharing": {
        "additionalProperties": false,
        "properties": {
          "organization_access": {
            "enum": [
              "read",
              "write"
            ],
            "type": "string",
            "x-enum-varnames": [
              "UpdateAppSharingOrganizationAccessRead",
              "UpdateAppSharingOrganizationAccessWrite"
            ]
          },
          "scope": {
            "enum": [
              "internal",
              "private"
            ],
            "type": "string",
            "x-enum-varnames": [
              "UpdateAppSharingScopeInternal",
              "UpdateAppSharingScopePrivate"
            ]
          }
        },
        "required": [
          "scope"
        ],
        "type": "object"
      },
      "User": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "created_at"
        ],
        "type": "object"
      },
      "VerifyEmailClaim": {
        "additionalProperties": false,
        "properties": {
          "api_key_name": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "code": {
            "pattern": "^[0-9]{6}$",
            "type": "string"
          }
        },
        "required": [
          "code",
          "api_key_name"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "API for Git-backed application builds and single-runtime deployments.",
    "title": "Configurable application host API",
    "version": "0.1.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/auth.md": {
      "get": {
        "operationId": "GetAuthDocument",
        "responses": {
          "200": {
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Authentication instructions"
          }
        },
        "tags": [
          "discovery"
        ]
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "GetAgentDocument",
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Agent instructions"
          }
        },
        "tags": [
          "discovery"
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "GetOpenAPIJSON",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object"
                }
              }
            },
            "description": "OpenAPI JSON contract"
          }
        },
        "tags": [
          "discovery"
        ]
      }
    },
    "/openapi.yaml": {
      "get": {
        "operationId": "GetOpenAPIYAML",
        "responses": {
          "200": {
            "content": {
              "application/yaml": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OpenAPI source contract"
          }
        },
        "tags": [
          "discovery"
        ]
      }
    },
    "/v1/api-keys": {
      "get": {
        "operationId": "ListAPIKeys",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "api_keys": {
                      "items": {
                        "$ref": "#/components/schemas/APIKey"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "api_keys"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Named API keys"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "identity"
        ]
      }
    },
    "/v1/api-keys/{api_key_id}": {
      "delete": {
        "operationId": "RevokeAPIKey",
        "responses": {
          "204": {
            "description": "API key revoked"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "identity"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/APIKeyID"
        }
      ]
    },
    "/v1/apps": {
      "get": {
        "operationId": "ListApps",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "apps": {
                      "items": {
                        "$ref": "#/components/schemas/App"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "apps"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Apps accessible to the caller"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "apps"
        ]
      },
      "post": {
        "operationId": "CreateApp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            },
            "description": "App created"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "apps"
        ]
      }
    },
    "/v1/apps/{app_id}": {
      "delete": {
        "description": "Delete an app, its release instances and ingresses, and its Code Storage repository. The slug returns a temporary tombstone.",
        "operationId": "DeleteApp",
        "responses": {
          "204": {
            "description": "App deleted"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "apps"
        ]
      },
      "get": {
        "operationId": "GetApp",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            },
            "description": "App"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "apps"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ]
    },
    "/v1/apps/{app_id}/builds": {
      "get": {
        "operationId": "ListBuilds",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "builds": {
                      "items": {
                        "$ref": "#/components/schemas/Build"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "builds"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Builds for an app"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "builds"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ],
      "post": {
        "operationId": "CreateBuild",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBuildRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Build"
                }
              }
            },
            "description": "Build queued"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "builds"
        ]
      }
    },
    "/v1/apps/{app_id}/deployment-policy": {
      "get": {
        "operationId": "GetDeploymentPolicy",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentPolicy"
                }
              }
            },
            "description": "App deployment policy"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "releases"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ],
      "put": {
        "operationId": "PutDeploymentPolicy",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutDeploymentPolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentPolicy"
                }
              }
            },
            "description": "Updated deployment policy"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "releases"
        ]
      }
    },
    "/v1/apps/{app_id}/environment": {
      "get": {
        "operationId": "GetAppEnvironment",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppEnvironment"
                }
              }
            },
            "description": "Write-only app environment metadata"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "environment"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ],
      "patch": {
        "operationId": "UpdateAppEnvironment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppEnvironment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppEnvironment"
                }
              }
            },
            "description": "Updated write-only app environment metadata"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "environment"
        ]
      }
    },
    "/v1/apps/{app_id}/members": {
      "get": {
        "operationId": "ListAppMembers",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "members": {
                      "items": {
                        "$ref": "#/components/schemas/AppMember"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "members"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "App members"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "members"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ]
    },
    "/v1/apps/{app_id}/members/{member_email}": {
      "delete": {
        "operationId": "DeleteAppMember",
        "responses": {
          "204": {
            "description": "App member removed"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "members"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        },
        {
          "$ref": "#/components/parameters/MemberEmail"
        }
      ],
      "put": {
        "operationId": "PutAppMember",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutAppMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppMember"
                }
              }
            },
            "description": "App member created or updated"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "members"
        ]
      }
    },
    "/v1/apps/{app_id}/public-ingress": {
      "get": {
        "operationId": "GetAppPublicIngress",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppPublicIngress"
                }
              }
            },
            "description": "Exact app paths and methods that accept unauthenticated traffic"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "public-ingress"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ],
      "put": {
        "operationId": "UpdateAppPublicIngress",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppPublicIngress"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppPublicIngress"
                }
              }
            },
            "description": "Replaced public ingress allowlist"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "public-ingress"
        ]
      }
    },
    "/v1/apps/{app_id}/releases": {
      "get": {
        "operationId": "ListImageReleases",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "releases": {
                      "items": {
                        "$ref": "#/components/schemas/ImageRelease"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "releases"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Image releases for an app"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "releases"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ],
      "post": {
        "operationId": "CreateImageRelease",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateImageReleaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageRelease"
                }
              }
            },
            "description": "Image release queued for deployment"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "releases"
        ]
      }
    },
    "/v1/apps/{app_id}/repository": {
      "get": {
        "operationId": "GetAppRepository",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitRepository"
                }
              }
            },
            "description": "App Git repository"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "repositories"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ]
    },
    "/v1/apps/{app_id}/repository/credentials": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ],
      "post": {
        "operationId": "CreateRepositoryCredential",
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitCredential"
                }
              }
            },
            "description": "Short-lived Git credential"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "repositories"
        ]
      }
    },
    "/v1/apps/{app_id}/sharing": {
      "get": {
        "operationId": "GetAppSharing",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSharing"
                }
              }
            },
            "description": "App sharing configuration"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "sharing"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/AppID"
        }
      ],
      "put": {
        "operationId": "UpdateAppSharing",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppSharing"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSharing"
                }
              }
            },
            "description": "Updated sharing configuration"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "sharing"
        ]
      }
    },
    "/v1/builds/{build_id}": {
      "get": {
        "operationId": "GetBuild",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Build"
                }
              }
            },
            "description": "Build"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "builds"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BuildID"
        }
      ]
    },
    "/v1/builds/{build_id}/events": {
      "get": {
        "operationId": "GetBuildEvents",
        "parameters": [
          {
            "in": "query",
            "name": "follow",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Hypeman build events, including log lines, status changes, and heartbeats, streamed as server-sent events"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "builds"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BuildID"
        }
      ]
    },
    "/v1/databases": {
      "get": {
        "operationId": "ListDatabases",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "databases": {
                      "items": {
                        "$ref": "#/components/schemas/Database"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "databases"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "PostgreSQL databases owned by the caller"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "databases"
        ]
      },
      "post": {
        "operationId": "CreateDatabase",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDatabaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Database"
                }
              }
            },
            "description": "PostgreSQL database and restricted application role provisioned"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "databases"
        ]
      }
    },
    "/v1/databases/{database_id}": {
      "delete": {
        "operationId": "DeleteDatabase",
        "responses": {
          "204": {
            "description": "PostgreSQL database and restricted application role deleted"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "databases"
        ]
      },
      "get": {
        "operationId": "GetDatabase",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Database"
                }
              }
            },
            "description": "PostgreSQL database metadata"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "databases"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/DatabaseID"
        }
      ]
    },
    "/v1/identity/claims": {
      "post": {
        "operationId": "RequestEmailClaim",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestEmailClaim"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailClaim"
                }
              }
            },
            "description": "Claim sent through configured SMTP transport"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "identity"
        ]
      }
    },
    "/v1/identity/claims/{claim_id}/verify": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClaimID"
        }
      ],
      "post": {
        "operationId": "VerifyEmailClaim",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailClaim"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimedIdentity"
                }
              }
            },
            "description": "Claimed identity and API key shown once"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "identity"
        ]
      }
    },
    "/v1/releases/{release_id}": {
      "get": {
        "operationId": "GetImageRelease",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageRelease"
                }
              }
            },
            "description": "Image release"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "releases"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ReleaseID"
        }
      ]
    },
    "/v1/releases/{release_id}/logs": {
      "get": {
        "description": "Streams application output while the release instance exists.",
        "operationId": "GetImageReleaseLogs",
        "parameters": [
          {
            "in": "query",
            "name": "tail",
            "schema": {
              "default": 100,
              "maximum": 10000,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "follow",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Application output streamed as server-sent events"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "releases"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ReleaseID"
        }
      ]
    }
  }
}