{
  "openapi": "3.1.0",
  "info": {
    "title": "All. Done API",
    "description": "Backend API for collaborative project management with JWT auth,\nfile storage, full-text search, AI-powered task suggestions, automated releases, and dual npm publishing.\n\n## Authentication\nAll endpoints require JWT authentication via `Authorization: Bearer <token>` header,\n**except** the following public endpoints:\n- `/auth/login` - User login\n- `/health` - Health check\n- `/` - Root endpoint\n\n## Standard Error Responses\n- **401 Unauthorized**: Missing or invalid JWT token\n- **403 Forbidden**: Valid token but insufficient permissions\n- **404 Not Found**: Resource does not exist\n- **422 Validation Error**: Invalid request parameters or body\n- **429 Too Many Requests**: Rate limit exceeded (AI endpoints, bulk operations)\n\n## Pagination\nAll list endpoints use cursor-based pagination with ULID cursors:\n- `page[size]`: Number of items (1-200, default 50)\n- `page[after]`: ULID cursor for next page\n\nResponse format:\n```json\n{\n  \"data\": [...],\n  \"pagination\": {\n    \"next_cursor\": \"01HQXXXXXXXXXXXXXXXXXXXXXX\",\n    \"has_more\": true,\n    \"size\": 50\n  }\n}\n```\n\n## Timestamps\nAll timestamps are UTC in ISO 8601 format with Z timezone (e.g., `2025-10-09T14:30:00Z`)\n\n## Idempotency\nBulk operations and file uploads support the `Idempotency-Key` header (optional but recommended):\n- `POST /tasks:bulk`\n- `POST /files/versions`\n\nUse a unique ULID or UUID to prevent duplicate operations on retry.",
    "version": "1.4.2"
  },
  "servers": [
    {
      "url": "http://localhost:8000",
      "description": "Development server"
    },
    {
      "url": "http://localhost:8001",
      "description": "Local testing server"
    },
    {
      "url": "https://api.alldone.example.com",
      "description": "Production server (example)"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Health Check",
        "description": "Health check endpoint",
        "operationId": "health_check",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/meta": {
      "get": {
        "summary": "Get Meta",
        "description": "Get API metadata and feature flags.\n\nReturns version, environment, and feature availability.",
        "operationId": "get_meta",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetaResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Login",
        "description": "User login",
        "operationId": "login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/auth/refresh": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Refresh Token",
        "description": "Refresh access token",
        "operationId": "refresh_token",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Logout",
        "description": "User logout (soft blacklist - optional implementation)",
        "operationId": "logout",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/auth/register": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Register",
        "description": "Public user registration endpoint\n\nCreates a new regular user account (non-admin).\nEmail must be unique.",
        "operationId": "register",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/auth/forgot-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Forgot Password",
        "description": "Request password reset\n\nGenerates a reset token and returns it.\nIn production, this would send an email instead of returning the token.",
        "operationId": "forgot_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgotPasswordResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/auth/reset-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Reset Password",
        "description": "Reset password with token\n\nUses the token from forgot-password to set a new password.",
        "operationId": "reset_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResetPasswordResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/users/me": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Get Current User",
        "description": "Get current user information",
        "operationId": "get_current_user",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Delete Own Account",
        "description": "Delete own account",
        "operationId": "delete_own_account",
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "users"
        ],
        "summary": "Update Profile",
        "description": "Update own profile (name, avatar)",
        "operationId": "update_profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdateProfile"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/users/me/password": {
      "patch": {
        "tags": [
          "users"
        ],
        "summary": "Update Own Password",
        "description": "Change own password (requires old password)",
        "operationId": "update_own_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdatePassword"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/users/me/dashboard": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Get Dashboard",
        "description": "Get user dashboard with statistics",
        "operationId": "get_dashboard",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDashboardResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/users/me/sessions": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "List Sessions",
        "description": "List all active sessions for current user",
        "operationId": "list_sessions",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SessionResponse"
                  },
                  "type": "array",
                  "title": "Response List Sessions"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Revoke All Sessions",
        "description": "Revoke all sessions except current one",
        "operationId": "revoke_all_sessions",
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/users/me/sessions/{session_id}": {
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Revoke Session",
        "description": "Revoke a specific session",
        "operationId": "revoke_session",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/users/search": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Search users",
        "description": "Admin-only: Search and filter users with advanced criteria",
        "operationId": "search_users",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search query (name or email)",
              "title": "Q"
            },
            "description": "Search query (name or email)"
          },
          {
            "name": "is_admin",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by admin status",
              "title": "Is Admin"
            },
            "description": "Filter by admin status"
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by active status",
              "title": "Is Active"
            },
            "description": "Filter by active status"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort field: name, email, created_at",
              "default": "created_at",
              "title": "Sort By"
            },
            "description": "Sort field: name, email, created_at"
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort order: asc, desc",
              "default": "desc",
              "title": "Sort Order"
            },
            "description": "Sort order: asc, desc"
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Size"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_UserResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/users/{user_id}/activate": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Activate user",
        "description": "Admin-only: Activate a deactivated user account",
        "operationId": "activate_user",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/users/{user_id}/deactivate": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Deactivate user",
        "description": "Admin-only: Deactivate a user account (soft delete)",
        "operationId": "deactivate_user",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/users/import": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Import users",
        "description": "Admin-only: Bulk import users from JSON",
        "operationId": "import_users",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserImportResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/users/export": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Export users",
        "description": "Admin-only: Export all users to JSON or CSV",
        "operationId": "export_users",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UserExportFormat",
              "default": "json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/users": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Create a new user",
        "description": "Admin-only: Create a new user with optional admin privileges",
        "operationId": "admin_create_user",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserAdminCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] List all users",
        "description": "Admin-only: List all users with cursor-based pagination",
        "operationId": "admin_list_users",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Size"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_UserResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/users/{user_id}": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Get user by ID",
        "description": "Admin-only: Get detailed information about a specific user",
        "operationId": "admin_get_user",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "patch": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Update user",
        "description": "Admin-only: Update user information (name, email, avatar, admin status)",
        "operationId": "admin_update_user",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserAdminUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Delete user",
        "description": "Admin-only: Permanently delete a user and all their data",
        "operationId": "admin_delete_user",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/users/{user_id}/password": {
      "patch": {
        "tags": [
          "users"
        ],
        "summary": "[Admin] Update user password",
        "description": "Admin-only: Change a user's password",
        "operationId": "admin_update_user_password",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserPasswordUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/admin/audit-logs": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "[Admin] List audit logs",
        "description": "Admin-only: View audit trail of all admin actions",
        "operationId": "list_audit_logs",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Size"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_AuditLogResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/teams": {
      "post": {
        "tags": [
          "teams"
        ],
        "summary": "Create Team",
        "description": "Create a new team",
        "operationId": "create_team",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "teams"
        ],
        "summary": "List Teams",
        "description": "List user's teams with pagination.\n\nReturns all teams where the current user is a member.",
        "operationId": "list_teams",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Size"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_TeamResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/teams/{team_id}/members": {
      "post": {
        "tags": [
          "teams"
        ],
        "summary": "Add Team Member",
        "description": "Add member to team",
        "operationId": "add_team_member",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamMemberAdd"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "teams"
        ],
        "summary": "List Team Members",
        "description": "List team members with pagination.\n\nReturns all members of the specified team.",
        "operationId": "list_team_members",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Size"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_TeamMemberResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/teams/{team_id}/members/{user_id}": {
      "delete": {
        "tags": [
          "teams"
        ],
        "summary": "Remove Team Member",
        "description": "Remove member from team",
        "operationId": "remove_team_member",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/teams/{team_id}": {
      "get": {
        "tags": [
          "teams"
        ],
        "summary": "Get Team",
        "description": "Get team details",
        "operationId": "get_team",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "patch": {
        "tags": [
          "teams"
        ],
        "summary": "Update Team",
        "description": "Update team",
        "operationId": "update_team",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "teams"
        ],
        "summary": "Delete Team",
        "description": "Delete team",
        "operationId": "delete_team",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/teams/{team_id}/members/{member_id}": {
      "patch": {
        "tags": [
          "teams"
        ],
        "summary": "Update Team Member Role",
        "description": "Update team member role",
        "operationId": "update_team_member_role",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Member Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamMemberUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMemberResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/workspaces": {
      "post": {
        "tags": [
          "workspaces"
        ],
        "summary": "Create Workspace",
        "description": "Create a new workspace",
        "operationId": "create_workspace",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Workspace created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceResponse"
                },
                "example": {
                  "id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
                  "name": "My Company Workspace",
                  "key": "MYCO",
                  "settings_json": "{\"theme\": \"dark\", \"notifications\": true}",
                  "created_at": "2025-10-09T10:00:00Z",
                  "updated_at": "2025-10-09T10:00:00Z"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "workspaces"
        ],
        "summary": "List Workspaces",
        "description": "List workspaces with cursor-based pagination.\n\nUse filter[member]=me to list only workspaces where current user is a member.",
        "operationId": "list_workspaces",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "filter[member]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[Member]"
            }
          },
          {
            "name": "page[size]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page[Size]"
            }
          },
          {
            "name": "page[after]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Page[After]"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_WorkspaceResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/workspaces/{workspace_id}": {
      "get": {
        "tags": [
          "workspaces"
        ],
        "summary": "Get Workspace",
        "description": "Get workspace details",
        "operationId": "get_workspace",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "patch": {
        "tags": [
          "workspaces"
        ],
        "summary": "Update Workspace",
        "description": "Update workspace",
        "operationId": "update_workspace",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "workspaces"
        ],
        "summary": "Delete Workspace",
        "description": "Delete workspace",
        "operationId": "delete_workspace",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/principals": {
      "get": {
        "tags": [
          "workspaces"
        ],
        "summary": "List Workspace Principals",
        "description": "List all principals (access control entries) for a workspace.\n\nReturns users and teams with their roles (viewer, member, admin, owner).\n\n**Example Response:**\n```json\n{\n  \"data\": [\n    {\n      \"id\": \"01HQX1A2B3C4D5E6F7G8H9J0K1\",\n      \"workspace_id\": \"01HQY...\",\n      \"principal_type\": \"user\",\n      \"principal_id\": \"01HQZ...\",\n      \"role\": \"owner\",\n      \"created_at\": \"2025-10-09T10:00:00Z\"\n    }\n  ],\n  \"pagination\": {\n    \"next_cursor\": \"01HQX1A2B3C4D5E6F7G8H9J0K1\",\n    \"has_more\": true,\n    \"size\": 50\n  }\n}\n```",
        "operationId": "list_workspace_principals",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Workspace Id"
            }
          },
          {
            "name": "page[size]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page[Size]"
            }
          },
          {
            "name": "page[after]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Page[After]"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_PrincipalResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "post": {
        "tags": [
          "workspaces"
        ],
        "summary": "Add Workspace Principal",
        "description": "Add principal to workspace",
        "operationId": "add_workspace_principal",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrincipalAdd"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/principals/{principal_id}": {
      "patch": {
        "tags": [
          "workspaces"
        ],
        "summary": "Update Workspace Principal",
        "description": "Update workspace principal role",
        "operationId": "update_workspace_principal",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Workspace Id"
            }
          },
          {
            "name": "principal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Principal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrincipalUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "workspaces"
        ],
        "summary": "Delete Workspace Principal",
        "description": "Remove principal from workspace",
        "operationId": "delete_workspace_principal",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Workspace Id"
            }
          },
          {
            "name": "principal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Principal Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/projects": {
      "post": {
        "tags": [
          "projects"
        ],
        "summary": "Create Project",
        "description": "Create a new project",
        "operationId": "create_project",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Project created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponse"
                },
                "example": {
                  "id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
                  "workspace_id": "01HQYYYYYYYYYYYYYYYYYYYY",
                  "name": "Website Redesign",
                  "code": "WEB-2025",
                  "status": "active",
                  "start_at": "2025-10-15T00:00:00Z",
                  "end_at": "2025-12-31T23:59:59Z",
                  "description": "Complete redesign of company website",
                  "created_at": "2025-10-09T10:00:00Z",
                  "updated_at": "2025-10-09T10:00:00Z"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "List Projects",
        "description": "List projects with cursor-based pagination.\n\nUse filter[workspaceId] to list projects in a specific workspace.\nUse filter[status] to filter by project status.",
        "operationId": "list_projects",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "filter[workspaceId]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[Workspaceid]"
            }
          },
          {
            "name": "filter[status]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[Status]"
            }
          },
          {
            "name": "page[size]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page[Size]"
            }
          },
          {
            "name": "page[after]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Page[After]"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_ProjectResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/projects/{project_id}": {
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "Get Project",
        "description": "Get project details",
        "operationId": "get_project",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Project Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "patch": {
        "tags": [
          "projects"
        ],
        "summary": "Update Project",
        "description": "Update project",
        "operationId": "update_project",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Project Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "projects"
        ],
        "summary": "Delete Project",
        "description": "Delete project",
        "operationId": "delete_project",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Project Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/projects/{project_id}/principals": {
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "List Project Principals",
        "description": "List all principals (access control entries) for a project.\n\nReturns users and teams with their roles (maintainer, contributor, guest).\n\n**Example Response:**\n```json\n{\n  \"data\": [\n    {\n      \"id\": \"01HQX1A2B3C4D5E6F7G8H9J0K1\",\n      \"project_id\": \"01HQY...\",\n      \"principal_type\": \"user\",\n      \"principal_id\": \"01HQZ...\",\n      \"role\": \"maintainer\",\n      \"created_at\": \"2025-10-09T10:00:00Z\"\n    }\n  ],\n  \"pagination\": {\n    \"next_cursor\": \"01HQX1A2B3C4D5E6F7G8H9J0K1\",\n    \"has_more\": false,\n    \"size\": 1\n  }\n}\n```",
        "operationId": "list_project_principals",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Project Id"
            }
          },
          {
            "name": "page[size]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page[Size]"
            }
          },
          {
            "name": "page[after]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Page[After]"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_PrincipalResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "post": {
        "tags": [
          "projects"
        ],
        "summary": "Add Project Principal",
        "description": "Add principal to project",
        "operationId": "add_project_principal",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Project Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrincipalAdd"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/projects/{project_id}/principals/{principal_id}": {
      "patch": {
        "tags": [
          "projects"
        ],
        "summary": "Update Project Principal",
        "description": "Update project principal role",
        "operationId": "update_project_principal",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Project Id"
            }
          },
          {
            "name": "principal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Principal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrincipalUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "projects"
        ],
        "summary": "Delete Project Principal",
        "description": "Remove principal from project",
        "operationId": "delete_project_principal",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Project Id"
            }
          },
          {
            "name": "principal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Principal Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/wbs": {
      "post": {
        "tags": [
          "wbs"
        ],
        "summary": "Create Wbs",
        "description": "Create a new WBS node",
        "operationId": "create_wbs",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WBSCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WBSResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "wbs"
        ],
        "summary": "List Wbs",
        "description": "List WBS nodes with cursor-based pagination.\n\nDefault sort is by wbs_index for hierarchical order (1, 1.1, 1.1.1, 1.2, 2, ...).",
        "operationId": "list_wbs",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "filter[projectId]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[Projectid]"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Sort field (default: wbs_index for hierarchical order)",
              "default": "wbs_index",
              "title": "Sort"
            },
            "description": "Sort field (default: wbs_index for hierarchical order)"
          },
          {
            "name": "page[size]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page[Size]"
            }
          },
          {
            "name": "page[after]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Page[After]"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_WBSResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/wbs/{wbs_id}": {
      "get": {
        "tags": [
          "wbs"
        ],
        "summary": "Get Wbs",
        "description": "Get WBS node details",
        "operationId": "get_wbs",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "wbs_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Wbs Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WBSResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "patch": {
        "tags": [
          "wbs"
        ],
        "summary": "Update Wbs",
        "description": "Update WBS node",
        "operationId": "update_wbs",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "wbs_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Wbs Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WBSUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WBSResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "wbs"
        ],
        "summary": "Delete Wbs",
        "description": "Delete WBS node",
        "operationId": "delete_wbs",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "wbs_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Wbs Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/tasks": {
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "Create Task",
        "description": "Create a new task",
        "operationId": "create_task",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                },
                "example": {
                  "id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
                  "project_id": "01HQYYYYYYYYYYYYYYYYYYYY",
                  "wbs_id": "01HQZZZZZZZZZZZZZZZZZZZZZ",
                  "title": "Implement user authentication",
                  "description": "Add JWT-based authentication with login/logout",
                  "assignee_id": "01HQAAAAAAAAAAAAAAAAAAAAA",
                  "estimate_hours": 8.0,
                  "remaining_hours": 8.0,
                  "state": "todo",
                  "priority": "high",
                  "start_at": "2025-10-10T09:00:00Z",
                  "due_at": "2025-10-12T17:00:00Z",
                  "visible_in_views": [
                    "board",
                    "table",
                    "tree",
                    "calendar",
                    "gantt"
                  ],
                  "percent_done": 0.0,
                  "duration_days": 3,
                  "created_at": "2025-10-09T10:00:00Z",
                  "updated_at": "2025-10-09T10:00:00Z"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "tasks"
        ],
        "summary": "List Tasks",
        "description": "List tasks with optional view filtering.\n\nView rules:\n- **board**: Requires `state` field (Kanban columns)\n- **calendar**: Requires `start_at` OR `due_at`\n- **gantt**: Requires `start_at` AND `due_at` (both dates)\n- **table/tree**: Always visible (unless explicitly removed from visible_in_views)\n\nTasks are automatically assigned to views based on their properties. Use `visible_in_views` to override.\n\nSubtasks behavior:\n- `include_subtasks=true`: Include subtasks in response (for table/tree views)\n- `include_subtasks=false` (default): Parent tasks only\n- Board/Gantt views: Subtasks never included regardless of this parameter\n\n**Example Response:**\n```json\n{\n  \"data\": [\n    {\n      \"id\": \"01HQX...\",\n      \"project_id\": \"01HQY...\",\n      \"wbs_id\": \"01HQZ...\",\n      \"title\": \"Implement authentication\",\n      \"state\": \"in_progress\",\n      \"priority\": \"high\",\n      \"estimate_hours\": 8.0,\n      \"remaining_hours\": 4.0,\n      \"assignee_id\": \"01HQW...\"\n    }\n  ],\n  \"pagination\": {\n    \"next_cursor\": \"01HQX...\",\n    \"has_more\": true,\n    \"size\": 50\n  }\n}\n```",
        "operationId": "list_tasks",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "filter[projectId]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[Projectid]"
            }
          },
          {
            "name": "filter[state]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[State]"
            }
          },
          {
            "name": "filter[wbsId]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[Wbsid]"
            }
          },
          {
            "name": "filter[assigneeId]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by assigned user",
              "title": "Filter[Assigneeid]"
            },
            "description": "Filter by assigned user"
          },
          {
            "name": "filter[view]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TaskView"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter tasks by view. board=requires state; calendar=requires start_at OR due_at; gantt=requires start_at AND due_at",
              "title": "Filter[View]"
            },
            "description": "Filter tasks by view. board=requires state; calendar=requires start_at OR due_at; gantt=requires start_at AND due_at"
          },
          {
            "name": "include_subtasks",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include subtasks in response. Useful for table/tree views. Never included in board/gantt views.",
              "default": false,
              "title": "Include Subtasks"
            },
            "description": "Include subtasks in response. Useful for table/tree views. Never included in board/gantt views."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Sort fields: priority, state, due_at, created_at, wbs_index. Prefix with - for descending",
              "title": "Sort"
            },
            "description": "Sort fields: priority, state, due_at, created_at, wbs_index. Prefix with - for descending"
          },
          {
            "name": "page[size]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page[Size]"
            }
          },
          {
            "name": "page[after]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Page[After]"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of tasks with pagination metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_TaskResponse_"
                },
                "example": {
                  "data": [
                    {
                      "id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
                      "project_id": "01HQYYYYYYYYYYYYYYYYYYYY",
                      "wbs_id": "01HQZZZZZZZZZZZZZZZZZZZZZ",
                      "title": "Implement user authentication",
                      "state": "in_progress",
                      "priority": "high",
                      "estimate_hours": 8.0,
                      "remaining_hours": 5.5,
                      "percent_done": 30.0
                    }
                  ],
                  "pagination": {
                    "next_cursor": "01HQAAAAAAAAAAAAAAAAAAAAA",
                    "has_more": true,
                    "size": 1
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/tasks/{task_id}": {
      "get": {
        "tags": [
          "tasks"
        ],
        "summary": "Get Task",
        "description": "Get task details",
        "operationId": "get_task",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "patch": {
        "tags": [
          "tasks"
        ],
        "summary": "Update Task",
        "description": "Update task",
        "operationId": "update_task",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "tasks"
        ],
        "summary": "Delete Task",
        "description": "Delete task",
        "operationId": "delete_task",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/tasks:bulk": {
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "Bulk Create Tasks",
        "description": "Bulk create multiple tasks in a single request.\n\n**Features:**\n- Create up to 100 tasks at once\n- Partial success: Some tasks may succeed while others fail\n- Idempotent: Use `Idempotency-Key` header to prevent duplicate creation on retry\n- Rate limited: Max 10 requests, refills at 0.2/sec (12 per minute)\n\n**Idempotency:**\nInclude an `Idempotency-Key` header (ULID or UUID) to make this operation idempotent.\nIf you retry with the same key, you'll get the same response without creating duplicates.\n\n**Example:**\n```bash\ncurl -X POST \"$API/tasks:bulk\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Idempotency-Key: 01HQXXXXXXXXXXXXXXXXXXXXXX\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"tasks\": [{\"project_id\":\"...\",\"wbs_id\":\"...\",\"title\":\"Task 1\"}]}'\n```",
        "operationId": "bulk_create_tasks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskBulkCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskBulkCreateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          },
          "429": {
            "description": "Too Many Requests - Rate limit exceeded. Check Retry-After header."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "tasks"
        ],
        "summary": "Bulk Delete Tasks",
        "description": "Bulk delete tasks",
        "operationId": "bulk_delete_tasks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskBulkDelete"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "tasks"
        ],
        "summary": "Bulk Update Tasks",
        "description": "Bulk update multiple tasks with the same changes.\n\n**Features:**\n- Update multiple tasks at once with the same patch\n- All tasks must be accessible by the current user\n- Rate limited: Max 10 requests, refills at 0.2/sec (12 per minute)\n\n**Example:**\n```bash\ncurl -X PATCH \"$API/tasks:bulk\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"ids\":[\"01HQ...\",\"01HQ...\"],\"patch\":{\"state\":\"in_progress\"}}'\n```",
        "operationId": "bulk_update_tasks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskBulkPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskBulkPatchResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          },
          "429": {
            "description": "Too Many Requests - Rate limit exceeded. Check Retry-After header."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/tasks/{task_id}/subtasks": {
      "post": {
        "tags": [
          "subtasks"
        ],
        "summary": "Create Subtask",
        "description": "Create a subtask",
        "operationId": "create_subtask",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubtaskCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubtaskResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "subtasks"
        ],
        "summary": "List Subtasks",
        "description": "List subtasks for a task with pagination.\n\nReturns all subtasks belonging to the specified task.",
        "operationId": "list_subtasks",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Size"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_SubtaskResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/subtasks/{subtask_id}": {
      "patch": {
        "tags": [
          "subtasks"
        ],
        "summary": "Update Subtask",
        "description": "Update subtask",
        "operationId": "update_subtask",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "subtask_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Subtask Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubtaskUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubtaskResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "subtasks"
        ],
        "summary": "Delete Subtask",
        "description": "Delete subtask",
        "operationId": "delete_subtask",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "subtask_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Subtask Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/files": {
      "post": {
        "tags": [
          "files"
        ],
        "summary": "Upload File",
        "description": "Upload a file with optional links to workspace/project/wbs/task entities.\n\n**Note on `links` parameter:**\nDue to multipart/form-data limitations, the `links` field must be a JSON-encoded string,\nnot a native array. Example: `'[{\"targetType\":\"project\",\"targetId\":\"01HQ...\"}]'`\n\n**Example with curl:**\n```bash\ncurl -X POST \"$API/files\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -F \"file=@document.pdf\" \\\n  -F \"name=Quarterly Report\" \\\n  -F 'links=[{\"targetType\":\"project\",\"targetId\":\"01HQXXXXXXXXXXXXXXXXXXXXXX\"}]'\n```",
        "operationId": "upload_file",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional workspace ID to link file to",
              "title": "Workspace Id"
            },
            "description": "Optional workspace ID to link file to"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_file"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "files"
        ],
        "summary": "List Files",
        "description": "List files by context or filters.\n\nSupports two modes:\n1. Legacy: context + id (e.g., context=workspace&id=ws123)\n2. New: filter[workspaceId], filter[projectId], filter[targetType], filter[targetId]\n\nfilter[targetType] accepts: workspace, project, wbs, task",
        "operationId": "list_files",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "context",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "deprecated": true,
              "title": "Context"
            },
            "deprecated": true
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "deprecated": true,
              "title": "Id"
            },
            "deprecated": true
          },
          {
            "name": "filter[workspaceId]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[Workspaceid]"
            }
          },
          {
            "name": "filter[projectId]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[Projectid]"
            }
          },
          {
            "name": "filter[targetType]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/FileTargetType"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by target type: workspace, project, wbs, task",
              "title": "Filter[Targettype]"
            },
            "description": "Filter by target type: workspace, project, wbs, task"
          },
          {
            "name": "filter[targetId]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter[Targetid]"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "name": "page[size]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page[Size]"
            }
          },
          {
            "name": "page[after]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Page[After]"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_FileResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/files/{file_id}": {
      "get": {
        "tags": [
          "files"
        ],
        "summary": "Get File",
        "description": "Get file metadata",
        "operationId": "get_file",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "patch": {
        "tags": [
          "files"
        ],
        "summary": "Update File Metadata",
        "description": "Update file metadata (rename file).\n\nOnly the owner or users with editor role can update file metadata.",
        "operationId": "update_file_metadata",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileMetadataUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "delete": {
        "tags": [
          "files"
        ],
        "summary": "Delete File",
        "description": "Delete file and all versions",
        "operationId": "delete_file",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/files/{file_id}/content": {
      "get": {
        "tags": [
          "files"
        ],
        "summary": "Download File",
        "description": "Download file content.\n\nReturns raw binary data with appropriate Content-Type header.",
        "operationId": "download_file",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/files/{file_id}/versions": {
      "post": {
        "tags": [
          "files"
        ],
        "summary": "Create File Version",
        "description": "Upload a new version of an existing file.\n\nCreates a new version while preserving the original file metadata (name, links, etc.).\nThe file content is stored separately and can be accessed via version history.",
        "operationId": "create_file_version",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_create_file_version"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileVersionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      },
      "get": {
        "tags": [
          "files"
        ],
        "summary": "List File Versions",
        "description": "List all versions of a file with pagination.\n\nReturns versions in descending order (newest first).",
        "operationId": "list_file_versions",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Size"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_FileVersionResponse_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/files/{file_id}/versions/{version_id}/content": {
      "get": {
        "tags": [
          "files"
        ],
        "summary": "Download File Version",
        "description": "Download a specific version of a file.\n\nReturns the file content with appropriate Content-Type and Content-Disposition headers.",
        "operationId": "download_file_version",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Version Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/docs/{file_id}/state": {
      "get": {
        "tags": [
          "docs"
        ],
        "summary": "Get Doc State",
        "description": "Get document state (latest snapshot).\n\nReturns the current collaborative document state with version information.",
        "operationId": "get_doc_state",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocStateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/docs/{file_id}/export": {
      "post": {
        "tags": [
          "docs"
        ],
        "summary": "Export Doc",
        "description": "Export document to various formats (PDF, Markdown, DOCX).\n\n**Note:** This is a stub implementation. Returns a placeholder response.",
        "operationId": "export_doc",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocExportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocExportResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/search": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Search",
        "description": "Full-text search across tasks, files, docs, and other entities.\n\nSupports filtering by entity type and context (workspace or project).\nResults are filtered by user access permissions.\n\nUses cursor-based pagination with ULID cursors.",
        "operationId": "search",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Search query",
              "title": "Q"
            },
            "description": "Search query"
          },
          {
            "name": "filter[entity]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by entity type: workspace, project, wbs, task, doc",
              "title": "Filter[Entity]"
            },
            "description": "Filter by entity type: workspace, project, wbs, task, doc"
          },
          {
            "name": "context",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Context type: workspace, project",
              "deprecated": true,
              "title": "Context"
            },
            "description": "Context type: workspace, project",
            "deprecated": true
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Context ID",
              "deprecated": true,
              "title": "Id"
            },
            "description": "Context ID",
            "deprecated": true
          },
          {
            "name": "page[size]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page[Size]"
            }
          },
          {
            "name": "page[after]",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Page[After]"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_SearchHit_"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    },
    "/ai/tasks/breakdown": {
      "post": {
        "tags": [
          "ai"
        ],
        "summary": "Ai Breakdown Task",
        "description": "Generate task breakdown for a WBS node using AI.\n\nAnalyzes the WBS description and suggests tasks with effort estimates.\n\n**Rate Limiting:** This endpoint is rate-limited. If you exceed the limit,\nyou'll receive a 429 response with a Retry-After header indicating when to retry.",
        "operationId": "ai_breakdown_task",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskBreakdownRequestWBS"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskBreakdownResponseWBS"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          },
          "429": {
            "description": "Too Many Requests - Rate limit exceeded. Check Retry-After header."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/ai/tasks/suggest": {
      "post": {
        "tags": [
          "ai"
        ],
        "summary": "Ai Suggest Task",
        "description": "Generate AI suggestions for improving a task.\n\nAnalyzes the task and provides suggestions for improvement.\n\n**Rate Limiting:** This endpoint is rate-limited. If you exceed the limit,\nyou'll receive a 429 response with a Retry-After header indicating when to retry.",
        "operationId": "ai_suggest_task",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskSuggestionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskSuggestionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          },
          "429": {
            "description": "Too Many Requests - Rate limit exceeded. Check Retry-After header."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/ai/tasks/estimate": {
      "post": {
        "tags": [
          "ai"
        ],
        "summary": "Ai Estimate Task",
        "description": "Generate effort estimate for a task using AI.\n\nAnalyzes the task complexity and provides an estimated duration\nwith confidence level and reasoning.\n\n**Rate Limiting:** This endpoint is rate-limited. If you exceed the limit,\nyou'll receive a 429 response with a Retry-After header indicating when to retry.",
        "operationId": "ai_estimate_task",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskEstimateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskEstimateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          },
          "429": {
            "description": "Too Many Requests - Rate limit exceeded. Check Retry-After header."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/ai/projects/generate-wbs": {
      "post": {
        "tags": [
          "ai"
        ],
        "summary": "Ai Generate Wbs",
        "description": "Generate Work Breakdown Structure for a project using AI.\n\nAnalyzes the project description and generates a hierarchical WBS\nwith appropriate groups and work packages.\n\n**Rate Limiting:** This endpoint is rate-limited. If you exceed the limit,\nyou'll receive a 429 response with a Retry-After header indicating when to retry.",
        "operationId": "ai_generate_wbs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WBSGenerationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WBSGenerationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          },
          "429": {
            "description": "Too Many Requests - Rate limit exceeded. Check Retry-After header."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/ai/status": {
      "get": {
        "tags": [
          "ai"
        ],
        "summary": "Get Ai Status",
        "description": "Get AI service status and configuration.\n\nReturns information about AI availability and current model.",
        "operationId": "get_ai_status",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/": {
      "get": {
        "summary": "Root",
        "description": "Root endpoint",
        "operationId": "root",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid JWT token"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Not Found - Resource does not exist"
          },
          "422": {
            "description": "Validation Error - Invalid request parameters"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AIStatusResponse": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "description": "Whether AI service is enabled"
          },
          "available": {
            "type": "boolean",
            "title": "Available",
            "description": "Whether AI service is currently available"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "description": "Current AI model name"
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "AI provider (e.g., Mistral AI)"
          },
          "features": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object",
            "title": "Features",
            "description": "Available AI features and their status"
          }
        },
        "type": "object",
        "required": [
          "enabled",
          "available",
          "model",
          "provider",
          "features"
        ],
        "title": "AIStatusResponse",
        "description": "AI service status and configuration",
        "example": {
          "available": true,
          "enabled": true,
          "features": {
            "task_breakdown": true,
            "task_estimation": true,
            "wbs_generation": true
          },
          "model": "mistral-small-latest",
          "provider": "Mistral AI"
        }
      },
      "AuditLogResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Log entry ID"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id",
            "description": "User who performed the action"
          },
          "action": {
            "type": "string",
            "title": "Action",
            "description": "Action performed"
          },
          "target_type": {
            "type": "string",
            "title": "Target Type",
            "description": "Type of resource affected"
          },
          "target_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Id",
            "description": "ID of affected resource"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details",
            "description": "Additional details"
          },
          "ip_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip Address",
            "description": "IP address"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Timestamp of action",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "action",
          "target_type",
          "created_at"
        ],
        "title": "AuditLogResponse",
        "description": "Audit log entry"
      },
      "Body_create_file_version": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comment"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_create_file_version"
      },
      "Body_upload_file": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "mime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mime"
          },
          "links": {
            "type": "string",
            "title": "Links",
            "description": "JSON array of links: [{\"targetType\":\"project\",\"targetId\":\"...\"}]",
            "default": "[]"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_file"
      },
      "DocExportRequest": {
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "pdf",
              "md",
              "docx"
            ],
            "title": "Format",
            "description": "Export format"
          }
        },
        "type": "object",
        "required": [
          "format"
        ],
        "title": "DocExportRequest",
        "description": "Document export format request"
      },
      "DocExportResponse": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Temporary download URL (expires in 1 hour)"
          },
          "format": {
            "type": "string",
            "title": "Format",
            "description": "Export format"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes",
            "description": "Exported file size"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At",
            "description": "URL expiration timestamp",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "url",
          "format",
          "size_bytes",
          "expires_at"
        ],
        "title": "DocExportResponse",
        "description": "Document export response with temporary download link",
        "example": {
          "expires_at": "2025-10-09T15:30:00Z",
          "format": "pdf",
          "size_bytes": 245678,
          "url": "https://api.example.com/exports/temp/abc123.pdf"
        }
      },
      "DocStateResponse": {
        "properties": {
          "file_id": {
            "type": "string",
            "title": "File Id",
            "description": "File ID of the document"
          },
          "snapshot_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Snapshot Id",
            "description": "Latest snapshot ID/version"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes",
            "description": "Size of the document state in bytes"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "Last update timestamp",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "file_id",
          "size_bytes",
          "updated_at"
        ],
        "title": "DocStateResponse",
        "description": "Collaborative document state snapshot",
        "example": {
          "file_id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
          "size_bytes": 15420,
          "snapshot_id": "v42",
          "updated_at": "2025-10-09T14:30:00Z"
        }
      },
      "FileMetadataUpdate": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "title": "Name",
            "description": "New filename"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "FileMetadataUpdate",
        "description": "Update file metadata (rename only)"
      },
      "FileResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "owner_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner User Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "ext": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ext"
          },
          "mime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mime"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes"
          },
          "sha256": {
            "type": "string",
            "title": "Sha256"
          },
          "is_document": {
            "type": "boolean",
            "title": "Is Document",
            "description": "Whether this is a collaborative document (true) or regular file (false)"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2025-10-09T14:30:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "size_bytes",
          "sha256",
          "is_document",
          "created_at",
          "updated_at"
        ],
        "title": "FileResponse"
      },
      "FileTargetType": {
        "type": "string",
        "enum": [
          "workspace",
          "project",
          "wbs",
          "task"
        ],
        "title": "FileTargetType",
        "description": "File attachment target types"
      },
      "FileVersionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "file_id": {
            "type": "string",
            "title": "File Id"
          },
          "version_number": {
            "type": "integer",
            "title": "Version Number"
          },
          "sha256": {
            "type": "string",
            "title": "Sha256"
          },
          "storage_path": {
            "type": "string",
            "title": "Storage Path"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes"
          },
          "uploaded_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uploaded By"
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comment"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "file_id",
          "version_number",
          "sha256",
          "storage_path",
          "size_bytes",
          "created_at"
        ],
        "title": "FileVersionResponse"
      },
      "ForgotPasswordRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email",
            "description": "Email address of the user"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "ForgotPasswordRequest",
        "description": "Request password reset"
      },
      "ForgotPasswordResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Success message"
          },
          "email": {
            "type": "string",
            "title": "Email",
            "description": "Email address where reset link was sent"
          }
        },
        "type": "object",
        "required": [
          "message",
          "email"
        ],
        "title": "ForgotPasswordResponse",
        "description": "Password reset request response"
      },
      "LoginRequest": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "LoginRequest"
      },
      "LoginResponse": {
        "properties": {
          "access": {
            "type": "string",
            "title": "Access"
          },
          "refresh": {
            "type": "string",
            "title": "Refresh"
          },
          "user": {
            "$ref": "#/components/schemas/UserResponse"
          }
        },
        "type": "object",
        "required": [
          "access",
          "refresh",
          "user"
        ],
        "title": "LoginResponse"
      },
      "MetaResponse": {
        "properties": {
          "version": {
            "type": "string",
            "title": "Version",
            "description": "API version"
          },
          "env": {
            "type": "string",
            "title": "Env",
            "description": "Environment (dev, staging, prod)"
          },
          "database": {
            "type": "string",
            "title": "Database",
            "description": "Database type (sqlite, postgres)"
          },
          "fts": {
            "type": "string",
            "title": "Fts",
            "description": "Full-text search status"
          },
          "features": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Features",
            "description": "Feature flags and their status"
          },
          "views": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Views",
            "description": "Available task views"
          }
        },
        "type": "object",
        "required": [
          "version",
          "env",
          "database",
          "fts",
          "features",
          "views"
        ],
        "title": "MetaResponse",
        "description": "API metadata and feature flags"
      },
      "PaginatedResponse_AuditLogResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/AuditLogResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[AuditLogResponse]"
      },
      "PaginatedResponse_FileResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/FileResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[FileResponse]"
      },
      "PaginatedResponse_FileVersionResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/FileVersionResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[FileVersionResponse]"
      },
      "PaginatedResponse_PrincipalResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PrincipalResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[PrincipalResponse]"
      },
      "PaginatedResponse_ProjectResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ProjectResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[ProjectResponse]"
      },
      "PaginatedResponse_SearchHit_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SearchHit"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[SearchHit]"
      },
      "PaginatedResponse_SubtaskResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SubtaskResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[SubtaskResponse]"
      },
      "PaginatedResponse_TaskResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/TaskResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[TaskResponse]"
      },
      "PaginatedResponse_TeamMemberResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/TeamMemberResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[TeamMemberResponse]"
      },
      "PaginatedResponse_TeamResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/TeamResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[TeamResponse]"
      },
      "PaginatedResponse_UserResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/UserResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[UserResponse]"
      },
      "PaginatedResponse_WBSResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/WBSResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[WBSResponse]"
      },
      "PaginatedResponse_WorkspaceResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceResponse"
            },
            "type": "array",
            "title": "Data",
            "description": "Array of items for the current page"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse[WorkspaceResponse]"
      },
      "PaginationMeta": {
        "properties": {
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor",
            "description": "Cursor for the next page (ULID)"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "description": "Whether more pages are available",
            "default": false
          },
          "size": {
            "type": "integer",
            "title": "Size",
            "description": "Number of items in current page"
          }
        },
        "type": "object",
        "required": [
          "size"
        ],
        "title": "PaginationMeta",
        "description": "Pagination metadata"
      },
      "PrincipalAdd": {
        "properties": {
          "principal_type": {
            "type": "string",
            "title": "Principal Type",
            "description": "Type of principal (user or team)"
          },
          "principal_id": {
            "type": "string",
            "title": "Principal Id",
            "description": "ULID of user or team"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "description": "Role (viewer, member, admin, owner)"
          }
        },
        "type": "object",
        "required": [
          "principal_type",
          "principal_id",
          "role"
        ],
        "title": "PrincipalAdd"
      },
      "PrincipalResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Principal entry ULID"
          },
          "principal_type": {
            "type": "string",
            "title": "Principal Type",
            "description": "Type: user or team"
          },
          "principal_id": {
            "type": "string",
            "title": "Principal Id",
            "description": "ULID of the user or team"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "description": "Role: viewer, member, admin, owner"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "ISO 8601 timestamp",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "principal_type",
          "principal_id",
          "role",
          "created_at"
        ],
        "title": "PrincipalResponse",
        "description": "Principal (access control entry) response"
      },
      "PrincipalUpdate": {
        "properties": {
          "role": {
            "type": "string",
            "title": "Role",
            "description": "New role for the principal"
          }
        },
        "type": "object",
        "required": [
          "role"
        ],
        "title": "PrincipalUpdate"
      },
      "ProjectCreate": {
        "properties": {
          "workspace_id": {
            "type": "string",
            "title": "Workspace Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "start_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start At"
          },
          "end_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End At"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "workspace_id",
          "name"
        ],
        "title": "ProjectCreate",
        "example": {
          "code": "WEB-2025",
          "description": "Complete redesign of company website with new branding",
          "end_at": "2025-12-31T23:59:59Z",
          "name": "Website Redesign",
          "start_at": "2025-10-15T00:00:00Z",
          "workspace_id": "01HQXXXXXXXXXXXXXXXXXXXXXX"
        }
      },
      "ProjectResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "workspace_id": {
            "type": "string",
            "title": "Workspace Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "start_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start At"
          },
          "end_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End At"
          },
          "manager_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Manager Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2025-10-09T14:30:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "workspace_id",
          "name",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "ProjectResponse"
      },
      "ProjectUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "start_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start At"
          },
          "end_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End At"
          },
          "manager_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Manager Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "title": "ProjectUpdate"
      },
      "RefreshRequest": {
        "properties": {
          "refresh": {
            "type": "string",
            "title": "Refresh"
          }
        },
        "type": "object",
        "required": [
          "refresh"
        ],
        "title": "RefreshRequest"
      },
      "RefreshResponse": {
        "properties": {
          "access": {
            "type": "string",
            "title": "Access"
          }
        },
        "type": "object",
        "required": [
          "access"
        ],
        "title": "RefreshResponse"
      },
      "ResetPasswordRequest": {
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1,
            "title": "Token",
            "description": "Password reset token"
          },
          "new_password": {
            "type": "string",
            "minLength": 6,
            "title": "New Password",
            "description": "New password (min 6 characters)"
          }
        },
        "type": "object",
        "required": [
          "token",
          "new_password"
        ],
        "title": "ResetPasswordRequest",
        "description": "Reset password with token"
      },
      "ResetPasswordResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Success message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "ResetPasswordResponse",
        "description": "Password reset response"
      },
      "SearchHit": {
        "properties": {
          "entity_type": {
            "type": "string",
            "title": "Entity Type",
            "description": "Type of entity (workspace, project, wbs, task, doc)"
          },
          "entity_id": {
            "type": "string",
            "title": "Entity Id",
            "description": "ULID of the matched entity"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Title of the entity"
          },
          "snippet": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Snippet",
            "description": "Text snippet with match context"
          },
          "rank": {
            "type": "number",
            "title": "Rank",
            "description": "FTS5 rank score (lower is better)"
          }
        },
        "type": "object",
        "required": [
          "entity_type",
          "entity_id",
          "title",
          "rank"
        ],
        "title": "SearchHit",
        "description": "Full-text search result hit"
      },
      "SessionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Session ID"
          },
          "device_info": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Device Info",
            "description": "Device/browser information"
          },
          "ip_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip Address",
            "description": "IP address"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Session creation time",
            "example": "2025-10-09T14:30:00Z"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "title": "Last Used At",
            "description": "Last activity time",
            "example": "2025-10-09T14:30:00Z"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At",
            "description": "Session expiration time",
            "example": "2025-10-09T14:30:00Z"
          },
          "is_current": {
            "type": "boolean",
            "title": "Is Current",
            "description": "Whether this is the current session"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "last_used_at",
          "expires_at",
          "is_current"
        ],
        "title": "SessionResponse",
        "description": "User session information"
      },
      "SubtaskCreate": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "estimate_hours": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimate Hours",
            "default": 0.0
          }
        },
        "type": "object",
        "required": [
          "title"
        ],
        "title": "SubtaskCreate"
      },
      "SubtaskResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "state": {
            "type": "string",
            "title": "State"
          },
          "estimate_hours": {
            "type": "number",
            "title": "Estimate Hours"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2025-10-09T14:30:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "task_id",
          "title",
          "state",
          "estimate_hours",
          "created_at",
          "updated_at"
        ],
        "title": "SubtaskResponse"
      },
      "SubtaskUpdate": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          },
          "estimate_hours": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimate Hours"
          }
        },
        "type": "object",
        "title": "SubtaskUpdate"
      },
      "TaskBreakdownRequestWBS": {
        "properties": {
          "wbs_id": {
            "type": "string",
            "title": "Wbs Id",
            "description": "WBS node ID to break down into tasks"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Additional description or context"
          }
        },
        "type": "object",
        "required": [
          "wbs_id"
        ],
        "title": "TaskBreakdownRequestWBS",
        "description": "Request for AI task breakdown from WBS node"
      },
      "TaskBreakdownResponseWBS": {
        "properties": {
          "tasks": {
            "items": {
              "$ref": "#/components/schemas/TaskSuggestionItem"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 3,
            "title": "Tasks"
          },
          "wbs_id": {
            "type": "string",
            "title": "Wbs Id"
          }
        },
        "type": "object",
        "required": [
          "tasks",
          "wbs_id"
        ],
        "title": "TaskBreakdownResponseWBS",
        "description": "Response with AI-generated tasks for WBS node"
      },
      "TaskBulkCreate": {
        "properties": {
          "tasks": {
            "items": {
              "$ref": "#/components/schemas/TaskCreate"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Tasks",
            "description": "List of 1-100 tasks to create"
          }
        },
        "type": "object",
        "required": [
          "tasks"
        ],
        "title": "TaskBulkCreate",
        "description": "Bulk task creation request",
        "example": {
          "tasks": [
            {
              "estimate_hours": 4.0,
              "priority": "high",
              "project_id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
              "title": "Setup development environment",
              "wbs_id": "01HQYYYYYYYYYYYYYYYYYYYY"
            },
            {
              "estimate_hours": 8.0,
              "priority": "medium",
              "project_id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
              "title": "Create database schema",
              "wbs_id": "01HQYYYYYYYYYYYYYYYYYYYY"
            }
          ]
        }
      },
      "TaskBulkCreateResponse": {
        "properties": {
          "created": {
            "items": {
              "$ref": "#/components/schemas/TaskResponse"
            },
            "type": "array",
            "title": "Created",
            "description": "Successfully created tasks"
          },
          "failed": {
            "items": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": "array",
            "title": "Failed",
            "description": "Failed tasks with error messages"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total tasks in request"
          },
          "success_count": {
            "type": "integer",
            "title": "Success Count",
            "description": "Number of successfully created tasks"
          },
          "failure_count": {
            "type": "integer",
            "title": "Failure Count",
            "description": "Number of failed tasks"
          }
        },
        "type": "object",
        "required": [
          "created",
          "total",
          "success_count",
          "failure_count"
        ],
        "title": "TaskBulkCreateResponse",
        "description": "Bulk task creation response",
        "example": {
          "created": [
            {
              "created_at": "2025-10-09T14:30:00Z",
              "estimate_hours": 4.0,
              "id": "01HQZZZZ1ZZZZZZZZZZZZZZZZZ",
              "percent_done": 0.0,
              "priority": "high",
              "project_id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
              "remaining_hours": 4.0,
              "state": "todo",
              "title": "Setup development environment",
              "updated_at": "2025-10-09T14:30:00Z",
              "wbs_id": "01HQYYYYYYYYYYYYYYYYYYYY"
            }
          ],
          "failed": [],
          "failure_count": 0,
          "success_count": 2,
          "total": 2
        }
      },
      "TaskBulkDelete": {
        "properties": {
          "ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Ids",
            "description": "List of task IDs to delete"
          }
        },
        "type": "object",
        "required": [
          "ids"
        ],
        "title": "TaskBulkDelete"
      },
      "TaskBulkPatch": {
        "properties": {
          "ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Ids"
          },
          "patch": {
            "$ref": "#/components/schemas/TaskUpdate"
          }
        },
        "type": "object",
        "required": [
          "ids",
          "patch"
        ],
        "title": "TaskBulkPatch"
      },
      "TaskBulkPatchResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "updated_count": {
            "type": "integer",
            "title": "Updated Count"
          },
          "requested_count": {
            "type": "integer",
            "title": "Requested Count"
          }
        },
        "type": "object",
        "required": [
          "message",
          "updated_count",
          "requested_count"
        ],
        "title": "TaskBulkPatchResponse",
        "description": "Bulk task update response"
      },
      "TaskCreate": {
        "properties": {
          "project_id": {
            "type": "string",
            "title": "Project Id"
          },
          "wbs_id": {
            "type": "string",
            "title": "Wbs Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "assignee_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee Id"
          },
          "estimate_hours": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimate Hours",
            "default": 0.0
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TaskState"
              },
              {
                "type": "null"
              }
            ]
          },
          "priority": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TaskPriority"
              },
              {
                "type": "null"
              }
            ]
          },
          "start_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "example": "2025-10-09T14:30:00Z"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start At"
          },
          "due_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "example": "2025-10-09T14:30:00Z"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due At"
          },
          "visible_in_views": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/TaskView"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visible In Views"
          },
          "percent_done": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Percent Done",
            "default": 0.0
          }
        },
        "type": "object",
        "required": [
          "project_id",
          "wbs_id",
          "title"
        ],
        "title": "TaskCreate",
        "example": {
          "assignee_id": "01HQZZZZZZZZZZZZZZZZZZZZZ",
          "description": "Add JWT-based authentication with login/logout",
          "due_at": "2025-10-12T17:00:00Z",
          "estimate_hours": 8.0,
          "priority": "high",
          "project_id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
          "start_at": "2025-10-10T09:00:00Z",
          "state": "todo",
          "title": "Implement user authentication",
          "wbs_id": "01HQYYYYYYYYYYYYYYYYYYYY"
        }
      },
      "TaskEstimateRequest": {
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "subtasks": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array",
                "maxItems": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtasks",
            "description": "List of subtask titles"
          },
          "context": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "title"
        ],
        "title": "TaskEstimateRequest",
        "description": "Request for AI-powered effort estimation"
      },
      "TaskEstimateResponse": {
        "properties": {
          "estimate_hours": {
            "type": "number",
            "maximum": 2000.0,
            "minimum": 0.1,
            "title": "Estimate Hours",
            "description": "Total estimated hours (0.1-2000)"
          },
          "confidence": {
            "type": "string",
            "pattern": "^(low|medium|high)$",
            "title": "Confidence",
            "description": "Confidence level"
          },
          "reasoning": {
            "type": "string",
            "maxLength": 500,
            "title": "Reasoning",
            "description": "Brief reasoning"
          },
          "breakdown": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Breakdown",
            "description": "Breakdown by subtask/component"
          }
        },
        "type": "object",
        "required": [
          "estimate_hours",
          "confidence",
          "reasoning"
        ],
        "title": "TaskEstimateResponse",
        "description": "Response with AI-generated effort estimate"
      },
      "TaskPriority": {
        "type": "string",
        "enum": [
          "low",
          "medium",
          "high",
          "urgent"
        ],
        "title": "TaskPriority"
      },
      "TaskResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "project_id": {
            "type": "string",
            "title": "Project Id"
          },
          "wbs_id": {
            "type": "string",
            "title": "Wbs Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "assignee_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee Id"
          },
          "estimate_hours": {
            "type": "number",
            "title": "Estimate Hours"
          },
          "remaining_hours": {
            "type": "number",
            "title": "Remaining Hours"
          },
          "state": {
            "$ref": "#/components/schemas/TaskState"
          },
          "priority": {
            "$ref": "#/components/schemas/TaskPriority"
          },
          "start_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "example": "2025-10-09T14:30:00Z"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start At"
          },
          "due_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "example": "2025-10-09T14:30:00Z"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due At"
          },
          "visible_in_views": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/TaskView"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visible In Views"
          },
          "percent_done": {
            "type": "number",
            "title": "Percent Done"
          },
          "duration_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Days"
          },
          "wbs_index": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Wbs Index",
            "description": "WBS index from parent WBS node (e.g., '1.2.3'). Available when sorting by wbs_index."
          },
          "subtasks": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/SubtaskResponse"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtasks"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2025-10-09T14:30:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "project_id",
          "wbs_id",
          "title",
          "estimate_hours",
          "remaining_hours",
          "state",
          "priority",
          "percent_done",
          "created_at",
          "updated_at"
        ],
        "title": "TaskResponse",
        "example": {
          "assignee_id": "01HQAAAAAAAAAAAAAAAAAAAAA",
          "created_at": "2025-10-09T10:00:00Z",
          "description": "Add JWT-based authentication with login/logout",
          "due_at": "2025-10-12T17:00:00Z",
          "duration_days": 3,
          "estimate_hours": 8.0,
          "id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
          "percent_done": 30.0,
          "priority": "high",
          "project_id": "01HQYYYYYYYYYYYYYYYYYYYY",
          "remaining_hours": 5.5,
          "start_at": "2025-10-10T09:00:00Z",
          "state": "in_progress",
          "title": "Implement user authentication",
          "updated_at": "2025-10-10T14:30:00Z",
          "visible_in_views": [
            "board",
            "table",
            "tree",
            "calendar",
            "gantt"
          ],
          "wbs_id": "01HQZZZZZZZZZZZZZZZZZZZZZ"
        }
      },
      "TaskState": {
        "type": "string",
        "enum": [
          "todo",
          "in_progress",
          "review",
          "blocked",
          "done"
        ],
        "title": "TaskState"
      },
      "TaskSuggestionItem": {
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 150,
            "minLength": 3,
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "estimate_hours": {
            "type": "number",
            "maximum": 200.0,
            "minimum": 0.1,
            "title": "Estimate Hours"
          }
        },
        "type": "object",
        "required": [
          "title",
          "estimate_hours"
        ],
        "title": "TaskSuggestionItem",
        "description": "Single task suggestion from AI"
      },
      "TaskSuggestionRequest": {
        "properties": {
          "task_id": {
            "type": "string",
            "title": "Task Id",
            "description": "Task ID to analyze"
          },
          "context": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context",
            "description": "Additional context for suggestions"
          }
        },
        "type": "object",
        "required": [
          "task_id"
        ],
        "title": "TaskSuggestionRequest",
        "description": "Request for AI-powered task improvement suggestions"
      },
      "TaskSuggestionResponse": {
        "properties": {
          "suggestions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 5,
            "minItems": 2,
            "title": "Suggestions",
            "description": "List of 2-5 improvement suggestions"
          },
          "task_id": {
            "type": "string",
            "title": "Task Id",
            "description": "Task ID that was analyzed"
          }
        },
        "type": "object",
        "required": [
          "suggestions",
          "task_id"
        ],
        "title": "TaskSuggestionResponse",
        "description": "Response with AI-generated task improvement suggestions"
      },
      "TaskUpdate": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "assignee_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee Id"
          },
          "wbs_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Wbs Id"
          },
          "estimate_hours": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimate Hours"
          },
          "remaining_hours": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining Hours"
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TaskState"
              },
              {
                "type": "null"
              }
            ]
          },
          "priority": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TaskPriority"
              },
              {
                "type": "null"
              }
            ]
          },
          "start_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "example": "2025-10-09T14:30:00Z"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start At"
          },
          "due_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "example": "2025-10-09T14:30:00Z"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due At"
          },
          "visible_in_views": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/TaskView"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visible In Views"
          },
          "percent_done": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Percent Done"
          }
        },
        "type": "object",
        "title": "TaskUpdate"
      },
      "TaskView": {
        "type": "string",
        "enum": [
          "board",
          "table",
          "tree",
          "calendar",
          "gantt"
        ],
        "title": "TaskView"
      },
      "TeamCreate": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "TeamCreate"
      },
      "TeamMemberAdd": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "role": {
            "type": "string",
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "role"
        ],
        "title": "TeamMemberAdd"
      },
      "TeamMemberResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "team_id": {
            "type": "string",
            "title": "Team Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "role": {
            "type": "string",
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "id",
          "team_id",
          "user_id",
          "role"
        ],
        "title": "TeamMemberResponse"
      },
      "TeamMemberUpdate": {
        "properties": {
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          }
        },
        "type": "object",
        "title": "TeamMemberUpdate"
      },
      "TeamResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "created_at"
        ],
        "title": "TeamResponse"
      },
      "TeamUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "type": "object",
        "title": "TeamUpdate"
      },
      "UserAdminCreate": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "title": "Password"
          },
          "is_admin": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Admin",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "name",
          "email",
          "password"
        ],
        "title": "UserAdminCreate",
        "description": "Admin endpoint: create user with optional admin flag"
      },
      "UserAdminUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "avatar": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar"
          },
          "is_admin": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Admin"
          }
        },
        "type": "object",
        "title": "UserAdminUpdate",
        "description": "Admin endpoint: update user fields"
      },
      "UserCreate": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "name",
          "email",
          "password"
        ],
        "title": "UserCreate"
      },
      "UserDashboardResponse": {
        "properties": {
          "user": {
            "$ref": "#/components/schemas/UserResponse",
            "description": "User information"
          },
          "stats": {
            "$ref": "#/components/schemas/UserDashboardStats",
            "description": "User statistics"
          }
        },
        "type": "object",
        "required": [
          "user",
          "stats"
        ],
        "title": "UserDashboardResponse",
        "description": "User dashboard data"
      },
      "UserDashboardStats": {
        "properties": {
          "workspaces_count": {
            "type": "integer",
            "title": "Workspaces Count",
            "description": "Number of workspaces user has access to"
          },
          "projects_count": {
            "type": "integer",
            "title": "Projects Count",
            "description": "Number of projects user is involved in"
          },
          "tasks_assigned": {
            "type": "integer",
            "title": "Tasks Assigned",
            "description": "Number of tasks assigned to user"
          },
          "tasks_completed": {
            "type": "integer",
            "title": "Tasks Completed",
            "description": "Number of completed tasks"
          },
          "tasks_in_progress": {
            "type": "integer",
            "title": "Tasks In Progress",
            "description": "Number of tasks in progress"
          }
        },
        "type": "object",
        "required": [
          "workspaces_count",
          "projects_count",
          "tasks_assigned",
          "tasks_completed",
          "tasks_in_progress"
        ],
        "title": "UserDashboardStats",
        "description": "User dashboard statistics"
      },
      "UserExportFormat": {
        "type": "string",
        "enum": [
          "json",
          "csv"
        ],
        "title": "UserExportFormat",
        "description": "Export format options"
      },
      "UserImportRequest": {
        "properties": {
          "users": {
            "items": {
              "$ref": "#/components/schemas/UserAdminCreate"
            },
            "type": "array",
            "maxItems": 1000,
            "minItems": 1,
            "title": "Users",
            "description": "List of users to import (1-1000)"
          }
        },
        "type": "object",
        "required": [
          "users"
        ],
        "title": "UserImportRequest",
        "description": "Bulk user import request"
      },
      "UserImportResponse": {
        "properties": {
          "created": {
            "items": {
              "$ref": "#/components/schemas/UserResponse"
            },
            "type": "array",
            "title": "Created",
            "description": "Successfully created users"
          },
          "failed": {
            "items": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": "array",
            "title": "Failed",
            "description": "Failed users with error messages"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total users in request"
          },
          "success_count": {
            "type": "integer",
            "title": "Success Count",
            "description": "Number of successfully created users"
          },
          "failure_count": {
            "type": "integer",
            "title": "Failure Count",
            "description": "Number of failed users"
          }
        },
        "type": "object",
        "required": [
          "created",
          "failed",
          "total",
          "success_count",
          "failure_count"
        ],
        "title": "UserImportResponse",
        "description": "Bulk user import response"
      },
      "UserPasswordUpdate": {
        "properties": {
          "password": {
            "type": "string",
            "minLength": 6,
            "title": "Password",
            "description": "New password (min 6 characters)"
          }
        },
        "type": "object",
        "required": [
          "password"
        ],
        "title": "UserPasswordUpdate",
        "description": "Admin endpoint: update user password"
      },
      "UserResponse": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "avatar": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar"
          },
          "is_admin": {
            "type": "boolean",
            "title": "Is Admin"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "last_login_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "example": "2025-10-09T14:30:00Z"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2025-10-09T14:30:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "name",
          "email",
          "id",
          "is_admin",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "UserResponse"
      },
      "UserUpdatePassword": {
        "properties": {
          "old_password": {
            "type": "string",
            "minLength": 6,
            "title": "Old Password"
          },
          "new_password": {
            "type": "string",
            "minLength": 6,
            "title": "New Password"
          }
        },
        "type": "object",
        "required": [
          "old_password",
          "new_password"
        ],
        "title": "UserUpdatePassword",
        "description": "User password update (self-service, requires old password)"
      },
      "UserUpdateProfile": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "avatar": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar"
          }
        },
        "type": "object",
        "title": "UserUpdateProfile",
        "description": "User profile update (self-service)"
      },
      "WBSCreate": {
        "properties": {
          "project_id": {
            "type": "string",
            "title": "Project Id"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Id"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "project_id",
          "type",
          "name"
        ],
        "title": "WBSCreate",
        "examples": [
          {
            "name": "Planning",
            "project_id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
            "type": "phase"
          },
          {
            "name": "Frontend Development",
            "project_id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
            "type": "group"
          },
          {
            "name": "User Interface Components",
            "parent_id": "01HQYYYYYYYYYYYYYYYYYYYY",
            "project_id": "01HQXXXXXXXXXXXXXXXXXXXXXX",
            "type": "wp"
          }
        ]
      },
      "WBSGenerationRequest": {
        "properties": {
          "project_name": {
            "type": "string",
            "minLength": 1,
            "title": "Project Name"
          },
          "project_description": {
            "type": "string",
            "minLength": 1,
            "title": "Project Description"
          },
          "project_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project Type",
            "description": "software, construction, event, etc."
          },
          "phases": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phases",
            "description": "Suggested project phases"
          }
        },
        "type": "object",
        "required": [
          "project_name",
          "project_description"
        ],
        "title": "WBSGenerationRequest",
        "description": "Request for AI-powered WBS structure generation"
      },
      "WBSGenerationResponse": {
        "properties": {
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/WBSNodeSuggestion"
            },
            "type": "array",
            "title": "Nodes"
          },
          "reasoning": {
            "type": "string",
            "title": "Reasoning"
          }
        },
        "type": "object",
        "required": [
          "nodes",
          "reasoning"
        ],
        "title": "WBSGenerationResponse",
        "description": "Response with AI-generated WBS structure"
      },
      "WBSNodeSuggestion": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "phase, group, or wp"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "parent_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Path",
            "description": "Path to parent (e.g., '1.2')"
          },
          "estimate_hours": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimate Hours"
          }
        },
        "type": "object",
        "required": [
          "name",
          "type"
        ],
        "title": "WBSNodeSuggestion",
        "description": "AI-generated WBS node suggestion"
      },
      "WBSResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "project_id": {
            "type": "string",
            "title": "Project Id"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Id"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "wbs_index": {
            "type": "string",
            "title": "Wbs Index"
          },
          "owner_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Id"
          },
          "estimate_hours": {
            "type": "number",
            "title": "Estimate Hours"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2025-10-09T14:30:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "project_id",
          "type",
          "name",
          "wbs_index",
          "estimate_hours",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "WBSResponse"
      },
      "WBSUpdate": {
        "properties": {
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "owner_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Id"
          },
          "estimate_hours": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimate Hours"
          }
        },
        "type": "object",
        "title": "WBSUpdate"
      },
      "WorkspaceCreate": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settings"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "WorkspaceCreate",
        "example": {
          "key": "MYCO",
          "name": "My Company Workspace",
          "settings": {
            "notifications": true,
            "theme": "dark"
          }
        }
      },
      "WorkspaceResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "settings_json": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settings Json"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2025-10-09T14:30:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "example": "2025-10-09T14:30:00Z"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "created_at",
          "updated_at"
        ],
        "title": "WorkspaceResponse"
      },
      "WorkspaceUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settings"
          }
        },
        "type": "object",
        "title": "WorkspaceUpdate"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "health",
      "description": "Health check and API metadata"
    },
    {
      "name": "auth",
      "description": "Authentication (login, register, password reset, tokens)"
    },
    {
      "name": "users",
      "description": "User management, profile, dashboard, search"
    },
    {
      "name": "admin",
      "description": "Admin endpoints (audit logs, user management)"
    },
    {
      "name": "teams",
      "description": "Team management and membership"
    },
    {
      "name": "workspaces",
      "description": "Workspace management and ACL"
    },
    {
      "name": "projects",
      "description": "Project management and ACL"
    },
    {
      "name": "wbs",
      "description": "Work Breakdown Structure (WBS) nodes"
    },
    {
      "name": "tasks",
      "description": "Task management with views (board, tree, calendar, gantt)"
    },
    {
      "name": "subtasks",
      "description": "Subtask management"
    },
    {
      "name": "files",
      "description": "File upload, download, and versioning"
    },
    {
      "name": "docs",
      "description": "Collaborative document editing"
    },
    {
      "name": "search",
      "description": "Full-text search (FTS5) across entities"
    },
    {
      "name": "ai",
      "description": "AI-powered suggestions (Mistral AI)"
    }
  ]
}