{"components":{"parameters":{},"schemas":{"ApiErrorResponse":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"},"ApiListMeta":{"properties":{"api_version":{"enum":["v1"],"type":"string"},"has_more":{"type":"boolean"},"limit":{"minimum":0,"type":"integer"},"offset":{"minimum":0,"type":"integer"},"request_id":{"type":"string"},"total":{"minimum":0,"type":"integer"}},"required":["api_version","total","limit","offset","has_more"],"type":"object"},"ApiMeta":{"properties":{"api_version":{"enum":["v1"],"type":"string"},"request_id":{"type":"string"}},"required":["api_version"],"type":"object"},"AuthLoginConfigData":{"properties":{"domain_type":{"enum":["generic","work","edu","silver","security"],"type":"string"},"logo_url":{"format":"uri","nullable":true,"type":"string"},"officenext_enabled":{"type":"boolean"},"organization_name":{"type":"string"}},"type":"object"},"LooseArray":{"items":{"additionalProperties":{"nullable":true},"properties":{},"type":"object"},"type":"array"},"LooseObject":{"additionalProperties":{"nullable":true},"properties":{},"type":"object"},"RegistrationRequestBody":{"properties":{"contact":{"maxLength":50,"type":"string"},"department":{"maxLength":100,"type":"string"},"email":{"format":"email","type":"string"},"message":{"maxLength":1000,"type":"string"},"name":{"maxLength":100,"minLength":1,"type":"string"},"team":{"maxLength":100,"type":"string"}},"required":["name","email"],"type":"object"},"RegistrationRequestResponseData":{"properties":{"duplicated":{"type":"boolean"},"requestId":{"type":"string"},"success":{"type":"boolean"}},"required":["success","duplicated","requestId"],"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"description":"API key header for admin-scoped API access.","in":"header","name":"x-api-key","type":"apiKey"},"BearerAuth":{"bearerFormat":"Opaque","description":"Bearer token for API key or admin principal session access.","scheme":"bearer","type":"http"}}},"info":{"description":"External integration surface for MindSync. Authenticate every request with `X-API-Key`. Personal session submissions, sensitive analysis generation, and MCP automation are intentionally excluded.","title":"MindSync Integration API","version":"0.1.0"},"openapi":"3.0.3","paths":{"/api/v1/users":{"get":{"parameters":[{"in":"query","name":"search","required":false,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"exclusiveMinimum":true,"minimum":0,"type":"integer"}},{"in":"query","name":"offset","required":false,"schema":{"minimum":0,"nullable":true,"type":"integer"}},{"in":"query","name":"includeArchived","required":false,"schema":{"enum":["true","false"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"additionalProperties":{"nullable":true},"properties":{"contact":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"department":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"status":{"nullable":true,"type":"string"},"team":{"nullable":true,"type":"string"}},"required":["id","name"],"type":"object"},"type":"array"},"meta":{"properties":{"api_version":{"enum":["v1"],"type":"string"},"request_id":{"type":"string"}},"required":["api_version"],"type":"object"}},"required":["data"],"type":"object"}}},"description":"Success"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Conflict"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Internal server error"}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List users","tags":["User sync"],"description":"Read members by department, team, status, and search query so HRIS and account systems can reconcile rosters."}},"/api/v1/users/registration-requests":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"additionalProperties":{"nullable":true},"properties":{"created_at":{"type":"string"},"id":{"format":"uuid","type":"string"},"linked_user_id":{"format":"uuid","nullable":true,"type":"string"},"organization_id":{"format":"uuid","nullable":true,"type":"string"},"request_domain_type":{"type":"string"},"request_message":{"nullable":true,"type":"string"},"requested_contact":{"nullable":true,"type":"string"},"requested_department":{"nullable":true,"type":"string"},"requested_email":{"type":"string"},"requested_name":{"type":"string"},"requested_team":{"nullable":true,"type":"string"},"review_note":{"nullable":true,"type":"string"},"reviewed_at":{"nullable":true,"type":"string"},"reviewed_by_auth_user_id":{"format":"uuid","nullable":true,"type":"string"},"status":{"enum":["pending","approved","rejected"],"type":"string"},"updated_at":{"type":"string"}},"required":["id","request_domain_type","status","requested_name","requested_email","created_at","updated_at"],"type":"object"},"type":"array"},"meta":{"properties":{"api_version":{"enum":["v1"],"type":"string"},"request_id":{"type":"string"}},"required":["api_version"],"type":"object"}},"required":["data"],"type":"object"}}},"description":"Success"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Conflict"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Internal server error"}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List user registration requests","tags":["User sync"],"description":"Review registration requests by status and reconcile onboarding or training enrollment flows."}},"/api/v1/users/risk-summary":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"summary":{"properties":{"average_risk_score":{"type":"number"},"risk_distribution":{"items":{"properties":{"count":{"minimum":0,"type":"integer"},"level":{"enum":["low","medium","high","critical"],"type":"string"},"percentage":{"maximum":100,"minimum":0,"type":"integer"}},"required":["level","count","percentage"],"type":"object"},"type":"array"},"total_analyzed":{"minimum":0,"type":"integer"}},"required":["total_analyzed","average_risk_score","risk_distribution"],"type":"object"},"users":{"items":{"properties":{"checkin_count":{"minimum":0,"type":"integer"},"form_count":{"minimum":0,"type":"integer"},"latest_analysis_date":{"type":"string"},"latest_risk_level":{"enum":["low","medium","high","critical"],"type":"string"},"latest_risk_score":{"type":"number"},"total_analyses":{"minimum":0,"type":"integer"},"user_id":{"format":"uuid","type":"string"},"user_name":{"type":"string"}},"required":["user_id","user_name","latest_risk_score","latest_risk_level","total_analyses","form_count","checkin_count","latest_analysis_date"],"type":"object"},"type":"array"}},"required":["users","summary"],"type":"object"},"meta":{"properties":{"api_version":{"enum":["v1"],"type":"string"},"request_id":{"type":"string"}},"required":["api_version"],"type":"object"}},"required":["data"],"type":"object"}}},"description":"Success"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Conflict"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Internal server error"}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Per-user risk summary (last 30 days)","tags":["Risk signals"],"description":"Read only each member's latest risk score, risk level, analysis counts, form/check-in analysis counts, and last analysis date. Raw answers and AI comments are excluded."}},"/api/v1/dashboard":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"active_forms":{"minimum":0,"type":"integer"},"active_users":{"minimum":0,"type":"integer"},"avg_risk_score":{"type":"number"},"emergency_alerts":{"minimum":0,"type":"integer"},"high_risk_users":{"items":{"properties":{"emergency_count":{"minimum":0,"type":"integer"},"id":{"format":"uuid","type":"string"},"last_analysis":{"type":"string"},"name":{"type":"string"},"risk_level":{"enum":["low","medium","high","critical"],"type":"string"},"risk_score":{"type":"number"}},"required":["id","name","risk_score","risk_level","last_analysis","emergency_count"],"type":"object"},"type":"array"},"recent_activity":{"items":{"properties":{"created_at":{"type":"string"},"description":{"type":"string"},"id":{"format":"uuid","type":"string"},"type":{"enum":["checkin","form"],"type":"string"},"user_id":{"format":"uuid","type":"string"},"user_name":{"type":"string"}},"required":["id","user_id","user_name","type","description","created_at"],"type":"object"},"type":"array"},"risk_distribution":{"items":{"properties":{"count":{"minimum":0,"type":"integer"},"level":{"enum":["low","medium","high","critical"],"type":"string"},"percentage":{"maximum":100,"minimum":0,"type":"integer"}},"required":["level","count","percentage"],"type":"object"},"type":"array"},"today_checkins":{"minimum":0,"type":"integer"},"total_forms":{"minimum":0,"type":"integer"},"total_responses":{"minimum":0,"type":"integer"},"total_users":{"minimum":0,"type":"integer"},"weekly_engagement":{"maximum":100,"minimum":0,"type":"integer"}},"required":["total_users","active_users","total_forms","active_forms","total_responses","emergency_alerts","avg_risk_score","today_checkins","weekly_engagement","recent_activity","risk_distribution","high_risk_users"],"type":"object"},"meta":{"properties":{"api_version":{"enum":["v1"],"type":"string"},"request_id":{"type":"string"}},"required":["api_version"],"type":"object"}},"required":["data"],"type":"object"}}},"description":"Success"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Conflict"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Internal server error"}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Organization dashboard metrics","tags":["Reports"],"description":"Read organization-level aggregates such as total users, active users, form counts, response counts, today's check-ins, weekly engagement, and risk distribution."}},"/api/v1/analytics/risk-trends":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"points":{"items":{"properties":{"critical":{"minimum":0,"type":"integer"},"date":{"type":"string"},"high":{"minimum":0,"type":"integer"},"low":{"minimum":0,"type":"integer"},"medium":{"minimum":0,"type":"integer"},"total":{"minimum":0,"type":"integer"}},"required":["date","total","low","medium","high","critical"],"type":"object"},"type":"array"}},"required":["points"],"type":"object"},"meta":{"properties":{"api_version":{"enum":["v1"],"type":"string"},"request_id":{"type":"string"}},"required":["api_version"],"type":"object"}},"required":["data"],"type":"object"}}},"description":"Success"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Conflict"},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"nullable":true},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"}}},"description":"Internal server error"}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Risk trends (last 30 days)","tags":["Reports"],"description":"Read daily analysis counts and risk distribution changes over the last 30 days for organization reports and trend monitoring."}}},"servers":[{"url":"https://api.mindsynclab.ai","description":"Current environment"}],"tags":[{"name":"User sync","description":"Roster and registration request lookups for HRIS reconciliation."},{"name":"Reports","description":"Organization-wide aggregates for periodic reporting."},{"name":"Risk signals","description":"De-identified per-user risk summaries. Raw responses and AI commentary are excluded."}]}