{"openapi":"3.0.0","info":{"title":"Leadership Under Uncertainty API","version":"1.0.0","description":"API documentation for Leadership Under Uncertainty","contact":{"name":"API Support","email":"support@leadershipunderuncertainty.org"},"license":{"name":"Proprietary"}},"servers":[{"url":"http://localhost:3000","description":"Development server"},{"url":"https://leadershipunderuncertainty.org","description":"Production server"}],"components":{"securitySchemes":{"sessionAuth":{"type":"apiKey","in":"cookie","name":"nb_session","description":"Session cookie authentication"},"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"details":{"type":"object","description":"Additional error details"}},"required":["error"]},"User":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"User ID"},"email":{"type":"string","format":"email","description":"User email"},"username":{"type":"string","description":"Username"},"onboarding_completed":{"type":"boolean","description":"Whether user completed onboarding"},"subscription_status":{"type":"string","enum":["trial","active","cancelled","expired"],"description":"Subscription status"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}}},"Workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Workspace ID"},"name":{"type":"string","description":"Workspace name"},"user_id":{"type":"string","format":"uuid","description":"Owner user ID"},"active":{"type":"boolean","description":"Whether workspace is active"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}}},"Thread":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Thread ID"},"title":{"type":"string","description":"Thread title"},"description":{"type":"string","description":"Thread description"},"user_id":{"type":"string","format":"uuid","description":"Owner user ID"},"workspace_id":{"type":"string","format":"uuid","description":"Workspace ID"},"status":{"type":"string","enum":["active","archived","deleted"],"description":"Thread status"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}}},"PaginationMeta":{"type":"object","properties":{"page":{"type":"integer","description":"Current page number"},"limit":{"type":"integer","description":"Items per page"},"total":{"type":"integer","description":"Total items"},"totalPages":{"type":"integer","description":"Total pages"},"hasNext":{"type":"boolean","description":"Whether there is a next page"},"hasPrev":{"type":"boolean","description":"Whether there is a previous page"}}},"HealthCheck":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","unhealthy"],"description":"Overall health status"},"timestamp":{"type":"string","format":"date-time","description":"Health check timestamp"},"version":{"type":"string","description":"Application version"},"database":{"type":"object","properties":{"healthy":{"type":"boolean"},"latency":{"type":"string"},"pool":{"type":"object"}}},"cache":{"type":"object","properties":{"redis":{"type":"object"},"memory":{"type":"object"}}}}},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"adminUserId":{"type":"string","format":"uuid"},"plan":{"type":"string","enum":["enterprise"]},"maxSeats":{"type":"integer"},"focusAreas":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}}},"OrganizationMember":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["admin","analyst","viewer"]},"joinedAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"fullName":{"type":"string"}}},"TeamBrief":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"briefDate":{"type":"string","example":"2026-03-10"},"sharedThemes":{"type":"array","items":{"type":"object","properties":{"theme":{"type":"string"},"description":{"type":"string"},"relevantDrivers":{"type":"array","items":{"type":"string"}}}}},"teamAccuracy":{"type":"object","properties":{"avgBrier":{"type":"number","nullable":true},"resolvedCount":{"type":"integer"},"memberCount":{"type":"integer"},"topPerformer":{"type":"string"}}},"generatedAt":{"type":"string","format":"date-time"}}}},"responses":{"MethodNotAllowed":{"description":"HTTP method not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Method not allowed","code":"METHOD_NOT_ALLOWED"}}}},"UnauthorizedError":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Authentication required","code":"UNAUTHORIZED"}}}},"ForbiddenError":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Insufficient permissions","code":"FORBIDDEN"}}}},"NotFoundError":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Resource not found","code":"NOT_FOUND"}}}},"ValidationError":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Validation failed","code":"VALIDATION_ERROR","details":{"field":"email","message":"Invalid email format"}}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Rate limit exceeded","code":"RATE_LIMIT_EXCEEDED"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Internal server error","code":"INTERNAL_ERROR"}}}}},"parameters":{"PageParam":{"name":"page","in":"query","description":"Page number (1-indexed)","schema":{"type":"integer","minimum":1,"default":1}},"LimitParam":{"name":"limit","in":"query","description":"Items per page","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},"UserIdParam":{"name":"userId","in":"path","required":true,"description":"User ID","schema":{"type":"string","format":"uuid"}},"WorkspaceIdParam":{"name":"workspaceId","in":"path","required":true,"description":"Workspace ID","schema":{"type":"string","format":"uuid"}},"ThreadIdParam":{"name":"threadId","in":"path","required":true,"description":"Thread ID","schema":{"type":"string","format":"uuid"}}}},"tags":[{"name":"Documentation","description":"API documentation and specifications"},{"name":"Health","description":"System health and monitoring"},{"name":"Authentication","description":"User authentication operations"},{"name":"Users","description":"User management operations"},{"name":"Workspaces","description":"Workspace management operations"},{"name":"Threads","description":"Thread management operations"},{"name":"Evidence","description":"Evidence management operations"},{"name":"Newsletters","description":"Newsletter operations"},{"name":"Analytics","description":"Analytics and metrics"}],"paths":{}}