{
  "openapi": "3.0.3",
  "info": {
    "title": "Noteble API",
    "description": "Backend for the Noteble product. Houses Noteble-specific endpoints (drafts, architecture, streaming sessions, admin, users/me-except-avatar). Generic document-platform primitives (documents, templates, projects, sharing, AI generation) live in the shared docplatform service at api.puglieseweb.com/docs \u2014 see ADR-006.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.puglieseweb.com/noteble/v1",
      "description": "Production"
    }
  ],
  "paths": {
    "/admin/plans": {
      "get": {
        "tags": [
          "Admin - Plans"
        ],
        "summary": "List subscription plans",
        "description": "List all subscription plans including inactive ones, sorted by sortOrder. Admin only.",
        "operationId": "list_plans_admin_plans_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Plan list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Admin - Plans"
        ],
        "summary": "Create a subscription plan",
        "description": "Create a new subscription plan with pricing, features, and limits. Admin only.",
        "operationId": "create_plan_admin_plans_post",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "201": {
            "description": "Plan created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanMutationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g. missing planId)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Plan already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin/plans/{plan_id}": {
      "get": {
        "tags": [
          "Admin - Plans"
        ],
        "summary": "Get a subscription plan",
        "description": "Retrieve a specific subscription plan by its ID. Admin only.",
        "operationId": "get_plan_admin_plans__plan_id__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Plan Id"
            },
            "name": "plan_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Plan detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Admin - Plans"
        ],
        "summary": "Update a subscription plan",
        "description": "Update fields on an existing subscription plan. Only provided fields are changed. Admin only.",
        "operationId": "update_plan_admin_plans__plan_id__put",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Plan Id"
            },
            "name": "plan_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Plan updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanMutationResponse"
                }
              }
            }
          },
          "400": {
            "description": "No fields to update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Admin - Plans"
        ],
        "summary": "Delete a subscription plan",
        "description": "Permanently delete a subscription plan by ID. Admin only.",
        "operationId": "delete_plan_admin_plans__plan_id__delete",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Plan Id"
            },
            "name": "plan_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Plan deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanDeleteResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin/system-prompts": {
      "get": {
        "tags": [
          "Admin - System Prompts"
        ],
        "summary": "List system prompts",
        "description": "List all system prompts sorted by category. Admin only.",
        "operationId": "list_prompts_admin_system_prompts_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Prompt list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemPromptListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Admin - System Prompts"
        ],
        "summary": "Create a system prompt",
        "description": "Create a new system prompt. Requires promptId, promptName, category, and template. Admin only.",
        "operationId": "create_prompt_admin_system_prompts_post",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "201": {
            "description": "Prompt created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSystemPromptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Prompt already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin/system-prompts/{prompt_id}": {
      "get": {
        "tags": [
          "Admin - System Prompts"
        ],
        "summary": "Get a system prompt",
        "description": "Retrieve a specific system prompt by its ID. Admin only.",
        "operationId": "get_prompt_admin_system_prompts__prompt_id__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Prompt Id"
            },
            "name": "prompt_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Prompt detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemPromptResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Prompt not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Admin - System Prompts"
        ],
        "summary": "Update a system prompt",
        "description": "Update fields on an existing system prompt. Only provided fields are changed. Admin only.",
        "operationId": "update_prompt_admin_system_prompts__prompt_id__put",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Prompt Id"
            },
            "name": "prompt_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Prompt updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateSystemPromptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or no fields to update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Prompt not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Admin - System Prompts"
        ],
        "summary": "Delete a system prompt",
        "description": "Permanently delete a system prompt by ID. Admin only.",
        "operationId": "delete_prompt_admin_system_prompts__prompt_id__delete",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Prompt Id"
            },
            "name": "prompt_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Prompt deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteSystemPromptResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Prompt not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin/users": {
      "get": {
        "tags": [
          "Admin - Users"
        ],
        "summary": "List users",
        "description": "List all registered Cognito users with document counts and activity data. Supports pagination via nextToken. Admin only.",
        "operationId": "list_users_admin_users_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "User list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin/users/{user_id}": {
      "delete": {
        "tags": [
          "Admin - Users"
        ],
        "summary": "Delete a user",
        "description": "Delete a user account and all associated data \u2014 DynamoDB items, S3 objects, Cognito account, and (async via account.deleted event) the Stripe subscription. Admin only.",
        "operationId": "delete_user_admin_users__user_id__delete",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            },
            "name": "user_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "User deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDeleteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Cannot delete own account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin/users/{user_id}/plan": {
      "put": {
        "tags": [
          "Admin - Users"
        ],
        "summary": "Update user plan",
        "description": "Change a user's subscription plan by updating the custom:plan attribute in Cognito. Admin only.",
        "operationId": "update_user_plan_admin_users__user_id__plan_put",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            },
            "name": "user_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Plan updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateUserPlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin/users/{user_id}/reset-quota": {
      "post": {
        "tags": [
          "Admin - Users"
        ],
        "summary": "Reset daily recording quota",
        "description": "Reset a user's daily recording quota by storing a quotaResetAt timestamp. Admin only.",
        "operationId": "reset_user_quota_admin_users__user_id__reset_quota_post",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            },
            "name": "user_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Quota reset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaResetResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin/users/{user_id}/send-email": {
      "post": {
        "tags": [
          "Admin - Users"
        ],
        "summary": "Send branded email to user",
        "operationId": "send_email_to_user_admin_users__user_id__send_email_post",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            },
            "name": "user_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Email sent",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {}
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {}
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/admin/users/{user_id}/trial-days": {
      "put": {
        "tags": [
          "Admin - Users"
        ],
        "summary": "Update user trial duration",
        "description": "Set a per-user trial duration override (in days) stored in the DynamoDB PROFILE record. Admin only.",
        "operationId": "update_user_trial_days_admin_users__user_id__trial_days_put",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            },
            "name": "user_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Trial days updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateUserTrialDaysResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/architecture/analysis": {
      "get": {
        "tags": [
          "Analysis"
        ],
        "summary": "Get project analysis",
        "description": "Get cached analysis for the user documents.",
        "operationId": "get_analysis_architecture_analysis_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Cached analysis results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalysisResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - capability required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No analysis found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalysisResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/architecture/analysis/refresh": {
      "post": {
        "tags": [
          "Analysis"
        ],
        "summary": "Refresh project analysis",
        "description": "Force re-analysis of user documents using Bedrock Claude.",
        "operationId": "refresh_analysis_architecture_analysis_refresh_post",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Fresh analysis results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalysisResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - capability required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/architecture/docs": {
      "get": {
        "tags": [
          "Architecture"
        ],
        "summary": "List architecture docs",
        "description": "List all architecture documents from S3, organized by hierarchy.",
        "operationId": "list_architecture_docs_architecture_docs_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Document hierarchy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchitectureDocHierarchy"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/architecture/docs/{doc_type}/{doc_id}": {
      "get": {
        "tags": [
          "Architecture"
        ],
        "summary": "Get architecture doc",
        "description": "Get a specific architecture document and its markdown content.",
        "operationId": "get_architecture_doc_architecture_docs__doc_type___doc_id__get",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Doc Type"
            },
            "name": "doc_type",
            "in": "path"
          },
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Doc Id"
            },
            "name": "doc_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Document with metadata and markdown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchitectureDocResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Document not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/architecture/save": {
      "post": {
        "tags": [
          "Architecture"
        ],
        "summary": "Save architecture doc",
        "description": "Save document metadata after upload and convert/process content.",
        "operationId": "save_architecture_doc_architecture_save_post",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Document saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveDocResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/architecture/upload-url": {
      "post": {
        "tags": [
          "Architecture"
        ],
        "summary": "Get upload URL",
        "description": "Generate a presigned URL for uploading architecture documents.",
        "operationId": "upload_architecture_url_architecture_upload_url_post",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Presigned upload URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadUrlResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Service liveness probe",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/streaming/sessions": {
      "get": {
        "tags": [
          "Streaming"
        ],
        "summary": "List streaming sessions",
        "description": "Retrieve active or interrupted streaming sessions for the authenticated user.",
        "operationId": "get_sessions_streaming_sessions_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Session list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamingSessionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/streaming/sessions/{session_id}": {
      "delete": {
        "tags": [
          "Streaming"
        ],
        "summary": "Discard a streaming session",
        "description": "Mark an interrupted or paused streaming session as discarded.",
        "operationId": "delete_session_streaming_sessions__session_id__delete",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            },
            "name": "session_id",
            "in": "path"
          }
        ],
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Session discarded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Session not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/account": {
      "delete": {
        "tags": [
          "User"
        ],
        "summary": "Delete account",
        "description": "Delete all user data and Cognito account. Irreversible.",
        "operationId": "delete_account_users_me_account_delete",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Account deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/avatar": {
      "get": {
        "tags": [
          "User - Avatar"
        ],
        "summary": "Get avatar URL",
        "description": "Get presigned download URL for viewing current avatar.",
        "operationId": "get_avatar_users_me_avatar_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Avatar URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvatarGetResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/avatar/confirm": {
      "post": {
        "tags": [
          "User - Avatar"
        ],
        "summary": "Confirm avatar upload",
        "description": "Confirm avatar upload and save S3 key to Cognito.",
        "operationId": "avatar_confirm_users_me_avatar_confirm_post",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Avatar confirmed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvatarConfirmResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/avatar/upload-url": {
      "post": {
        "tags": [
          "User - Avatar"
        ],
        "summary": "Get avatar upload URL",
        "description": "Generate presigned URL for avatar upload.",
        "operationId": "avatar_upload_url_users_me_avatar_upload_url_post",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Upload URL generated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvatarUploadUrlResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/billing": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get billing and usage",
        "description": "Return monthly usage, costs, and spending limit for the authenticated user.",
        "operationId": "get_billing_users_me_billing_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Billing data",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/users/me/billing/spending-limit": {
      "put": {
        "tags": [
          "User"
        ],
        "summary": "Update spending limit",
        "description": "Update the user's monthly spending limit.",
        "operationId": "update_spending_limit_users_me_billing_spending_limit_put",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Spending limit updated",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/users/me/capabilities": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get user capabilities",
        "description": "Return user plan info and capabilities.",
        "operationId": "get_capabilities_users_me_capabilities_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "User capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserCapabilitiesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/consent": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get consent records",
        "description": "Return all consent records for the authenticated user.",
        "operationId": "get_consent_users_me_consent_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Latest consent record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentRecordResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Record consent decision",
        "description": "Upsert a consent record per consent type. GDPR Article 7 compliance.",
        "operationId": "record_consent_users_me_consent_post",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Consent recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/data-export": {
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Export user data",
        "description": "Export all user data as a ZIP file. GDPR Article 20 (data portability).",
        "operationId": "export_user_data_users_me_data_export_post",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Export ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataExportResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Export failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/profile": {
      "put": {
        "tags": [
          "User"
        ],
        "summary": "Sync user profile",
        "description": "Sync user profile data (email, plan, fullName) from frontend to DynamoDB. Called on login so backend functions can look up user attributes when using access token auth.",
        "operationId": "sync_profile_users_me_profile_put",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Profile synced",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me/settings": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get user settings",
        "description": "Retrieve user preferences.",
        "operationId": "get_settings_users_me_settings_get",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "User settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "User"
        ],
        "summary": "Update user settings",
        "description": "Update user preferences (merge with existing).",
        "operationId": "update_settings_users_me_settings_put",
        "responses": {
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Settings updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HealthResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "service": {
            "type": "string",
            "title": "Service"
          }
        },
        "type": "object",
        "required": [
          "status",
          "service"
        ],
        "title": "HealthResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "ResponseValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "ResponseValidationError"
      },
      "ErrorResponse": {
        "properties": {
          "error": {
            "type": "string",
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "error"
        ],
        "title": "ErrorResponse"
      },
      "StreamingSessionItem": {
        "properties": {
          "sessionId": {
            "type": "string",
            "title": "Sessionid"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "languageCode": {
            "type": "string",
            "title": "Languagecode"
          },
          "startedAt": {
            "type": "integer",
            "title": "Startedat"
          },
          "lastActiveAt": {
            "type": "integer",
            "title": "Lastactiveat"
          },
          "durationSeconds": {
            "type": "integer",
            "title": "Durationseconds"
          },
          "fragmentCount": {
            "type": "integer",
            "title": "Fragmentcount"
          },
          "hasTranscript": {
            "type": "boolean",
            "title": "Hastranscript"
          }
        },
        "type": "object",
        "required": [
          "sessionId",
          "status",
          "languageCode",
          "startedAt",
          "lastActiveAt",
          "durationSeconds",
          "fragmentCount",
          "hasTranscript"
        ],
        "title": "StreamingSessionItem"
      },
      "StreamingSessionListResponse": {
        "properties": {
          "sessions": {
            "items": {
              "$ref": "#/components/schemas/StreamingSessionItem"
            },
            "type": "array",
            "title": "Sessions"
          }
        },
        "type": "object",
        "required": [
          "sessions"
        ],
        "title": "StreamingSessionListResponse"
      },
      "SuccessResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "SuccessResponse"
      },
      "AnalysisInsights": {
        "properties": {
          "summary": {
            "type": "string",
            "title": "Summary",
            "default": ""
          },
          "keyDecisions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Keydecisions",
            "default": []
          },
          "progress": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Progress",
            "default": []
          },
          "openQuestions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Openquestions",
            "default": []
          },
          "risks": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Risks",
            "default": []
          },
          "metrics": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metrics",
            "default": {}
          }
        },
        "type": "object",
        "title": "AnalysisInsights"
      },
      "AnalysisResponse": {
        "properties": {
          "analyzedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Analyzedat"
          },
          "isStale": {
            "type": "boolean",
            "title": "Isstale",
            "default": false
          },
          "documentCount": {
            "type": "integer",
            "title": "Documentcount",
            "default": 0
          },
          "insights": {
            "$ref": "#/components/schemas/AnalysisInsights",
            "default": {
              "summary": "",
              "keyDecisions": [],
              "progress": [],
              "openQuestions": [],
              "risks": [],
              "metrics": {}
            }
          }
        },
        "type": "object",
        "title": "AnalysisResponse"
      },
      "ArchitectureDocHierarchy": {
        "properties": {
          "visions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Visions",
            "default": []
          },
          "systems": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Systems",
            "default": []
          },
          "solutions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Solutions",
            "default": []
          },
          "adrs": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Adrs",
            "default": []
          },
          "byId": {
            "additionalProperties": true,
            "type": "object",
            "title": "Byid",
            "default": {}
          }
        },
        "type": "object",
        "title": "ArchitectureDocHierarchy"
      },
      "ArchitectureDocResponse": {
        "properties": {
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          },
          "markdown": {
            "type": "string",
            "title": "Markdown",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "metadata"
        ],
        "title": "ArchitectureDocResponse"
      },
      "SaveDocResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "docId": {
            "type": "string",
            "title": "Docid"
          },
          "docType": {
            "type": "string",
            "title": "Doctype"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "metadataKey": {
            "type": "string",
            "title": "Metadatakey"
          },
          "documentKey": {
            "type": "string",
            "title": "Documentkey"
          }
        },
        "type": "object",
        "required": [
          "success",
          "docId",
          "docType",
          "title",
          "metadataKey",
          "documentKey"
        ],
        "title": "SaveDocResponse"
      },
      "UploadUrlResponse": {
        "properties": {
          "docId": {
            "type": "string",
            "title": "Docid"
          },
          "presignedUrl": {
            "type": "string",
            "title": "Presignedurl"
          },
          "s3Key": {
            "type": "string",
            "title": "S3Key"
          },
          "expiresIn": {
            "type": "integer",
            "title": "Expiresin"
          }
        },
        "type": "object",
        "required": [
          "docId",
          "presignedUrl",
          "s3Key",
          "expiresIn"
        ],
        "title": "UploadUrlResponse"
      },
      "CreateSystemPromptResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "prompt": {
            "additionalProperties": true,
            "type": "object",
            "title": "Prompt"
          }
        },
        "type": "object",
        "required": [
          "message",
          "prompt"
        ],
        "title": "CreateSystemPromptResponse"
      },
      "DeleteSystemPromptResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "promptId": {
            "type": "string",
            "title": "Promptid"
          }
        },
        "type": "object",
        "required": [
          "message",
          "promptId"
        ],
        "title": "DeleteSystemPromptResponse"
      },
      "ErrorBody": {
        "properties": {
          "error": {
            "type": "string",
            "title": "Error"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          }
        },
        "type": "object",
        "required": [
          "error"
        ],
        "title": "ErrorBody"
      },
      "PlanDeleteResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "planId": {
            "type": "string",
            "title": "Planid"
          }
        },
        "type": "object",
        "required": [
          "message",
          "planId"
        ],
        "title": "PlanDeleteResponse"
      },
      "PlanListResponse": {
        "properties": {
          "plans": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Plans"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "plans",
          "count"
        ],
        "title": "PlanListResponse"
      },
      "PlanMutationResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "plan": {
            "additionalProperties": true,
            "type": "object",
            "title": "Plan"
          }
        },
        "type": "object",
        "required": [
          "message",
          "plan"
        ],
        "title": "PlanMutationResponse"
      },
      "PlanResponse": {
        "properties": {
          "plan": {
            "additionalProperties": true,
            "type": "object",
            "title": "Plan"
          }
        },
        "type": "object",
        "required": [
          "plan"
        ],
        "title": "PlanResponse"
      },
      "QuotaResetResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "userId": {
            "type": "string",
            "title": "Userid"
          },
          "quotaResetAt": {
            "type": "string",
            "title": "Quotaresetat"
          }
        },
        "type": "object",
        "required": [
          "message",
          "userId",
          "quotaResetAt"
        ],
        "title": "QuotaResetResponse"
      },
      "SystemPromptListResponse": {
        "properties": {
          "prompts": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Prompts"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "prompts",
          "count"
        ],
        "title": "SystemPromptListResponse"
      },
      "SystemPromptResponse": {
        "properties": {
          "prompt": {
            "additionalProperties": true,
            "type": "object",
            "title": "Prompt"
          }
        },
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "SystemPromptResponse"
      },
      "UpdateSystemPromptResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "prompt": {
            "additionalProperties": true,
            "type": "object",
            "title": "Prompt"
          }
        },
        "type": "object",
        "required": [
          "message",
          "prompt"
        ],
        "title": "UpdateSystemPromptResponse"
      },
      "UpdateUserPlanResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "userId": {
            "type": "string",
            "title": "Userid"
          },
          "plan": {
            "type": "string",
            "title": "Plan"
          }
        },
        "type": "object",
        "required": [
          "message",
          "userId",
          "plan"
        ],
        "title": "UpdateUserPlanResponse"
      },
      "UpdateUserTrialDaysResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "userId": {
            "type": "string",
            "title": "Userid"
          },
          "trialDays": {
            "type": "integer",
            "title": "Trialdays"
          }
        },
        "type": "object",
        "required": [
          "message",
          "userId",
          "trialDays"
        ],
        "title": "UpdateUserTrialDaysResponse"
      },
      "UserDeleteResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "userId": {
            "type": "string",
            "title": "Userid"
          },
          "deletedItems": {
            "additionalProperties": true,
            "type": "object",
            "title": "Deleteditems"
          }
        },
        "type": "object",
        "required": [
          "message",
          "userId",
          "deletedItems"
        ],
        "title": "UserDeleteResponse"
      },
      "UserListResponse": {
        "properties": {
          "users": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Users"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "nextToken": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nexttoken"
          }
        },
        "type": "object",
        "required": [
          "users",
          "count"
        ],
        "title": "UserListResponse"
      },
      "AvatarConfirmResponse": {
        "properties": {
          "avatarUrl": {
            "type": "string",
            "title": "Avatarurl"
          },
          "s3Key": {
            "type": "string",
            "title": "S3Key"
          },
          "success": {
            "type": "boolean",
            "title": "Success"
          }
        },
        "type": "object",
        "required": [
          "avatarUrl",
          "s3Key",
          "success"
        ],
        "title": "AvatarConfirmResponse"
      },
      "AvatarGetResponse": {
        "properties": {
          "avatarUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatarurl"
          },
          "exists": {
            "type": "boolean",
            "title": "Exists"
          },
          "s3Key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "S3Key"
          }
        },
        "type": "object",
        "required": [
          "exists"
        ],
        "title": "AvatarGetResponse"
      },
      "AvatarUploadUrlResponse": {
        "properties": {
          "uploadUrl": {
            "type": "string",
            "title": "Uploadurl"
          },
          "s3Key": {
            "type": "string",
            "title": "S3Key"
          },
          "expiresIn": {
            "type": "integer",
            "title": "Expiresin"
          }
        },
        "type": "object",
        "required": [
          "uploadUrl",
          "s3Key",
          "expiresIn"
        ],
        "title": "AvatarUploadUrlResponse"
      },
      "ConsentCreateResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "timestamp": {
            "type": "string",
            "title": "Timestamp"
          }
        },
        "type": "object",
        "required": [
          "message",
          "timestamp"
        ],
        "title": "ConsentCreateResponse"
      },
      "ConsentRecordResponse": {
        "properties": {
          "consent": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Consent"
          }
        },
        "type": "object",
        "title": "ConsentRecordResponse"
      },
      "DataExportResponse": {
        "properties": {
          "downloadUrl": {
            "type": "string",
            "title": "Downloadurl"
          },
          "expiresIn": {
            "type": "integer",
            "title": "Expiresin"
          },
          "sizeBytes": {
            "type": "integer",
            "title": "Sizebytes"
          }
        },
        "type": "object",
        "required": [
          "downloadUrl",
          "expiresIn",
          "sizeBytes"
        ],
        "title": "DataExportResponse"
      },
      "DeleteAccountResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "deletedItems": {
            "additionalProperties": true,
            "type": "object",
            "title": "Deleteditems"
          }
        },
        "type": "object",
        "required": [
          "message",
          "deletedItems"
        ],
        "title": "DeleteAccountResponse"
      },
      "SettingsResponse": {
        "properties": {
          "settings": {
            "additionalProperties": true,
            "type": "object",
            "title": "Settings"
          }
        },
        "type": "object",
        "required": [
          "settings"
        ],
        "title": "SettingsResponse"
      },
      "SettingsUpdateResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "updated": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Updated"
          }
        },
        "type": "object",
        "required": [
          "message",
          "updated"
        ],
        "title": "SettingsUpdateResponse"
      },
      "UserCapabilitiesResponse": {
        "properties": {
          "userId": {
            "type": "string",
            "title": "Userid"
          },
          "planId": {
            "type": "string",
            "title": "Planid"
          },
          "capabilities": {
            "additionalProperties": true,
            "type": "object",
            "title": "Capabilities",
            "default": {}
          },
          "usage": {
            "additionalProperties": true,
            "type": "object",
            "title": "Usage",
            "default": {}
          }
        },
        "type": "object",
        "required": [
          "userId",
          "planId"
        ],
        "title": "UserCapabilitiesResponse"
      }
    }
  }
}