{"openapi":"3.1.0","info":{"title":"Auxos","version":"0.1.0"},"paths":{"/admin/usage/summary":{"get":{"tags":["admin"],"summary":"Admin Usage Summary","description":"Admin-only read-only usage rollup for the Usage tab, at the grain\n(actor, population, workspace, day, hour) x (chats created, chat\nmessages sent, studies created, experiments created, surveys created).","operationId":"admin_usage_summary","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummaryResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/admin-users":{"get":{"tags":["admin"],"summary":"Admin List Users","description":"Lists active admins (un-revoked admin_users rows) with their emails.\nReturns { items: [{ user_id, email, granted_at }] } ordered by granted_at.","operationId":"admin_list_users","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUsersResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["admin"],"summary":"Admin Add User","description":"Grants admin access to an existing Supabase Auth user by email.\nActivates an admin_users row; does not create or invite a user account.","operationId":"admin_add_user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAddUserRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/admin-users/{user_id}":{"delete":{"tags":["admin"],"summary":"Admin Revoke User","description":"Revokes admin access (soft: stamps admin_users.revoked_at; re-adding\nclears it). Rejects self-revocation, so the last admin can't lock out.\nThe UUID param type canonicalizes casing before the self-check compares.","operationId":"admin_revoke_user","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserRevokedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/population-access":{"get":{"tags":["admin"],"summary":"Admin List Population Access","description":"Lists every population with its visibility, workspace grants, and workspace\noptions for the admin UI.\nReturns { items: [...], workspaces: [{ workspace_id, name }] }.","operationId":"admin_list_population_access","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationAccessListResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/invite":{"post":{"tags":["admin"],"summary":"Admin Invite","description":"Creates the Auth user and sends Supabase's native invite email. Does not\ngrant admin access. Platform-admin invites also provision the user's single\nowned workspace; workspace owner/admin member invites do not.","operationId":"admin_invite","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminInviteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminInviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/invites":{"get":{"tags":["admin"],"summary":"Admin List Pending Invites","description":"Lists Supabase Auth invite users who have not confirmed their email.","operationId":"admin_list_pending_invites","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPendingInvitesResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/invites/{user_id}/resend":{"post":{"tags":["admin"],"summary":"Admin Resend Pending Invite","description":"Sends a new native Supabase invite to one pending invite user.","operationId":"admin_resend_pending_invite","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPendingInviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/population-access/{population_id}":{"patch":{"tags":["admin"],"summary":"Admin Replace Population Access Policy","description":"Replaces the access policy for one population.\nUpdates public visibility and the complete workspace grant list together.","operationId":"admin_replace_population_access_policy","security":[{"HTTPBearer":[]}],"parameters":[{"name":"population_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Population Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationAccessPolicyPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationAccessItemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/workspaces":{"get":{"tags":["admin"],"summary":"Admin Workspaces Directory","description":"Directory of every workspace (including archived) with its team\nassignment, members (email, role, joined-at), owner, internal flag, and\ngranted populations, plus the admin teams list. Backs the Analytics\nWorkspaces view and the General Teams section.","operationId":"admin_workspaces_directory","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacesDirectoryResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/teams":{"post":{"tags":["admin"],"summary":"Admin Create Team","description":"Creates an admin team: a label grouping workspaces onto a customer org.\nDuplicate names are allowed — ids are identity.","operationId":"admin_create_team","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamNameRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/teams/{team_id}":{"patch":{"tags":["admin"],"summary":"Admin Rename Team","description":"Renames one admin team.","operationId":"admin_rename_team","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamNameRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamResponse"}}}},"404":{"description":"Team not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Admin Delete Team","description":"Deletes one admin team. Its workspace assignments cascade away; the\nworkspaces themselves are untouched and become unassigned.","operationId":"admin_delete_team","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamDeletedResponse"}}}},"404":{"description":"Team not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/teams/{team_id}/workspaces":{"put":{"tags":["admin"],"summary":"Admin Replace Team Workspaces","description":"Atomically replaces one team's workspace membership.","operationId":"admin_replace_team_workspaces","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamWorkspacesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamWorkspacesResponse"}}}},"404":{"description":"Team or workspace not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamErrorResponse"}}}},"409":{"description":"Stale membership or workspace assignment conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTeamErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/imports/voice-interviews/next":{"post":{"tags":["admin"],"summary":"Admin Claim Next Voice Interview Import","description":"Atomically claims the next pending parsed voice interview for a Prolific\nstudy and returns the same editable import draft as the direct loader.","operationId":"admin_claim_next_voice_interview_import","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewQaClaimRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewDraftResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/imports/voice-interviews/queue":{"get":{"tags":["admin"],"summary":"Admin List Voice Interview Qa Queue","description":"Lists parsed voice interviews and QA counts for one Prolific study.","operationId":"admin_list_voice_interview_qa_queue","security":[{"HTTPBearer":[]}],"parameters":[{"name":"study_id","in":"query","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewQaQueueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/imports/voice-interviews/prolific-status-sync":{"post":{"tags":["admin"],"summary":"Admin Sync Voice Interview Prolific Statuses","description":"Refreshes stored Prolific submission statuses for one study.","operationId":"admin_sync_voice_interview_prolific_statuses","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewProlificSyncRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewProlificSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/imports/voice-interviews/excluded":{"post":{"tags":["admin"],"summary":"Admin Delete Excluded Voice Interviews","description":"Deletes excluded, not-yet-imported voice interviews for one Prolific study.","operationId":"admin_delete_excluded_voice_interviews","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewDeleteExcludedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewDeleteExcludedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/imports/voice-interviews/{voice_interview_id}":{"get":{"tags":["admin"],"summary":"Admin Load Voice Interview Import","description":"Loads parsed voice-interview Q/A as a reviewable persona import draft.\nThis is review-stage only and does not write anything to Supabase.","operationId":"admin_load_voice_interview_import","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_interview_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Voice Interview Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewDraftResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/imports/voice-interviews/{voice_interview_id}/exclude":{"post":{"tags":["admin"],"summary":"Admin Exclude Voice Interview Import","description":"Marks one voice interview as excluded from manual QA/import.","operationId":"admin_exclude_voice_interview_import","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_interview_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Voice Interview Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewQaExcludeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewQaTransitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/imports/voice-interviews/{voice_interview_id}/release":{"post":{"tags":["admin"],"summary":"Admin Release Voice Interview Import","description":"Releases an in-review voice interview back to the pending QA queue.","operationId":"admin_release_voice_interview_import","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_interview_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Voice Interview Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInterviewQaTransitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/imports/persona":{"post":{"tags":["admin"],"summary":"Admin Commit Persona","description":"Step 1 of the per-persona import flow. Inserts one persona row and returns\nits id so the UI can attach chunks to it via the chunks endpoint.","operationId":"admin_commit_persona","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaImportPersonaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaImportPersonaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/imports/condense-questions":{"post":{"tags":["admin"],"summary":"Admin Condense Import Questions","description":"Cleans up wordy import questions to their core ask via an LLM pass.\nReview-stage only: returns condensed text for the reviewer to edit/save and\ndoes not write anything to Supabase.","operationId":"admin_condense_import_questions","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CondenseImportQuestionsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CondenseImportQuestionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/imports/chunks":{"post":{"tags":["admin"],"summary":"Admin Commit Persona Embeddings","description":"Step 2 of the per-persona import flow. Saves the interview transcript and the\n`persona_embeddings` rows for an existing persona created by step 1.","operationId":"admin_commit_persona_embeddings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaImportChunksRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaImportChunksResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/workspaces/{workspace_id}/assets":{"post":{"tags":["assets"],"summary":"Upload Workspace Asset","operationId":"upload_workspace_asset","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_workspace_asset"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat-archive":{"get":{"tags":["chat-archive"],"summary":"List Archived Chats","operationId":"list_archived_chats","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListArchivedChatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["chat-archive"],"summary":"Create Archived Chat","operationId":"create_archived_chat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateArchivedChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchivedChat"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat-archive/{chat_id}":{"get":{"tags":["chat-archive"],"summary":"Read Archived Chat","operationId":"read_archived_chat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"message_limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":500,"minimum":1},{"type":"null"}],"title":"Message Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadArchivedChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["chat-archive"],"summary":"Update Archived Chat","operationId":"update_archived_chat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateArchivedChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchivedChat"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["chat-archive"],"summary":"Delete Archived Chat","operationId":"delete_archived_chat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteArchivedChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat-archive/{chat_id}/messages":{"post":{"tags":["chat-archive"],"summary":"Send Archived Chat Message","operationId":"send_archived_chat_message","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}},"application/x-ndjson":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat/chats":{"get":{"tags":["chat"],"summary":"List Chats","operationId":"list_chats","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["chat"],"summary":"Create Chat","operationId":"create_chat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat/chats/{chat_id}":{"get":{"tags":["chat"],"summary":"Read Chat","operationId":"read_chat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["chat"],"summary":"Update Chat","operationId":"update_chat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["chat"],"summary":"Delete Chat","operationId":"delete_chat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat/chats/{chat_id}/title":{"post":{"tags":["chat"],"summary":"Generate Chat Title","description":"Auto-title: one cheap LLM call over the first exchange writes the\nchat's name (owner-only, same guarded UPDATE as the rename PATCH). The\nfrontend calls this once at first-turn finish, after persisting the\ntruncation placeholder it falls back to.","operationId":"generate_chat_title","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat/chats/{chat_id}/turns":{"post":{"tags":["chat"],"summary":"Start Chat Turn","description":"Start a turn and return its SSE stream directly (Decision 5): the\nPOST path reads its own turn's log from seq 0, so the reader is exercised\non every turn, not only on reconnect. Pre-flight (404/422/403) runs\nbefore the single-transaction persist; a 409 (active turn with a live\nlease) persists NOTHING.","operationId":"start_chat_turn","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartTurnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat/chats/{chat_id}/stream":{"get":{"tags":["chat"],"summary":"Stream Chat","description":"Reconnect to the chat's active turn: replay rows > Last-Event-ID,\nthen tail. 204 when no turn is active (the post-finish reader loads\nmessages instead — Decision 21).","operationId":"stream_chat","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"last-event-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last-Event-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat/chats/{chat_id}/turns/{turn_id}/events":{"get":{"tags":["chat"],"summary":"List Chat Turn Events","description":"Debug replay + the codegen carrier for the DataChunk union\n(Decision 18; the typed union response lands in U5). Scoped lookup:\nan out-of-scope turn_id 404s with zero event rows read.","operationId":"list_chat_turn_events","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"turn_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Turn Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"format","in":"query","required":false,"schema":{"const":"json","type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/TurnStartEvent"},{"$ref":"#/components/schemas/TextFlushEvent"},{"$ref":"#/components/schemas/ReasoningFlushEvent"},{"$ref":"#/components/schemas/ToolCallEvent"},{"$ref":"#/components/schemas/ToolResultEvent"},{"$ref":"#/components/schemas/DataChunkEvent"},{"$ref":"#/components/schemas/TurnFinishEvent"},{"$ref":"#/components/schemas/TurnErrorEvent"}],"discriminator":{"propertyName":"type","mapping":{"turn.start":"#/components/schemas/TurnStartEvent","text.flush":"#/components/schemas/TextFlushEvent","reasoning.flush":"#/components/schemas/ReasoningFlushEvent","tool.call":"#/components/schemas/ToolCallEvent","tool.result":"#/components/schemas/ToolResultEvent","data.chunk":"#/components/schemas/DataChunkEvent","turn.finish":"#/components/schemas/TurnFinishEvent","turn.error":"#/components/schemas/TurnErrorEvent"}}},"title":"Response List Chat Turn Events"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat/models":{"get":{"tags":["chat"],"summary":"List Chat Models","description":"The analyst model allowlist (U8, Decision 16), in display order.\nClient-safe entries only — the pydantic-ai model strings stay\nserver-side.","operationId":"list_chat_models","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/experiments":{"get":{"tags":["experiments"],"summary":"List Experiments","operationId":"list_experiments","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListExperimentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["experiments"],"summary":"Create Experiment","operationId":"create_experiment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExperimentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExperimentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/experiments/{experiment_id}":{"get":{"tags":["experiments"],"summary":"Read Experiment","operationId":"read_experiment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadExperimentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["experiments"],"summary":"Update Experiment","operationId":"update_experiment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExperimentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExperimentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["experiments"],"summary":"Delete Experiment","operationId":"delete_experiment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteExperimentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/experiments/{experiment_id}/launch":{"post":{"tags":["experiments"],"summary":"Launch Experiment","operationId":"launch_experiment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LaunchExperimentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/experiments/{experiment_id}/duplicate":{"post":{"tags":["experiments"],"summary":"Duplicate Experiment","operationId":"duplicate_experiment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateExperimentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/admin-status":{"get":{"tags":["me"],"summary":"Admin Status","description":"Reports whether the caller is an active platform admin.\n\nA status report, not a gate: non-admins get `{is_admin: false}`, never 403.\nKeep the query in sync with core/auth.py::get_admin_user — the same\nplatform-admin rule, enforced there instead of reported.","operationId":"admin_status","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStatusResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/mcp-tokens":{"get":{"tags":["mcp-tokens"],"summary":"List Mcp Tokens","operationId":"list_mcp_tokens","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMcpTokensResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["mcp-tokens"],"summary":"Create Mcp Token","operationId":"create_mcp_token","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMcpTokenRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMcpTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/mcp-tokens/{token_id}":{"delete":{"tags":["mcp-tokens"],"summary":"Delete Mcp Token","operationId":"delete_mcp_token","security":[{"HTTPBearer":[]}],"parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteMcpTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/media-assets/gc":{"post":{"tags":["admin"],"summary":"Admin Sweep Media Assets","description":"Two-pass GC sweep over `workspace-media`; see the service docstring\nfor the pass semantics and accepted races.\n\nThe body is optional so a bare POST (no body at all, the careless manual\ncall) lands on the dry-run default instead of a 422.","operationId":"admin_sweep_media_assets","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/MediaAssetsSweepRequest"},{"type":"null"}],"title":"Req"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetsSweepResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/persona-eval/{persona_id}/questions":{"get":{"tags":["persona-eval"],"summary":"Persona Eval Questions","operationId":"persona_eval_questions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Persona Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaEvalQuestionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/persona-eval/{persona_id}/run":{"post":{"tags":["persona-eval"],"summary":"Persona Eval Run","operationId":"persona_eval_run","security":[{"HTTPBearer":[]}],"parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Persona Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaEvalRunRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaEvalRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/population-eval/run":{"post":{"tags":["population-eval"],"summary":"Population Eval Run","operationId":"population_eval_run","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationEvalRunRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationEvalRunStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/population-eval/runs":{"get":{"tags":["population-eval"],"summary":"Population Eval Runs","operationId":"population_eval_runs","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationEvalRunsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/population-eval/runs/{run_id}":{"get":{"tags":["population-eval"],"summary":"Population Eval Run Detail","operationId":"population_eval_run_detail","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationEvalRunDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/population-eval/populations":{"get":{"tags":["population-eval"],"summary":"Population Eval Populations","operationId":"population_eval_populations","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationEvalPopulationsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/population-eval/question-sets":{"get":{"tags":["population-eval"],"summary":"Population Eval Question Sets","operationId":"population_eval_question_sets","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationEvalQuestionSetsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/population-eval/comparison-options":{"get":{"tags":["population-eval"],"summary":"Population Eval Comparison Options","operationId":"population_eval_comparison_options","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PopulationEvalComparisonOptionsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/workspaces/{workspace_id}/populations":{"get":{"tags":["populations"],"summary":"List Workspace Populations","description":"Population summaries plus exact persona counts — never persona rows.","operationId":"list_workspace_populations","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPopulationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/populations/{population_id}":{"get":{"tags":["populations"],"summary":"Read Population","description":"Workspace-relative detail: 404 unless this workspace can read it.","operationId":"read_population","security":[{"HTTPBearer":[]}],"parameters":[{"name":"population_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Population Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadPopulationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/populations/{population_id}/demographic-preview":{"post":{"tags":["populations"],"summary":"Preview Population Demographics","description":"Filter vocabulary + total/matching counts, computed in SQL.","operationId":"preview_population_demographics","security":[{"HTTPBearer":[]}],"parameters":[{"name":"population_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Population Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemographicPreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemographicPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/personas":{"get":{"tags":["populations"],"summary":"List Workspace Personas","description":"Lazy persona summaries: selected population, bounded search, or one-id\nrestore — exactly one mode per request (the service 422s anything else).","operationId":"list_workspace_personas","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"population_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Population Id"}},{"name":"query","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"title":"Query"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":50,"minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"persona_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Persona Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkspacePersonasResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/chat/chats/{chat_id}/study-draft":{"get":{"tags":["studies"],"summary":"Read Study Draft","operationId":"read_study_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyDraftDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["studies"],"summary":"Update Study Draft","operationId":"update_study_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/FrameEdit"},{"$ref":"#/components/schemas/SurveyQuestionsEdit"},{"$ref":"#/components/schemas/QualitativeQuestionsEdit"},{"$ref":"#/components/schemas/WorkingStateEdit"}],"discriminator":{"propertyName":"section","mapping":{"frame":"#/components/schemas/FrameEdit","survey_questions":"#/components/schemas/SurveyQuestionsEdit","qualitative_questions":"#/components/schemas/QualitativeQuestionsEdit","working_state":"#/components/schemas/WorkingStateEdit"}},"type":"object","title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyDraftDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["studies"],"summary":"Discard Study Draft","operationId":"discard_study_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/studies":{"get":{"tags":["studies"],"summary":"List Studies","operationId":"list_studies","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListStudiesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/studies/{study_id}":{"get":{"tags":["studies"],"summary":"Read Study","operationId":"read_study","security":[{"HTTPBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Study Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["studies"],"summary":"Rename Study","operationId":"rename_study","security":[{"HTTPBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Study Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameStudyPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["studies"],"summary":"Delete Study","operationId":"delete_study","security":[{"HTTPBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Study Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteStudyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/studies/{study_id}/run":{"post":{"tags":["studies"],"summary":"Run Study","operationId":"run_study","security":[{"HTTPBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Study Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/studies/{study_id}/cancel":{"post":{"tags":["studies"],"summary":"Cancel Study","operationId":"cancel_study","security":[{"HTTPBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Study Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/surveys":{"get":{"tags":["surveys"],"summary":"List Surveys","operationId":"list_surveys","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["surveys"],"summary":"Create Survey","operationId":"create_survey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/surveys/reservations":{"post":{"tags":["surveys"],"summary":"Reserve Survey","operationId":"reserve_survey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyReservationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/surveys/{survey_id}":{"get":{"tags":["surveys"],"summary":"Read Survey","operationId":"read_survey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Survey Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyReadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["surveys"],"summary":"Update Survey","operationId":"update_survey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Survey Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["surveys"],"summary":"Delete Survey","operationId":"delete_survey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Survey Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/surveys/{survey_id}/duplicate":{"post":{"tags":["surveys"],"summary":"Duplicate Survey","operationId":"duplicate_survey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Survey Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/surveys/{survey_id}/run":{"post":{"tags":["surveys"],"summary":"Run Survey","operationId":"run_survey","security":[{"HTTPBearer":[]}],"parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Survey Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyRunAcceptedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support":{"post":{"tags":["support"],"summary":"Send Support","operationId":"send_support","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportMessageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportMessageResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportErrorResponse"}}}},"503":{"description":"Support delivery is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/voice-interview/answers":{"post":{"tags":["voice-interview"],"summary":"Submit Answers","operationId":"submit_answers","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitAnswersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitAnswersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice-interview/start":{"post":{"tags":["voice-interview"],"summary":"Start","operationId":"start","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice-interview/elevenlabs_webhook":{"post":{"tags":["voice-interview"],"summary":"Elevenlabs Webhook","operationId":"elevenlabs_webhook","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAcknowledgement"}}}}}}},"/workspaces/creation-options":{"get":{"tags":["workspaces"],"summary":"Get Workspace Creation Options","operationId":"get_workspace_creation_options","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreationOptionsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/workspaces":{"get":{"tags":["workspaces"],"summary":"List Workspaces","operationId":"list_workspaces","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkspacesResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["workspaces"],"summary":"Create Workspace","operationId":"create_workspace","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/workspaces/{workspace_id}/members":{"get":{"tags":["workspaces"],"summary":"List Workspace Members","description":"Lists members (with email, role, and active/pending status) for a member.","operationId":"list_workspace_members","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMembersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["workspaces"],"summary":"Invite Workspace Member","description":"Invites a user by email into the workspace as admin or member. Owner/admin only.","operationId":"invite_workspace_member","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteMemberRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMember"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}":{"patch":{"tags":["workspaces"],"summary":"Rename Workspace","description":"Renames the workspace. Owner only.","operationId":"rename_workspace","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameWorkspaceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}/members/{member_user_id}":{"patch":{"tags":["workspaces"],"summary":"Update Workspace Member Role","description":"Assigns a member between admin and member roles. Owner only.","operationId":"update_workspace_member_role","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member User Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMember"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["workspaces"],"summary":"Remove Workspace Member","description":"Removes an admin or member from the workspace. Owner only.","operationId":"remove_workspace_member","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member User Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveWorkspaceMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["system"],"summary":"Health","operationId":"health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health"}}}}}}},"/whoami":{"get":{"tags":["system"],"summary":"Whoami","operationId":"whoami","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Whoami"}}}}}}}},"components":{"schemas":{"AdminAddUserRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"AdminAddUserRequest"},"AdminInviteRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"AdminInviteRequest"},"AdminInviteResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Userid"}},"type":"object","required":["ok"],"title":"AdminInviteResponse"},"AdminPendingInviteItem":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","format":"email","title":"Email"},"sent_at":{"type":"string","format":"date-time","title":"Sent At"}},"type":"object","required":["user_id","email","sent_at"],"title":"AdminPendingInviteItem"},"AdminPendingInviteResponse":{"properties":{"item":{"$ref":"#/components/schemas/AdminPendingInviteItem"}},"type":"object","required":["item"],"title":"AdminPendingInviteResponse"},"AdminPendingInvitesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminPendingInviteItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminPendingInvitesResponse"},"AdminStatusResponse":{"properties":{"is_admin":{"type":"boolean","title":"Is Admin"}},"type":"object","required":["is_admin"],"title":"AdminStatusResponse"},"AdminTeamDeletedResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"team_id":{"type":"string","title":"Team Id"}},"type":"object","required":["ok","team_id"],"title":"AdminTeamDeletedResponse"},"AdminTeamErrorResponse":{"properties":{"error":{"type":"string","title":"Error"},"code":{"type":"string","enum":["not_found","conflict"],"title":"Code"}},"type":"object","required":["error","code"],"title":"AdminTeamErrorResponse"},"AdminTeamItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","name","created_at"],"title":"AdminTeamItem"},"AdminTeamNameRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"AdminTeamNameRequest"},"AdminTeamResponse":{"properties":{"item":{"$ref":"#/components/schemas/AdminTeamItem"}},"type":"object","required":["item"],"title":"AdminTeamResponse"},"AdminTeamWorkspacesRequest":{"properties":{"expected_workspace_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Expected Workspace Ids"},"workspace_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Workspace Ids"}},"type":"object","required":["expected_workspace_ids","workspace_ids"],"title":"AdminTeamWorkspacesRequest"},"AdminTeamWorkspacesResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"team_id":{"type":"string","title":"Team Id"},"workspace_ids":{"items":{"type":"string"},"type":"array","title":"Workspace Ids"}},"type":"object","required":["ok","team_id","workspace_ids"],"title":"AdminTeamWorkspacesResponse"},"AdminUserCreatedResponse":{"properties":{"item":{"$ref":"#/components/schemas/AdminUserItem"}},"type":"object","required":["item"],"title":"AdminUserCreatedResponse"},"AdminUserItem":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"granted_at":{"type":"string","title":"Granted At"}},"type":"object","required":["user_id","granted_at"],"title":"AdminUserItem"},"AdminUserRevokedResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"user_id":{"type":"string","title":"User Id"}},"type":"object","required":["ok","user_id"],"title":"AdminUserRevokedResponse"},"AdminUsersResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminUserItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminUsersResponse"},"ArchivedChat":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"population_id":{"type":"string","format":"uuid","title":"Population Id"},"persona_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Persona Id"},"chat_name":{"type":"string","title":"Chat Name"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"population_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Population Name"},"persona_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Name"},"can_write":{"type":"boolean","title":"Can Write"}},"type":"object","required":["id","owner_id","workspace_id","population_id","persona_id","chat_name","created_at","updated_at","population_name","persona_name","can_write"],"title":"ArchivedChat","description":"The one chat shape, used internally and on the wire.\n\nThe first eight fields are `chat_archive_chats` table columns; the rest\nare computed when the row is fetched (see `shape_chats`)."},"ArchivedChatListItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"population_id":{"type":"string","format":"uuid","title":"Population Id"},"persona_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Persona Id"},"chat_name":{"type":"string","title":"Chat Name"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"population_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Population Name"},"persona_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Name"},"can_write":{"type":"boolean","title":"Can Write"},"creator_label":{"type":"string","title":"Creator Label"}},"type":"object","required":["id","owner_id","workspace_id","population_id","persona_id","chat_name","created_at","updated_at","population_name","persona_name","can_write","creator_label"],"title":"ArchivedChatListItem"},"ArchivedChatMessage":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"role":{"type":"string","enum":["user","assistant"],"title":"Role"},"metadata":{"$ref":"#/components/schemas/ArchivedChatMessageMetadata"},"parts":{"items":{"oneOf":[{"$ref":"#/components/schemas/TextPart"},{"$ref":"#/components/schemas/FilePart"},{"$ref":"#/components/schemas/ProgressToolPart"},{"$ref":"#/components/schemas/ResponseClustersPart"}],"discriminator":{"propertyName":"type","mapping":{"data-responseClusters":"#/components/schemas/ResponseClustersPart","dynamic-tool":"#/components/schemas/ProgressToolPart","file":"#/components/schemas/FilePart","text":"#/components/schemas/TextPart"}}},"type":"array","title":"Parts"}},"type":"object","required":["id","role","metadata"],"title":"ArchivedChatMessage"},"ArchivedChatMessageCustom":{"properties":{"demographicFilter":{"additionalProperties":true,"type":"object","title":"Demographicfilter"}},"type":"object","required":["demographicFilter"],"title":"ArchivedChatMessageCustom"},"ArchivedChatMessageMetadata":{"properties":{"chatId":{"type":"string","title":"Chatid"},"custom":{"anyOf":[{"$ref":"#/components/schemas/ArchivedChatMessageCustom"},{"type":"null"}]}},"type":"object","required":["chatId"],"title":"ArchivedChatMessageMetadata"},"AskUserResponse":{"properties":{"id":{"type":"string","maxLength":64,"minLength":1,"title":"Id"},"answer":{"type":"string","maxLength":2000,"minLength":1,"title":"Answer"}},"additionalProperties":false,"type":"object","required":["id","answer"],"title":"AskUserResponse","description":"One answered question inside the multi-question arm: the `id` the\n`ask_user` call gave that question, plus what the user chose or typed —\nan option click and free text are indistinguishable here (Decision 26)."},"AskUserToolResult":{"properties":{"tool_call_id":{"type":"string","maxLength":128,"minLength":1,"title":"Tool Call Id"},"answer":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Answer"},"responses":{"anyOf":[{"items":{"$ref":"#/components/schemas/AskUserResponse"},"type":"array","maxItems":4,"minItems":1},{"type":"null"}],"title":"Responses"}},"additionalProperties":false,"type":"object","required":["tool_call_id"],"title":"AskUserToolResult","description":"One answered `ask_user` call (chat-v2 Decision 25): the pending tool\ncall's id plus the user's answer(s) — an option click or the card's\nfree-text field, indistinguishable on the wire (Decision 26).\n\nTWO ARMS, exactly one set (studies-in-chat KD11):\n\n* `responses` — the current shape: one entry per question on the card\n  (1–4), keyed by the ids the `ask_user` call asked with.\n* `answer` — the single-question shape. This arm is NOT a shim and not\n  deprecated-with-a-deadline: an ask that was already PENDING when KD11\n  deployed has single-question args stored in its message row, so its\n  card can only ever emit `{answer}`. Removing this arm would strand\n  those pauses (a chat with an unanswerable question can never take\n  another turn — the pending-ask guard rejects plain messages). It stays.\n\n`tool_output` is the ONE mapping from either arm to the payload the agent\nreceives as the deferred tool result."},"AssetAttachmentInput":{"properties":{"asset_id":{"type":"string","format":"uuid","title":"Asset Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},"additionalProperties":false,"type":"object","required":["asset_id"],"title":"AssetAttachmentInput","description":"Durable workspace-media reference supplied by browser or MCP clients."},"AssetUploadResponse":{"properties":{"asset_id":{"type":"string","title":"Asset Id"},"url":{"type":"string","title":"Url"}},"type":"object","required":["asset_id","url"],"title":"AssetUploadResponse"},"AuditIssue":{"properties":{"code":{"type":"string","enum":["problem_missing","problem_assumed","coverage_gap","unknown_feed","unknown_stimulus","unused_stimulus","duplicate_stimulus_asset","unfed_instrument","mc_options","mc_other","scale_anchors","status_premature","population_missing","objective_soft_cap","survey_length","qual_length","duplicate_id","open_items_out_of_order"],"title":"Code"},"severity":{"type":"string","enum":["error","warning"],"title":"Severity"},"message":{"type":"string","title":"Message"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"}},"type":"object","required":["code","severity","message"],"title":"AuditIssue"},"Body_upload_workspace_asset":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_workspace_asset"},"Brief":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Title"},"business_problem":{"type":"string","maxLength":2000,"title":"Business Problem"},"action_standard":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Action Standard","description":"Pre-agreed decision rule — only when the research informs a decision: what result would make the user act. Absent for curiosity-driven studies."},"context":{"type":"string","maxLength":2000,"title":"Context"},"assumptions":{"items":{"type":"string","maxLength":2000},"type":"array","title":"Assumptions"},"provenance":{"items":{"$ref":"#/components/schemas/ProvenanceEntry"},"type":"array","title":"Provenance"},"research_objectives":{"items":{"$ref":"#/components/schemas/ResearchObjective"},"type":"array","title":"Research Objectives"},"stimuli":{"items":{"oneOf":[{"$ref":"#/components/schemas/TextStimulus"},{"$ref":"#/components/schemas/ImageStimulus"}],"discriminator":{"propertyName":"kind","mapping":{"image":"#/components/schemas/ImageStimulus","text":"#/components/schemas/TextStimulus"}}},"type":"array","title":"Stimuli"},"stimulus_gap":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Stimulus Gap","description":"Set when the business problem references an artifact the user could not provide"},"survey_questions":{"items":{"$ref":"#/components/schemas/SurveyQuestion"},"type":"array","title":"Survey Questions"},"qualitative_questions":{"items":{"$ref":"#/components/schemas/QualitativeQuestion"},"type":"array","title":"Qualitative Questions"},"open_items":{"items":{"$ref":"#/components/schemas/OpenItem"},"type":"array","title":"Open Items","description":"Unresolved intake questions — this IS the question queue"}},"type":"object","required":["business_problem","context","assumptions","provenance","research_objectives","stimuli","survey_questions","qualitative_questions","open_items"],"title":"Brief","description":"The research brief document (the `studies.brief` jsonb).\n\nDonor `briefSchema` minus `audience` (KD4) and minus `status` — status is\na column on the `studies` row, never a key inside the document."},"BriefDiscardedChunk":{"properties":{"name":{"type":"string","const":"briefDiscarded","title":"Name","default":"briefDiscarded"},"payload":{"$ref":"#/components/schemas/BriefDiscardedPayload"},"transient":{"type":"boolean","title":"Transient","default":false}},"type":"object","required":["payload"],"title":"BriefDiscardedChunk"},"BriefDiscardedPayload":{"properties":{"title":{"type":"string","title":"Title"}},"type":"object","required":["title"],"title":"BriefDiscardedPayload","description":"The `data-briefDiscarded` payload: the transcript's visible record\nthat this chat's study draft was discarded — without it, a chat full of\nbrief-building talk (and possibly dismissed ask receipts) would end with\nno draft and no explanation. `title` is the discarded draft's title, the\nonly field the marker line renders.\n\nPERSISTED-PARTS-ONLY today: the discard settle\n(`services/chat/sql.py::settle_draft_discard`) appends it to the last\nassistant message's stored parts inside the discard transaction — no\nturn is running, so nothing ever emits it as a live `data.chunk` event.\nIt is still a union member for the dual-schema guardrail: the generated\ntype is what the frontend renderer keys off, and a future live emission\nwould already be wire-legal."},"BriefStateChunk":{"properties":{"name":{"type":"string","const":"briefState","title":"Name","default":"briefState"},"payload":{"$ref":"#/components/schemas/BriefStatePayload"},"transient":{"type":"boolean","title":"Transient","default":false}},"type":"object","required":["payload"],"title":"BriefStateChunk"},"BriefStatePayload":{"properties":{"brief":{"$ref":"#/components/schemas/Brief"},"status":{"type":"string","title":"Status"},"issues":{"items":{"$ref":"#/components/schemas/AuditIssue"},"type":"array","title":"Issues"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"}},"type":"object","required":["brief","status","issues"],"title":"BriefStatePayload","description":"The `data-briefState` payload: one canvas-renderable snapshot of the\nstudy entity — the full POST-STATE brief, its status, and the audit\nissues on that state. Emitted by the mutating brief tools (create_brief,\nthe four per-section edit tools, set_status) ONLY when the entity changed;\na strict rejection\nemits no chunk (the rejection is the model's tool result, and the canvas\nstill shows the stored document)."},"Chat":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"population_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Population Id"},"population_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Population Name"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"owner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Name"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"cohort_filter":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Cohort Filter"},"cohort_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Label"},"cohort_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cohort Size"},"focused_persona_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Focused Persona Id"},"focused_persona_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Focused Persona Name"},"has_study_draft":{"type":"boolean","title":"Has Study Draft"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"can_write":{"type":"boolean","title":"Can Write"}},"type":"object","required":["id","workspace_id","population_id","population_name","owner_id","name","cohort_filter","focused_persona_id","focused_persona_name","has_study_draft","created_at","updated_at","can_write"],"title":"Chat","description":"The one chat shape — the `chats` columns, plus the\nfetch-time `can_write` flag (reads are workspace-wide, writes\nowner-scoped), the joined `population_name`/`focused_persona_name`\n(chat-v2 Decision 30: labels ride the chat row, no extra fetch), and the\nservice-derived cohort enrichment (single-row reads only,\nchat-scope-ladder Decision 9)."},"ChatDetail":{"properties":{"chat":{"$ref":"#/components/schemas/Chat"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages"}},"type":"object","required":["chat","messages"],"title":"ChatDetail"},"ChatImageAttachment":{"properties":{"bucket":{"type":"string","minLength":1,"title":"Bucket"},"path":{"type":"string","minLength":1,"title":"Path"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},"additionalProperties":false,"type":"object","required":["bucket","path"],"title":"ChatImageAttachment"},"ChatMessage":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"parent_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Message Id"},"role":{"type":"string","enum":["user","assistant"],"title":"Role"},"parts":{"items":{},"type":"array","title":"Parts"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","chat_id","role","created_at"],"title":"ChatMessage","description":"One stored message row. `parts` is the UIMessage parts array as\npersisted — deliberately passthrough JSON; the typed U5 union\n(`TurnEvent`/`ChatDataChunk` below) covers turn events, not stored\nparts."},"ChatModelInfo":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"provider":{"type":"string","enum":["anthropic","openai"],"title":"Provider"},"supports_thinking":{"type":"boolean","title":"Supports Thinking"}},"type":"object","required":["id","label","provider","supports_thinking"],"title":"ChatModelInfo","description":"One analyst-allowlist entry, client-safe (U8, Decision 16): ids,\nlabels, provider, and the reasoning-display flag only — the pydantic-ai\nmodel string stays server-side (Studies models.ts parity)."},"ChatResponseClusterCode":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"summary":{"type":"string","title":"Summary"},"count":{"type":"integer","minimum":0.0,"title":"Count"},"share":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Share"},"primary_count":{"type":"integer","minimum":0.0,"title":"Primary Count"},"sentiment":{"type":"string","enum":["positive","neutral","mixed","negative"],"title":"Sentiment"},"member_persona_ids":{"items":{"type":"string"},"type":"array","title":"Member Persona Ids"},"primary_persona_ids":{"items":{"type":"string"},"type":"array","title":"Primary Persona Ids"},"skew":{"items":{"$ref":"#/components/schemas/ChatResponseClusterSkew"},"type":"array","title":"Skew"},"quotes":{"items":{"$ref":"#/components/schemas/ChatResponseClusterQuote"},"type":"array","title":"Quotes"},"examples":{"items":{"$ref":"#/components/schemas/ChatResponseClusterExample"},"type":"array","title":"Examples"}},"type":"object","required":["id","title","summary","count","share","primary_count","sentiment","member_persona_ids","primary_persona_ids","skew","quotes"],"title":"ChatResponseClusterCode"},"ChatResponseClusterExample":{"properties":{"persona_id":{"type":"string","title":"Persona Id"},"persona":{"type":"string","title":"Persona"},"text":{"type":"string","title":"Text"}},"type":"object","required":["persona_id","persona","text"],"title":"ChatResponseClusterExample"},"ChatResponseClusterQuote":{"properties":{"persona":{"type":"string","title":"Persona"},"text":{"type":"string","title":"Text"}},"type":"object","required":["persona","text"],"title":"ChatResponseClusterQuote"},"ChatResponseClusterSkew":{"properties":{"group":{"type":"string","title":"Group"},"label":{"type":"string","title":"Label"},"share":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Share"}},"type":"object","required":["group","label","share"],"title":"ChatResponseClusterSkew"},"ChatUsage":{"properties":{"requests":{"type":"integer","title":"Requests","default":0},"tool_calls":{"type":"integer","title":"Tool Calls","default":0},"input_tokens":{"type":"integer","title":"Input Tokens","default":0},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens","default":0},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","default":0},"details":{"additionalProperties":{"type":"integer"},"type":"object","title":"Details"}},"type":"object","title":"ChatUsage","description":"Token usage stamped into assistant-message metadata and `turn.finish`\npayloads. Field names mirror pydantic-ai's `RunUsage`; `input_tokens`\nAGGREGATES uncached + cache_write + cache_read across the run's requests\n(U1 findings) — bill from the cache_* fields, not from it."},"ChoiceOptionInput":{"properties":{"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"},"label":{"type":"string","minLength":1,"title":"Label"}},"additionalProperties":false,"type":"object","required":["label"],"title":"ChoiceOptionInput"},"CohortChunk":{"properties":{"name":{"type":"string","const":"cohort","title":"Name","default":"cohort"},"payload":{"$ref":"#/components/schemas/CohortPayload"},"transient":{"type":"boolean","title":"Transient","default":false}},"type":"object","required":["payload"],"title":"CohortChunk"},"CohortPayload":{"properties":{"cohort_id":{"type":"string","title":"Cohort Id"},"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["cohort_id","label","count"],"title":"CohortPayload","description":"The `data-cohort` payload — renders as the selection's scope chip\n(\"Selected N · label\"). Carries NO Scope: find_respondents is\naudience-defining, not question-shaped (the chip's display Scope is\nminted client-side from this payload). The label always renders the\nEFFECTIVE filter — chat scope ∧ call filter — so persisted chips never\nmisstate history (chat-scope-ladder Decision 1)."},"CondenseImportQuestionDraft":{"properties":{"id":{"type":"string","title":"Id"},"question":{"type":"string","title":"Question"},"section":{"type":"string","title":"Section","default":""},"questionType":{"type":"string","title":"Questiontype","default":""}},"type":"object","required":["id","question"],"title":"CondenseImportQuestionDraft"},"CondenseImportQuestionsRequest":{"properties":{"questions":{"items":{"$ref":"#/components/schemas/CondenseImportQuestionDraft"},"type":"array","title":"Questions"}},"type":"object","title":"CondenseImportQuestionsRequest"},"CondenseImportQuestionsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CondensedImportQuestion"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"CondenseImportQuestionsResponse"},"CondensedImportQuestion":{"properties":{"id":{"type":"string","title":"Id"},"question":{"type":"string","title":"Question"}},"type":"object","required":["id","question"],"title":"CondensedImportQuestion"},"CreateArchivedChatRequest":{"properties":{"population_id":{"type":"string","format":"uuid","title":"Population Id"},"persona_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Persona Id"},"chat_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Chat Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"chat_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Name"}},"additionalProperties":false,"type":"object","required":["population_id"],"title":"CreateArchivedChatRequest"},"CreateChatRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"}},"additionalProperties":false,"type":"object","title":"CreateChatRequest","description":"POST /chats body. No `population_id`: chats are born unbound and bind\nconversationally via the `use_population` tool (chat-v2 Decision 27)."},"CreateExperimentRequest":{"properties":{"population_id":{"type":"string","format":"uuid","title":"Population Id"},"name":{"type":"string","minLength":1,"title":"Name"},"variants":{"items":{"$ref":"#/components/schemas/ExperimentVariantInput"},"type":"array","maxItems":2,"minItems":2,"title":"Variants"},"category":{"type":"string","enum":["creatives","messaging","products","websites"],"title":"Category"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"demographic_filter":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Demographic Filter"},"flow":{"anyOf":[{"$ref":"#/components/schemas/ExperimentFlowInput"},{"type":"null"}]}},"type":"object","required":["population_id","name","variants","category"],"title":"CreateExperimentRequest"},"CreateExperimentResponse":{"properties":{"status":{"type":"string","const":"draft","title":"Status"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"population":{"$ref":"#/components/schemas/ExperimentCreatedPopulation"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["status","experiment_id","population","answer"],"title":"CreateExperimentResponse"},"CreateMcpTokenRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"expires_in_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days"}},"type":"object","required":["name"],"title":"CreateMcpTokenRequest"},"CreateMcpTokenResponse":{"properties":{"token":{"type":"string","title":"Token"},"mcp_token":{"$ref":"#/components/schemas/McpTokenSummary"}},"type":"object","required":["token","mcp_token"],"title":"CreateMcpTokenResponse","description":"`token` is the plaintext secret, returned once after creation."},"CreateWorkspaceRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"private_population_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":200,"title":"Private Population Ids"}},"type":"object","required":["name"],"title":"CreateWorkspaceRequest"},"DataChunkEvent":{"properties":{"turn_id":{"type":"string","format":"uuid","title":"Turn Id"},"seq":{"type":"integer","title":"Seq"},"created_at":{"type":"string","title":"Created At"},"type":{"type":"string","const":"data.chunk","title":"Type"},"payload":{"oneOf":[{"$ref":"#/components/schemas/RespondentCardChunk"},{"$ref":"#/components/schemas/CohortChunk"},{"$ref":"#/components/schemas/PersonaReplyChunk"},{"$ref":"#/components/schemas/ResponseClustersChunk"},{"$ref":"#/components/schemas/BriefStateChunk"},{"$ref":"#/components/schemas/TurnDurationChunk"},{"$ref":"#/components/schemas/BriefDiscardedChunk"}],"title":"Payload","discriminator":{"propertyName":"name","mapping":{"briefDiscarded":"#/components/schemas/BriefDiscardedChunk","briefState":"#/components/schemas/BriefStateChunk","cohort":"#/components/schemas/CohortChunk","personaReply":"#/components/schemas/PersonaReplyChunk","respondentCard":"#/components/schemas/RespondentCardChunk","responseClusters":"#/components/schemas/ResponseClustersChunk","turnDuration":"#/components/schemas/TurnDurationChunk"}}}},"type":"object","required":["turn_id","seq","created_at","type","payload"],"title":"DataChunkEvent"},"DeleteArchivedChatResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok"}},"type":"object","required":["ok"],"title":"DeleteArchivedChatResponse"},"DeleteChatResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok"}},"type":"object","required":["ok"],"title":"DeleteChatResponse"},"DeleteExperimentResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"}},"type":"object","required":["ok","experiment_id"],"title":"DeleteExperimentResponse"},"DeleteMcpTokenResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok"},"token_id":{"type":"string","title":"Token Id"}},"type":"object","required":["ok","token_id"],"title":"DeleteMcpTokenResponse"},"DeleteStudyResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok"}},"type":"object","required":["ok"],"title":"DeleteStudyResponse"},"DemographicPreviewRequest":{"properties":{"demographic_filter":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Demographic Filter"}},"additionalProperties":false,"type":"object","title":"DemographicPreviewRequest"},"DemographicPreviewResponse":{"properties":{"status":{"type":"string","const":"completed","title":"Status"},"attributes":{"items":{"$ref":"#/components/schemas/PopulationFilterAttribute"},"type":"array","title":"Attributes"},"total_count":{"type":"integer","title":"Total Count"},"matching_count":{"type":"integer","title":"Matching Count"}},"type":"object","required":["status","attributes","total_count","matching_count"],"title":"DemographicPreviewResponse","description":"Vocabulary plus exact counts — never persona rows. An empty filter\nreports ``matching_count == total_count``."},"DisplayedStudyInput":{"properties":{"study_id":{"type":"string","format":"uuid","title":"Study Id"}},"additionalProperties":false,"type":"object","required":["study_id"],"title":"DisplayedStudyInput","description":"The saved study that the chat UI currently displays.\n\nThis is an ephemeral focus hint, not study content. The runtime resolves\nthe ID through the saved-study read guard before the analyst sees it."},"DuplicateExperimentResponse":{"properties":{"status":{"type":"string","const":"draft","title":"Status"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"source_experiment_id":{"type":"string","format":"uuid","title":"Source Experiment Id"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["status","experiment_id","source_experiment_id","answer"],"title":"DuplicateExperimentResponse"},"ExperimentCreatedPopulation":{"properties":{"population_id":{"type":"string","format":"uuid","title":"Population Id"},"name":{"type":"string","title":"Name"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"workspace_name":{"type":"string","title":"Workspace Name"}},"type":"object","required":["population_id","name","workspace_id","workspace_name"],"title":"ExperimentCreatedPopulation"},"ExperimentDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"name":{"type":"string","title":"Name"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"population_id":{"type":"string","format":"uuid","title":"Population Id"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"type":{"type":"string","const":"ab_test","title":"Type"},"category":{"anyOf":[{"type":"string","enum":["creatives","messaging","products","websites"]},{"type":"null"}],"title":"Category"},"status":{"type":"string","enum":["draft","queued","running","completed","failed"],"title":"Status"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"insights":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Insights"},"demographic_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Demographic Filter"},"flow":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Flow"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"experiment_variants":{"items":{"$ref":"#/components/schemas/ExperimentVariantDetail"},"type":"array","title":"Experiment Variants"},"populations":{"anyOf":[{"$ref":"#/components/schemas/ExperimentPopulationRef"},{"type":"null"}]},"evaluations":{"items":{"$ref":"#/components/schemas/ExperimentEvaluationItem"},"type":"array","title":"Evaluations"},"persona_failures":{"items":{"$ref":"#/components/schemas/ExperimentPersonaFailureItem"},"type":"array","title":"Persona Failures"}},"type":"object","required":["id","experiment_id","name","owner_id","workspace_id","population_id","type","status","created_at","updated_at","experiment_variants","evaluations","persona_failures"],"title":"ExperimentDetail"},"ExperimentEvaluationItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"persona_id":{"type":"string","format":"uuid","title":"Persona Id"},"variant_id":{"type":"string","format":"uuid","title":"Variant Id"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"is_winner":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Winner"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","experiment_id","persona_id","variant_id","created_at"],"title":"ExperimentEvaluationItem"},"ExperimentFlowEdgeInput":{"properties":{"id":{"type":"string","minLength":1,"title":"Id"},"source":{"type":"string","minLength":1,"title":"Source"},"target":{"type":"string","minLength":1,"title":"Target"},"variant":{"type":"string","enum":["shared","A","B"],"title":"Variant"}},"additionalProperties":false,"type":"object","required":["id","source","target","variant"],"title":"ExperimentFlowEdgeInput"},"ExperimentFlowInput":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/ExperimentFlowNodeInput"},"type":"array","title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/ExperimentFlowEdgeInput"},"type":"array","title":"Edges"}},"additionalProperties":false,"type":"object","required":["nodes","edges"],"title":"ExperimentFlowInput"},"ExperimentFlowNodeInput":{"properties":{"id":{"type":"string","minLength":1,"title":"Id"},"name":{"type":"string","title":"Name"},"position":{"$ref":"#/components/schemas/ExperimentFlowPositionInput"},"isStart":{"type":"boolean","title":"Isstart","default":false},"isEnd":{"type":"boolean","title":"Isend","default":false},"attachment":{"anyOf":[{"$ref":"#/components/schemas/AssetAttachmentInput"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["id","name","position"],"title":"ExperimentFlowNodeInput"},"ExperimentFlowPositionInput":{"properties":{"x":{"type":"number","title":"X"},"y":{"type":"number","title":"Y"}},"additionalProperties":false,"type":"object","required":["x","y"],"title":"ExperimentFlowPositionInput"},"ExperimentListItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"name":{"type":"string","title":"Name"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"creator_label":{"type":"string","title":"Creator Label"},"is_creator":{"type":"boolean","title":"Is Creator"},"type":{"type":"string","const":"ab_test","title":"Type"},"category":{"anyOf":[{"type":"string","enum":["creatives","messaging","products","websites"]},{"type":"null"}],"title":"Category"},"status":{"type":"string","enum":["draft","queued","running","completed","failed"],"title":"Status"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"insights_verdict":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Insights Verdict"},"population_id":{"type":"string","format":"uuid","title":"Population Id"},"demographic_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Demographic Filter"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"populations":{"anyOf":[{"$ref":"#/components/schemas/ExperimentPopulationRef"},{"type":"null"}]},"experiment_variants":{"items":{"$ref":"#/components/schemas/ExperimentVariantSummary"},"type":"array","title":"Experiment Variants"}},"type":"object","required":["id","experiment_id","name","owner_id","creator_label","is_creator","type","status","population_id","created_at","updated_at","workspace_id","experiment_variants"],"title":"ExperimentListItem"},"ExperimentPersonaFailureItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"persona_id":{"type":"string","format":"uuid","title":"Persona Id"},"error_message":{"type":"string","title":"Error Message"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","experiment_id","persona_id","error_message","created_at"],"title":"ExperimentPersonaFailureItem"},"ExperimentPopulationRef":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"}},"type":"object","required":["id","name"],"title":"ExperimentPopulationRef"},"ExperimentVariantDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"position":{"type":"integer","title":"Position"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"headline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Headline"},"attachments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Attachments"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","position","experiment_id","attachments","created_at"],"title":"ExperimentVariantDetail"},"ExperimentVariantInput":{"properties":{"label":{"type":"string","minLength":1,"title":"Label"},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"title":"Color"},"headline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Headline"},"attachments":{"items":{"$ref":"#/components/schemas/AssetAttachmentInput"},"type":"array","title":"Attachments"}},"type":"object","required":["label"],"title":"ExperimentVariantInput"},"ExperimentVariantSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"position":{"type":"integer","title":"Position"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"}},"type":"object","required":["id","position"],"title":"ExperimentVariantSummary"},"FilePart":{"properties":{"type":{"type":"string","const":"file","title":"Type","default":"file"},"url":{"type":"string","title":"Url"},"mediaType":{"type":"string","title":"Mediatype"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"}},"type":"object","required":["url","mediaType"],"title":"FilePart"},"FrameEdit":{"properties":{"title":{"type":"string","maxLength":500,"title":"Title"},"business_problem":{"type":"string","maxLength":2000,"title":"Business Problem"},"action_standard":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Action Standard"},"context":{"type":"string","maxLength":2000,"title":"Context","default":""},"research_objectives":{"items":{"$ref":"#/components/schemas/ResearchObjective"},"type":"array","title":"Research Objectives"},"stimuli":{"items":{"oneOf":[{"$ref":"#/components/schemas/TextStimulus"},{"$ref":"#/components/schemas/ImageStimulus"}],"discriminator":{"propertyName":"kind","mapping":{"image":"#/components/schemas/ImageStimulus","text":"#/components/schemas/TextStimulus"}}},"type":"array","title":"Stimuli"},"stimulus_gap":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Stimulus Gap"},"section":{"type":"string","const":"frame","title":"Section"}},"additionalProperties":false,"type":"object","required":["title","business_problem","research_objectives","section"],"title":"FrameEdit","description":"The frame — idempotent full replace of title/problem/objectives/stimuli."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImageStimulus":{"properties":{"kind":{"type":"string","const":"image","title":"Kind"},"id":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Id","description":"Stable id: \"ST1\", \"ST2\", ..."},"label":{"type":"string","maxLength":500,"title":"Label"},"asset_id":{"type":"string","format":"uuid","title":"Asset Id"}},"type":"object","required":["kind","label","asset_id"],"title":"ImageStimulus"},"InviteMemberRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","enum":["admin","member"],"title":"Role","default":"member"}},"type":"object","required":["email"],"title":"InviteMemberRequest"},"LaunchExperimentResponse":{"properties":{"status":{"type":"string","const":"running","title":"Status"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["status","experiment_id","answer"],"title":"LaunchExperimentResponse"},"ListArchivedChatsResponse":{"properties":{"chats":{"items":{"$ref":"#/components/schemas/ArchivedChatListItem"},"type":"array","title":"Chats"}},"type":"object","required":["chats"],"title":"ListArchivedChatsResponse"},"ListChatsResponse":{"properties":{"chats":{"items":{"$ref":"#/components/schemas/Chat"},"type":"array","title":"Chats"}},"type":"object","required":["chats"],"title":"ListChatsResponse"},"ListExperimentsResponse":{"properties":{"status":{"type":"string","const":"completed","title":"Status"},"experiments":{"items":{"$ref":"#/components/schemas/ExperimentListItem"},"type":"array","title":"Experiments"}},"type":"object","required":["status","experiments"],"title":"ListExperimentsResponse"},"ListMcpTokensResponse":{"properties":{"mcp_tokens":{"items":{"$ref":"#/components/schemas/McpTokenSummary"},"type":"array","title":"Mcp Tokens"}},"type":"object","required":["mcp_tokens"],"title":"ListMcpTokensResponse"},"ListPopulationsResponse":{"properties":{"status":{"type":"string","const":"completed","title":"Status"},"populations":{"items":{"$ref":"#/components/schemas/WorkspacePopulationSummary"},"type":"array","title":"Populations"}},"type":"object","required":["status","populations"],"title":"ListPopulationsResponse"},"ListStudiesResponse":{"properties":{"studies":{"items":{"$ref":"#/components/schemas/StudyListItem"},"type":"array","title":"Studies"}},"type":"object","required":["studies"],"title":"ListStudiesResponse"},"ListWorkspacePersonasResponse":{"properties":{"status":{"type":"string","const":"completed","title":"Status"},"personas":{"items":{"$ref":"#/components/schemas/WorkspacePersonaSummary"},"type":"array","title":"Personas"}},"type":"object","required":["status","personas"],"title":"ListWorkspacePersonasResponse"},"ListWorkspacesResponse":{"properties":{"status":{"type":"string","const":"completed","title":"Status"},"workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceSummary"},"type":"array","title":"Workspaces"}},"type":"object","required":["status","workspaces"],"title":"ListWorkspacesResponse"},"McpTokenSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"token_prefix":{"type":"string","title":"Token Prefix"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","name","token_prefix","created_at"],"title":"McpTokenSummary","description":"A masked MCP token row; stored token hashes never cross this boundary."},"MediaAssetRef":{"properties":{"asset_id":{"type":"string","title":"Asset Id"},"storage_path":{"type":"string","title":"Storage Path"}},"type":"object","required":["asset_id","storage_path"],"title":"MediaAssetRef"},"MediaAssetsSweepRequest":{"properties":{"dry_run":{"type":"boolean","title":"Dry Run","default":true}},"type":"object","title":"MediaAssetsSweepRequest"},"MediaAssetsSweepResponse":{"properties":{"dry_run":{"type":"boolean","title":"Dry Run"},"candidates":{"items":{"$ref":"#/components/schemas/MediaAssetRef"},"type":"array","title":"Candidates"},"orphan_objects":{"items":{"type":"string"},"type":"array","title":"Orphan Objects"},"rows_without_objects":{"items":{"$ref":"#/components/schemas/MediaAssetRef"},"type":"array","title":"Rows Without Objects"},"deleted_asset_count":{"type":"integer","title":"Deleted Asset Count"},"skipped_candidate_count":{"type":"integer","title":"Skipped Candidate Count"},"deleted_orphan_count":{"type":"integer","title":"Deleted Orphan Count"}},"type":"object","required":["dry_run","candidates","orphan_objects","rows_without_objects","deleted_asset_count","skipped_candidate_count","deleted_orphan_count"],"title":"MediaAssetsSweepResponse"},"ModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/ChatModelInfo"},"type":"array","title":"Models"},"default_model_id":{"type":"string","title":"Default Model Id"}},"type":"object","required":["models","default_model_id"],"title":"ModelsResponse","description":"GET /chat/models: the switcher's allowlist, in display order."},"MultipleChoiceConfigInput":{"properties":{"allow_multiple":{"type":"boolean","title":"Allow Multiple","default":false},"options":{"items":{"$ref":"#/components/schemas/ChoiceOptionInput"},"type":"array","minItems":2,"title":"Options"}},"additionalProperties":false,"type":"object","required":["options"],"title":"MultipleChoiceConfigInput"},"MultipleChoiceQuestionInput":{"properties":{"type":{"type":"string","const":"multiple_choice","title":"Type"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]*$","title":"Key"},"question":{"type":"string","minLength":1,"title":"Question"},"asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"},"answer_config":{"$ref":"#/components/schemas/MultipleChoiceConfigInput"}},"additionalProperties":false,"type":"object","required":["type","key","question","answer_config"],"title":"MultipleChoiceQuestionInput"},"OfflineAnswerSnapshot":{"properties":{"question":{"type":"string","title":"Question"},"answer":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Answer"},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"}},"type":"object","required":["question","answer"],"title":"OfflineAnswerSnapshot"},"OpenEndedConfigInput":{"properties":{"format":{"type":"string","enum":["text","number"],"title":"Format"},"min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min"},"max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"}},"additionalProperties":false,"type":"object","required":["format"],"title":"OpenEndedConfigInput"},"OpenEndedQuestionInput":{"properties":{"type":{"type":"string","const":"open_ended","title":"Type"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]*$","title":"Key"},"question":{"type":"string","minLength":1,"title":"Question"},"asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"},"answer_config":{"$ref":"#/components/schemas/OpenEndedConfigInput"}},"additionalProperties":false,"type":"object","required":["type","key","question","answer_config"],"title":"OpenEndedQuestionInput"},"OpenItem":{"properties":{"section":{"type":"string","enum":["frame","survey_questions","qualitative_questions"],"title":"Section","description":"The stage this question belongs to — frame covers title/goal/objectives"},"question":{"type":"string","maxLength":500,"title":"Question"}},"type":"object","required":["section","question"],"title":"OpenItem","description":"One unresolved intake question, tagged with the stage it belongs to so\nthe audit can flag questions left open while later stages are drafted."},"OpenTextRespondent":{"properties":{"persona_id":{"type":"string","title":"Persona Id"},"name":{"type":"string","title":"Name"},"chips":{"items":{"type":"string"},"type":"array","title":"Chips"},"theme":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Theme"}},"type":"object","required":["persona_id","name","chips"],"title":"OpenTextRespondent"},"OpenTextSummary":{"properties":{"summary":{"type":"string","title":"Summary"},"answered":{"type":"integer","title":"Answered"},"themes":{"items":{"$ref":"#/components/schemas/OpenTextTheme"},"type":"array","title":"Themes"},"respondents":{"items":{"$ref":"#/components/schemas/OpenTextRespondent"},"type":"array","title":"Respondents"}},"type":"object","required":["summary","answered"],"title":"OpenTextSummary"},"OpenTextTheme":{"properties":{"label":{"type":"string","title":"Label"},"summary":{"type":"string","title":"Summary"},"count":{"type":"integer","title":"Count"},"share":{"type":"number","title":"Share"},"quote_persona_ids":{"items":{"type":"string"},"type":"array","title":"Quote Persona Ids"}},"type":"object","required":["label","summary","count","share","quote_persona_ids"],"title":"OpenTextTheme"},"PersonaCard":{"properties":{"persona_id":{"type":"string","title":"Persona Id"},"name":{"type":"string","title":"Name"},"attributes":{"additionalProperties":{"type":"string"},"type":"object","title":"Attributes"},"bio":{"type":"string","title":"Bio"},"topline":{"type":"string","title":"Topline"}},"type":"object","required":["persona_id","name","attributes","bio","topline"],"title":"PersonaCard","description":"Model-visible return AND the `data-respondentCard` payload: the\nidentity card that feeds the existing RespondentStatsCard UI shape.\ndescribe = facts ABOUT them; poll = their voice."},"PersonaEvalMetricSummary":{"properties":{"accuracy":{"type":"number","title":"Accuracy"},"exact_match_count":{"type":"integer","title":"Exact Match Count"},"mean_absolute_error":{"type":"number","title":"Mean Absolute Error"}},"type":"object","required":["accuracy","exact_match_count","mean_absolute_error"],"title":"PersonaEvalMetricSummary"},"PersonaEvalQuestion":{"properties":{"question_id":{"type":"string","title":"Question Id"},"question":{"type":"string","title":"Question"},"full_scale":{"type":"string","title":"Full Scale"},"real_answer":{"type":"integer","title":"Real Answer"}},"type":"object","required":["question_id","question","full_scale","real_answer"],"title":"PersonaEvalQuestion"},"PersonaEvalQuestionsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PersonaEvalQuestion"},"type":"array","title":"Items"},"skipped":{"items":{"$ref":"#/components/schemas/PersonaEvalSkippedQuestion"},"type":"array","title":"Skipped"}},"type":"object","title":"PersonaEvalQuestionsResponse"},"PersonaEvalResultRow":{"properties":{"question_id":{"type":"string","title":"Question Id"},"question":{"type":"string","title":"Question"},"real":{"type":"integer","title":"Real"},"generated":{"type":"integer","title":"Generated"},"abs_diff":{"type":"integer","title":"Abs Diff"},"rationale":{"type":"string","title":"Rationale"},"baseline_generated":{"type":"integer","title":"Baseline Generated"},"baseline_abs_diff":{"type":"integer","title":"Baseline Abs Diff"},"baseline_rationale":{"type":"string","title":"Baseline Rationale"}},"type":"object","required":["question_id","question","real","generated","abs_diff","rationale","baseline_generated","baseline_abs_diff","baseline_rationale"],"title":"PersonaEvalResultRow"},"PersonaEvalRunRequest":{"properties":{"question_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Question Ids"}},"additionalProperties":false,"type":"object","required":["question_ids"],"title":"PersonaEvalRunRequest"},"PersonaEvalRunResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PersonaEvalResultRow"},"type":"array","title":"Items"},"accuracy":{"type":"number","title":"Accuracy"},"exact_match_count":{"type":"integer","title":"Exact Match Count"},"mean_absolute_error":{"type":"number","title":"Mean Absolute Error"},"demographic_baseline":{"$ref":"#/components/schemas/PersonaEvalMetricSummary"}},"type":"object","required":["items","accuracy","exact_match_count","mean_absolute_error","demographic_baseline"],"title":"PersonaEvalRunResponse"},"PersonaEvalSkippedQuestion":{"properties":{"question_id":{"type":"string","title":"Question Id"},"source_index":{"type":"integer","title":"Source Index"},"reason":{"type":"string","title":"Reason"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"},"full_scale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Scale"},"answer":{"title":"Answer"}},"type":"object","required":["question_id","source_index","reason"],"title":"PersonaEvalSkippedQuestion"},"PersonaImportChunkDraft":{"properties":{"id":{"type":"string","title":"Id"},"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nodeid"},"interview":{"type":"string","title":"Interview"},"section":{"type":"string","title":"Section"},"questionType":{"type":"string","title":"Questiontype"},"question":{"type":"string","title":"Question"},"answer":{"type":"string","title":"Answer"},"flags":{"items":{"type":"string"},"type":"array","title":"Flags"}},"type":"object","required":["id","interview","section","questionType","question","answer"],"title":"PersonaImportChunkDraft"},"PersonaImportChunksRequest":{"properties":{"personaId":{"type":"string","format":"uuid","title":"Personaid"},"voiceInterviewId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Voiceinterviewid"},"chunks":{"items":{"$ref":"#/components/schemas/PersonaImportChunkDraft"},"type":"array","title":"Chunks"}},"type":"object","required":["personaId"],"title":"PersonaImportChunksRequest"},"PersonaImportChunksResponse":{"properties":{"item":{"$ref":"#/components/schemas/PersonaImportChunksResult"}},"type":"object","required":["item"],"title":"PersonaImportChunksResponse"},"PersonaImportChunksResult":{"properties":{"interviewId":{"type":"string","title":"Interviewid"},"chunkCount":{"type":"integer","title":"Chunkcount"},"voiceInterviewId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voiceinterviewid"},"reviewedQaPairCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reviewedqapaircount"}},"type":"object","required":["interviewId","chunkCount"],"title":"PersonaImportChunksResult"},"PersonaImportPersonaAttributes":{"properties":{"age_range":{"type":"string","enum":["18-24","25-34","35-44","45-54","55-64","65+","Unknown"],"title":"Age Range"},"sex":{"type":"string","title":"Sex"},"state":{"type":"string","title":"State"},"income":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Income"},"geographic_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geographic Region"},"race":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Race"},"customer_segment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Segment"},"ownership":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ownership"},"hometown":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hometown"},"lifeStage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifestage"},"goals":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goals"},"hobbies":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hobbies"}},"type":"object","required":["age_range","sex","state"],"title":"PersonaImportPersonaAttributes"},"PersonaImportPersonaDraft":{"properties":{"voiceInterviewId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Voiceinterviewid"},"firstName":{"type":"string","title":"Firstname"},"lastName":{"type":"string","title":"Lastname"},"bio":{"type":"string","title":"Bio"},"attributes":{"$ref":"#/components/schemas/PersonaImportPersonaAttributes"}},"type":"object","required":["firstName","lastName","bio","attributes"],"title":"PersonaImportPersonaDraft"},"PersonaImportPersonaRequest":{"properties":{"populationId":{"type":"string","format":"uuid","title":"Populationid"},"persona":{"$ref":"#/components/schemas/PersonaImportPersonaDraft"},"voiceInterviewId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Voiceinterviewid"}},"type":"object","required":["populationId","persona"],"title":"PersonaImportPersonaRequest"},"PersonaImportPersonaResponse":{"properties":{"item":{"$ref":"#/components/schemas/PersonaImportPersonaResult"}},"type":"object","required":["item"],"title":"PersonaImportPersonaResponse"},"PersonaImportPersonaResult":{"properties":{"personaId":{"type":"string","title":"Personaid"}},"type":"object","required":["personaId"],"title":"PersonaImportPersonaResult"},"PersonaPopulationContext":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"}},"type":"object","required":["id","name"],"title":"PersonaPopulationContext","description":"Display context for the population a persona summary belongs to."},"PersonaReplyChunk":{"properties":{"name":{"type":"string","const":"personaReply","title":"Name","default":"personaReply"},"payload":{"$ref":"#/components/schemas/PersonaReplyPayload"},"transient":{"type":"boolean","title":"Transient","default":false}},"type":"object","required":["payload"],"title":"PersonaReplyChunk"},"PersonaReplyPayload":{"properties":{"persona_id":{"type":"string","title":"Persona Id"},"name":{"type":"string","title":"Name"},"text":{"type":"string","title":"Text"},"scope":{"$ref":"#/components/schemas/Scope"},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id"}},"type":"object","required":["persona_id","name","text","scope"],"title":"PersonaReplyPayload","description":"The `data-personaReply` payload (persona bubble), scope of one."},"PopulationAccessItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"is_public":{"type":"boolean","title":"Is Public"},"created_at":{"type":"string","title":"Created At"},"grants":{"items":{"$ref":"#/components/schemas/PopulationWorkspaceGrant"},"type":"array","title":"Grants"}},"type":"object","required":["id","is_public","created_at","grants"],"title":"PopulationAccessItem"},"PopulationAccessItemResponse":{"properties":{"item":{"$ref":"#/components/schemas/PopulationAccessItem"}},"type":"object","required":["item"],"title":"PopulationAccessItemResponse"},"PopulationAccessListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PopulationAccessItem"},"type":"array","title":"Items"},"workspaces":{"items":{"$ref":"#/components/schemas/PopulationAccessWorkspaceOption"},"type":"array","title":"Workspaces"}},"type":"object","required":["items","workspaces"],"title":"PopulationAccessListResponse"},"PopulationAccessPolicyPatch":{"properties":{"is_public":{"type":"boolean","title":"Is Public"},"granted_workspace_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Granted Workspace Ids"}},"type":"object","required":["is_public","granted_workspace_ids"],"title":"PopulationAccessPolicyPatch"},"PopulationAccessWorkspaceOption":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["workspace_id","name"],"title":"PopulationAccessWorkspaceOption"},"PopulationClusters":{"properties":{"question":{"type":"string","title":"Question","default":""},"headline":{"type":"string","title":"Headline","default":""},"total":{"type":"integer","title":"Total","default":0},"codes":{"items":{"$ref":"#/components/schemas/ResponseClusterCode"},"type":"array","title":"Codes"}},"type":"object","title":"PopulationClusters"},"PopulationDetailItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"age_range":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Age Range"},"geography":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geography"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"is_public":{"type":"boolean","title":"Is Public"},"profile_sections":{"items":{"$ref":"#/components/schemas/ProfileSection"},"type":"array","title":"Profile Sections","default":[]},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","name","is_public","created_at","updated_at"],"title":"PopulationDetailItem"},"PopulationEvalComparisonOption":{"properties":{"mode":{"type":"string","enum":["auxos","baseline"],"title":"Mode"},"model_version":{"type":"string","title":"Model Version"},"label":{"type":"string","title":"Label"}},"type":"object","required":["mode","model_version","label"],"title":"PopulationEvalComparisonOption"},"PopulationEvalComparisonOptionsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PopulationEvalComparisonOption"},"type":"array","title":"Items"},"defaults":{"items":{"$ref":"#/components/schemas/PopulationEvalComparisonOption"},"type":"array","title":"Defaults"}},"type":"object","title":"PopulationEvalComparisonOptionsResponse"},"PopulationEvalComparisonRequest":{"properties":{"mode":{"type":"string","enum":["auxos","baseline"],"title":"Mode"},"model_version":{"type":"string","title":"Model Version"}},"additionalProperties":false,"type":"object","required":["mode","model_version"],"title":"PopulationEvalComparisonRequest"},"PopulationEvalDetailRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"run_id":{"type":"string","format":"uuid","title":"Run Id"},"population_id":{"type":"string","format":"uuid","title":"Population Id"},"persona_id":{"type":"string","format":"uuid","title":"Persona Id"},"persona_name":{"type":"string","title":"Persona Name"},"voice_interview_id":{"type":"string","format":"uuid","title":"Voice Interview Id"},"eval_question_id":{"type":"string","format":"uuid","title":"Eval Question Id"},"source_index":{"type":"integer","title":"Source Index"},"question_key":{"type":"string","title":"Question Key"},"question_text":{"type":"string","title":"Question Text"},"scale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scale"},"mode":{"type":"string","enum":["auxos","baseline"],"title":"Mode"},"model_version":{"type":"string","title":"Model Version"},"label":{"type":"string","title":"Label"},"status":{"type":"string","title":"Status"},"real_answer":{"type":"integer","title":"Real Answer"},"generated":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Generated"},"abs_diff":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Abs Diff"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","run_id","population_id","persona_id","persona_name","voice_interview_id","eval_question_id","source_index","question_key","question_text","mode","model_version","label","status","real_answer"],"title":"PopulationEvalDetailRow"},"PopulationEvalModelSummary":{"properties":{"mode":{"type":"string","enum":["auxos","baseline"],"title":"Mode"},"model_version":{"type":"string","title":"Model Version"},"label":{"type":"string","title":"Label"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"exact_match":{"type":"integer","title":"Exact Match"},"mean_absolute_error":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Absolute Error"},"answered":{"type":"integer","title":"Answered"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["mode","model_version","label","accuracy","exact_match","mean_absolute_error","answered","failed"],"title":"PopulationEvalModelSummary"},"PopulationEvalPersonaSummary":{"properties":{"persona_id":{"type":"string","format":"uuid","title":"Persona Id"},"persona_name":{"type":"string","title":"Persona Name"},"mode":{"type":"string","enum":["auxos","baseline"],"title":"Mode"},"model_version":{"type":"string","title":"Model Version"},"label":{"type":"string","title":"Label"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"exact_match":{"type":"integer","title":"Exact Match"},"mean_absolute_error":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Absolute Error"},"answered":{"type":"integer","title":"Answered"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["persona_id","persona_name","mode","model_version","label","accuracy","exact_match","mean_absolute_error","answered","failed"],"title":"PopulationEvalPersonaSummary"},"PopulationEvalPopulationOption":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"persona_count":{"type":"integer","title":"Persona Count"}},"type":"object","required":["id","name","persona_count"],"title":"PopulationEvalPopulationOption"},"PopulationEvalPopulationsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PopulationEvalPopulationOption"},"type":"array","title":"Items"}},"type":"object","title":"PopulationEvalPopulationsResponse"},"PopulationEvalQuestionSetOption":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"question_count":{"type":"integer","title":"Question Count"}},"type":"object","required":["id","name","question_count"],"title":"PopulationEvalQuestionSetOption"},"PopulationEvalQuestionSetsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PopulationEvalQuestionSetOption"},"type":"array","title":"Items"}},"type":"object","title":"PopulationEvalQuestionSetsResponse"},"PopulationEvalQuestionSummary":{"properties":{"eval_question_id":{"type":"string","format":"uuid","title":"Eval Question Id"},"question_key":{"type":"string","title":"Question Key"},"question_text":{"type":"string","title":"Question Text"},"mode":{"type":"string","enum":["auxos","baseline"],"title":"Mode"},"model_version":{"type":"string","title":"Model Version"},"label":{"type":"string","title":"Label"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"exact_match":{"type":"integer","title":"Exact Match"},"mean_absolute_error":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Absolute Error"},"answered":{"type":"integer","title":"Answered"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["eval_question_id","question_key","question_text","mode","model_version","label","accuracy","exact_match","mean_absolute_error","answered","failed"],"title":"PopulationEvalQuestionSummary"},"PopulationEvalRunDetailResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"population_id":{"type":"string","format":"uuid","title":"Population Id"},"population_name":{"type":"string","title":"Population Name"},"question_set_id":{"type":"string","format":"uuid","title":"Question Set Id"},"question_set_name":{"type":"string","title":"Question Set Name"},"status":{"type":"string","title":"Status"},"personas_total":{"type":"integer","title":"Personas Total"},"personas_evaluated":{"type":"integer","title":"Personas Evaluated"},"personas_done":{"type":"integer","title":"Personas Done"},"personas_skipped":{"type":"integer","title":"Personas Skipped"},"summary":{"additionalProperties":true,"type":"object","title":"Summary"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"overall_by_model":{"items":{"$ref":"#/components/schemas/PopulationEvalModelSummary"},"type":"array","title":"Overall By Model"},"by_persona":{"items":{"$ref":"#/components/schemas/PopulationEvalPersonaSummary"},"type":"array","title":"By Persona"},"by_question":{"items":{"$ref":"#/components/schemas/PopulationEvalQuestionSummary"},"type":"array","title":"By Question"},"detail_rows":{"items":{"$ref":"#/components/schemas/PopulationEvalDetailRow"},"type":"array","title":"Detail Rows"}},"type":"object","required":["id","population_id","population_name","question_set_id","question_set_name","status","personas_total","personas_evaluated","personas_done","personas_skipped"],"title":"PopulationEvalRunDetailResponse"},"PopulationEvalRunListItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"population_id":{"type":"string","format":"uuid","title":"Population Id"},"population_name":{"type":"string","title":"Population Name"},"question_set_id":{"type":"string","format":"uuid","title":"Question Set Id"},"question_set_name":{"type":"string","title":"Question Set Name"},"status":{"type":"string","title":"Status"},"personas_total":{"type":"integer","title":"Personas Total"},"personas_evaluated":{"type":"integer","title":"Personas Evaluated"},"personas_done":{"type":"integer","title":"Personas Done"},"personas_skipped":{"type":"integer","title":"Personas Skipped"},"summary":{"additionalProperties":true,"type":"object","title":"Summary"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["id","population_id","population_name","question_set_id","question_set_name","status","personas_total","personas_evaluated","personas_done","personas_skipped"],"title":"PopulationEvalRunListItem"},"PopulationEvalRunRequest":{"properties":{"population_id":{"type":"string","format":"uuid","title":"Population Id"},"question_set_id":{"type":"string","format":"uuid","title":"Question Set Id"},"model_comparisons":{"anyOf":[{"items":{"$ref":"#/components/schemas/PopulationEvalComparisonRequest"},"type":"array"},{"type":"null"}],"title":"Model Comparisons"}},"additionalProperties":false,"type":"object","required":["population_id","question_set_id"],"title":"PopulationEvalRunRequest"},"PopulationEvalRunStartResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"status":{"type":"string","title":"Status","default":"accepted"}},"type":"object","required":["run_id"],"title":"PopulationEvalRunStartResponse"},"PopulationEvalRunsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PopulationEvalRunListItem"},"type":"array","title":"Items"}},"type":"object","title":"PopulationEvalRunsResponse"},"PopulationFilterAttribute":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"values":{"items":{"type":"string"},"type":"array","title":"Values"}},"type":"object","required":["key","label","values"],"title":"PopulationFilterAttribute","description":"One filter dimension from ``populations.filter_attributes``."},"PopulationWorkspaceGrant":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"workspace_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Name"},"granted_at":{"type":"string","title":"Granted At"},"granted_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Granted By"}},"type":"object","required":["workspace_id","granted_at"],"title":"PopulationWorkspaceGrant"},"ProfileSection":{"properties":{"title":{"type":"string","title":"Title"},"fields":{"items":{"$ref":"#/components/schemas/ProfileTraitField"},"type":"array","title":"Fields"}},"type":"object","required":["title","fields"],"title":"ProfileSection","description":"A titled group of profile-trait rows from ``populations.profile_sections``;\narray order is display order."},"ProfileTraitField":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"}},"type":"object","required":["key","label"],"title":"ProfileTraitField","description":"One trait row on the List-view persona card and in persona prompt\nsections: a label and the ``personas.attributes`` key whose value it\nshows."},"ProgressToolOutput":{"properties":{"status":{"type":"string","enum":["done","skipped","error"],"title":"Status"},"summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Summary"}},"type":"object","required":["status"],"title":"ProgressToolOutput"},"ProgressToolPart":{"properties":{"type":{"type":"string","const":"dynamic-tool","title":"Type","default":"dynamic-tool"},"toolName":{"type":"string","title":"Toolname"},"toolCallId":{"type":"string","title":"Toolcallid"},"title":{"type":"string","title":"Title"},"providerExecuted":{"type":"boolean","const":true,"title":"Providerexecuted","default":true},"state":{"type":"string","const":"output-available","title":"State","default":"output-available"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"output":{"$ref":"#/components/schemas/ProgressToolOutput"}},"type":"object","required":["toolName","toolCallId","title","output"],"title":"ProgressToolPart"},"ProvenanceEntry":{"properties":{"field":{"type":"string","maxLength":500,"title":"Field"},"source":{"type":"string","enum":["assumed","user_provided","probed_confirmed"],"title":"Source"}},"type":"object","required":["field","source"],"title":"ProvenanceEntry","description":"Provenance per slot — an array of pairs, not a mapping (donor choice:\nrecords convert to JSON-Schema `additionalProperties`, which some\nproviders handle poorly in tool schemas)."},"QualitativeQuestion":{"properties":{"id":{"type":"string","maxLength":500,"title":"Id","description":"Stable id: \"Q1\", \"Q2\", ..."},"text":{"type":"string","maxLength":500,"title":"Text","description":"Phrased first-person, addressed to a respondent"},"feeds":{"items":{"type":"string","maxLength":500},"type":"array","title":"Feeds","description":"Research objective ids this feeds — must list at least one (audited)"},"stimulus":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Stimulus","description":"Stimulus id this question shows — the stimulus renders in this question's prompt only"}},"type":"object","required":["id","text","feeds"],"title":"QualitativeQuestion"},"QualitativeQuestionsEdit":{"properties":{"qualitative_questions":{"items":{"$ref":"#/components/schemas/QualitativeQuestion"},"type":"array","title":"Qualitative Questions"},"section":{"type":"string","const":"qualitative_questions","title":"Section"}},"additionalProperties":false,"type":"object","required":["qualitative_questions","section"],"title":"QualitativeQuestionsEdit"},"RankingConfigInput":{"properties":{"options":{"items":{"$ref":"#/components/schemas/RankingOptionInput"},"type":"array","maxItems":4,"minItems":2,"title":"Options"}},"additionalProperties":false,"type":"object","required":["options"],"title":"RankingConfigInput"},"RankingOptionInput":{"properties":{"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"}},"additionalProperties":false,"type":"object","title":"RankingOptionInput"},"RankingQuestionInput":{"properties":{"type":{"type":"string","const":"ranking","title":"Type"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]*$","title":"Key"},"question":{"type":"string","minLength":1,"title":"Question"},"asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"},"answer_config":{"$ref":"#/components/schemas/RankingConfigInput"}},"additionalProperties":false,"type":"object","required":["type","key","question","answer_config"],"title":"RankingQuestionInput"},"RationaleConceptSummary":{"properties":{"options":{"additionalProperties":{"items":{"$ref":"#/components/schemas/RationaleTheme"},"type":"array"},"type":"object","title":"Options"},"segments":{"items":{"$ref":"#/components/schemas/RationaleSegmentSummary"},"type":"array","title":"Segments"},"open_text":{"anyOf":[{"$ref":"#/components/schemas/OpenTextSummary"},{"type":"null"}]}},"type":"object","title":"RationaleConceptSummary"},"RationaleSegmentSummary":{"properties":{"label":{"type":"string","title":"Label"},"min":{"type":"integer","title":"Min"},"max":{"type":"integer","title":"Max"},"themes":{"items":{"$ref":"#/components/schemas/RationaleTheme"},"type":"array","title":"Themes"}},"type":"object","required":["label","min","max","themes"],"title":"RationaleSegmentSummary","description":"Themes for one scale segment (a fixed third of the answer range)."},"RationaleSummary":{"properties":{"by_concept":{"additionalProperties":{"$ref":"#/components/schemas/RationaleConceptSummary"},"type":"object","title":"By Concept"}},"type":"object","title":"RationaleSummary"},"RationaleTheme":{"properties":{"label":{"type":"string","title":"Label"},"summary":{"type":"string","title":"Summary"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["label","summary","count"],"title":"RationaleTheme"},"ReadArchivedChatResponse":{"properties":{"chat":{"$ref":"#/components/schemas/ArchivedChat"},"messages":{"items":{"$ref":"#/components/schemas/ArchivedChatMessage"},"type":"array","title":"Messages"}},"type":"object","required":["chat","messages"],"title":"ReadArchivedChatResponse"},"ReadExperimentResponse":{"properties":{"status":{"type":"string","const":"completed","title":"Status"},"experiment":{"$ref":"#/components/schemas/ExperimentDetail"}},"type":"object","required":["status","experiment"],"title":"ReadExperimentResponse"},"ReadPopulationResponse":{"properties":{"status":{"type":"string","const":"completed","title":"Status"},"population":{"$ref":"#/components/schemas/PopulationDetailItem"}},"type":"object","required":["status","population"],"title":"ReadPopulationResponse"},"ReasoningFlushEvent":{"properties":{"turn_id":{"type":"string","format":"uuid","title":"Turn Id"},"seq":{"type":"integer","title":"Seq"},"created_at":{"type":"string","title":"Created At"},"type":{"type":"string","const":"reasoning.flush","title":"Type"},"payload":{"$ref":"#/components/schemas/TextFlushPayload"}},"type":"object","required":["turn_id","seq","created_at","type","payload"],"title":"ReasoningFlushEvent"},"RemoveWorkspaceMemberResponse":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok"},"member_user_id":{"type":"string","title":"Member User Id"}},"type":"object","required":["ok","member_user_id"],"title":"RemoveWorkspaceMemberResponse"},"RenameStudyPayload":{"properties":{"title":{"type":"string","maxLength":500,"minLength":1,"title":"Title"}},"type":"object","required":["title"],"title":"RenameStudyPayload","description":"Member-level title rename — the only saved-brief mutation."},"RenameWorkspaceRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"RenameWorkspaceRequest"},"ResearchObjective":{"properties":{"id":{"type":"string","maxLength":500,"title":"Id","description":"Stable id: \"R1\", \"R2\", ..."},"objective":{"type":"string","maxLength":2000,"title":"Objective","description":"What we must learn — often phrased as a question"},"why_it_matters":{"type":"string","maxLength":2000,"title":"Why It Matters"}},"type":"object","required":["id","objective","why_it_matters"],"title":"ResearchObjective"},"RespondentCardChunk":{"properties":{"name":{"type":"string","const":"respondentCard","title":"Name","default":"respondentCard"},"payload":{"$ref":"#/components/schemas/PersonaCard"},"transient":{"type":"boolean","title":"Transient","default":false}},"type":"object","required":["payload"],"title":"RespondentCardChunk"},"ResponseClusterCode":{"properties":{"id":{"type":"string","title":"Id","default":""},"title":{"type":"string","title":"Title","default":""},"summary":{"type":"string","title":"Summary","default":""},"count":{"type":"integer","title":"Count","default":0},"share":{"type":"number","title":"Share","default":0.0},"primary_count":{"type":"integer","title":"Primary Count","default":0},"sentiment":{"type":"string","enum":["positive","neutral","mixed","negative"],"title":"Sentiment","default":"mixed"},"member_persona_ids":{"items":{"type":"string"},"type":"array","title":"Member Persona Ids"},"primary_persona_ids":{"items":{"type":"string"},"type":"array","title":"Primary Persona Ids"},"skew":{"items":{"$ref":"#/components/schemas/ResponseClusterSkew"},"type":"array","title":"Skew"},"quotes":{"items":{"$ref":"#/components/schemas/ResponseClusterQuote"},"type":"array","title":"Quotes"},"examples":{"items":{"$ref":"#/components/schemas/ResponseClusterExample"},"type":"array","title":"Examples"}},"type":"object","title":"ResponseClusterCode"},"ResponseClusterExample":{"properties":{"persona_id":{"type":"string","title":"Persona Id","default":""},"persona":{"type":"string","title":"Persona","default":""},"text":{"type":"string","title":"Text","default":""}},"type":"object","title":"ResponseClusterExample"},"ResponseClusterQuote":{"properties":{"persona":{"type":"string","title":"Persona","default":""},"text":{"type":"string","title":"Text","default":""}},"type":"object","title":"ResponseClusterQuote"},"ResponseClusterSkew":{"properties":{"group":{"type":"string","title":"Group","default":""},"label":{"type":"string","title":"Label","default":""},"share":{"type":"number","title":"Share","default":0.0}},"type":"object","title":"ResponseClusterSkew"},"ResponseClustersChunk":{"properties":{"name":{"type":"string","const":"responseClusters","title":"Name","default":"responseClusters"},"payload":{"$ref":"#/components/schemas/ResponseClustersPayload"},"transient":{"type":"boolean","title":"Transient","default":false}},"type":"object","required":["payload"],"title":"ResponseClustersChunk"},"ResponseClustersPart":{"properties":{"type":{"type":"string","const":"data-responseClusters","title":"Type","default":"data-responseClusters"},"data":{"$ref":"#/components/schemas/PopulationClusters"}},"type":"object","required":["data"],"title":"ResponseClustersPart"},"ResponseClustersPayload":{"properties":{"question":{"type":"string","title":"Question"},"headline":{"type":"string","title":"Headline"},"total":{"type":"integer","minimum":0.0,"title":"Total"},"codes":{"items":{"$ref":"#/components/schemas/ChatResponseClusterCode"},"type":"array","title":"Codes"}},"type":"object","required":["question","headline","total","codes"],"title":"ResponseClustersPayload"},"ScaleConfigInput":{"properties":{"min":{"type":"integer","title":"Min"},"max":{"type":"integer","title":"Max"},"min_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Min Label"},"max_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Max Label"},"scoring":{"anyOf":[{"type":"string","const":"semantic_similarity"},{"type":"null"}],"title":"Scoring"},"ssr":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ssr"}},"additionalProperties":false,"type":"object","required":["min","max"],"title":"ScaleConfigInput"},"ScaleQuestionInput":{"properties":{"type":{"type":"string","const":"scale","title":"Type"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]*$","title":"Key"},"question":{"type":"string","minLength":1,"title":"Question"},"asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"},"answer_config":{"$ref":"#/components/schemas/ScaleConfigInput"}},"additionalProperties":false,"type":"object","required":["type","key","question","answer_config"],"title":"ScaleQuestionInput"},"ScaleSpec":{"properties":{"min":{"type":"integer","title":"Min"},"max":{"type":"integer","title":"Max"},"min_label":{"type":"string","maxLength":500,"title":"Min Label"},"max_label":{"type":"string","maxLength":500,"title":"Max Label"}},"type":"object","required":["min","max","min_label","max_label"],"title":"ScaleSpec","description":"Mirrors the engine's `ScaleConfigInput` bounds exactly (`min`/`max`, not a\npoint count), so `questions.py#_survey_config` passes them straight through.\nA count would have to be turned back into bounds somewhere, and that\narithmetic is the kind of thing that silently pins every scale to 1."},"Scope":{"properties":{"kind":{"type":"string","enum":["cohort","persona"],"title":"Kind"},"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"},"cohort_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Id"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"filter":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Filter"}},"type":"object","required":["kind","label","count"],"title":"Scope","description":"One shape for scope chips and persona bubbles: who an answer came\nfrom. `count` is the number of personas who actually ANSWERED, never a\ntarget size (Contracts § Scope, normative rule)."},"SendChatUserMessage":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"text":{"type":"string","title":"Text","default":""},"attachments":{"items":{"$ref":"#/components/schemas/ChatImageAttachment"},"type":"array","maxItems":8,"title":"Attachments"}},"additionalProperties":false,"type":"object","title":"SendChatUserMessage"},"SendMessageRequest":{"properties":{"message":{"$ref":"#/components/schemas/SendChatUserMessage"},"population_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Population Id"},"persona_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Persona Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"chat_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Name"},"demographic_filter":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Demographic Filter"},"stream":{"type":"boolean","title":"Stream","default":true}},"additionalProperties":false,"type":"object","required":["message"],"title":"SendMessageRequest"},"SendMessageResponse":{"properties":{"status":{"type":"string","const":"completed","title":"Status"},"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"message":{"$ref":"#/components/schemas/ArchivedChatMessage"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["status","chat_id","message","answer"],"title":"SendMessageResponse"},"StartRequest":{"properties":{"id":{"type":"string","title":"Id"},"study":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study"}},"type":"object","required":["id"],"title":"StartRequest"},"StartResponse":{"properties":{"signed_url":{"type":"string","title":"Signed Url"},"completion_code":{"type":"string","title":"Completion Code"}},"type":"object","required":["signed_url","completion_code"],"title":"StartResponse"},"StartTurnRequest":{"properties":{"message":{"anyOf":[{"$ref":"#/components/schemas/UserMessageInput"},{"type":"null"}]},"tool_results":{"anyOf":[{"items":{"$ref":"#/components/schemas/AskUserToolResult"},"type":"array","maxItems":4,"minItems":1},{"type":"null"}],"title":"Tool Results"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"displayed_study":{"anyOf":[{"$ref":"#/components/schemas/DisplayedStudyInput"},{"type":"null"}]},"thinking_level":{"type":"string","enum":["low","medium","high"],"title":"Thinking Level","default":"medium"}},"additionalProperties":false,"type":"object","title":"StartTurnRequest","description":"POST /turns body (typed, never a Vercel-protocol body — U1 findings §\nWriter construction). A two-arm union (chat-v2 Decision 25): exactly one\nof `message` (a normal send) or `tool_results` (resume a paused ask_user\nturn — inserts NO user message). No per-send `demographic_filter`\n(chat-v2 Decision 27): filters exist only inside tool calls, validated\nfail-closed there — `extra=\"forbid\"` makes an old client's filter a loud\n422. `displayed_study` is an optional, ephemeral focus hint for either\narm; it is not part of the message or stored chat state."},"StimulusAssetInfo":{"properties":{"url":{"type":"string","title":"Url"},"width":{"type":"integer","title":"Width"},"height":{"type":"integer","title":"Height"}},"type":"object","required":["url","width","height"],"title":"StimulusAssetInfo","description":"One resolved image-stimulus asset (study-question-stimuli U6): the\nread decoration that keeps the frontend from ever building storage URLs.\nWidth/height ride along because remote `next/image` sources need numbers\n(`media_assets.width`/`height` are NOT NULL)."},"StudyDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","enum":["approved","running","reporting","completed","failed","canceled"],"title":"Status"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"brief":{"$ref":"#/components/schemas/Brief"},"issues":{"items":{"$ref":"#/components/schemas/AuditIssue"},"type":"array","title":"Issues"},"next_step":{"type":"string","title":"Next Step"},"approved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved At"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"sample_plan":{"anyOf":[{"$ref":"#/components/schemas/StudySamplePlan"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"expected_response_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Response Count"},"response_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Response Count"},"failure_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failure Count"},"question_progress":{"anyOf":[{"items":{"$ref":"#/components/schemas/StudyQuestionProgress"},"type":"array"},{"type":"null"}],"title":"Question Progress"},"results":{"anyOf":[{"items":{"$ref":"#/components/schemas/StudyQuestionResult"},"type":"array"},{"type":"null"}],"title":"Results"},"report_markdown":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Markdown"},"failure_reason":{"anyOf":[{"type":"string","enum":["below_success_gate","canceled","stranded","internal_error"]},{"type":"null"}],"title":"Failure Reason"},"population_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Population Id"},"population_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Population Name"},"cohort_filter":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Cohort Filter"},"can_run":{"type":"boolean","title":"Can Run"},"can_cancel":{"type":"boolean","title":"Can Cancel"},"can_delete":{"type":"boolean","title":"Can Delete"},"stimulus_assets":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/StimulusAssetInfo"},"type":"object"},{"type":"null"}],"title":"Stimulus Assets"}},"type":"object","required":["id","status","title","brief","issues","next_step","approved_at","created_at","updated_at","can_run","can_cancel","can_delete"],"title":"StudyDetail","description":"One immutable saved study, addressed by its study ID.\n\nDeliberately FLAT (A6's shape, extended in place — no reshape): every\npipeline field is optional and absent until the lifecycle reaches it, so\none model serves the canvas read, the 2 s pipeline poll, and the Report\ntab. Payload posture under the poll: `results` is bounded by the brief's\nquestion caps and `results.py`'s byte cap."},"StudyDraftDetail":{"properties":{"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"status":{"type":"string","enum":["draft","ready"],"title":"Status"},"brief":{"$ref":"#/components/schemas/Brief"},"issues":{"items":{"$ref":"#/components/schemas/AuditIssue"},"type":"array","title":"Issues"},"next_step":{"type":"string","title":"Next Step"},"sample_plan":{"anyOf":[{"$ref":"#/components/schemas/StudySamplePlan"},{"type":"null"}]},"updated_at":{"type":"string","title":"Updated At"},"stimulus_assets":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/StimulusAssetInfo"},"type":"object"},{"type":"null"}],"title":"Stimulus Assets"}},"type":"object","required":["chat_id","status","brief","issues","next_step","updated_at"],"title":"StudyDraftDetail","description":"The chat-owned authoring document. It has no study identity."},"StudyListItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"creator_label":{"type":"string","title":"Creator Label"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","enum":["approved","running","reporting","completed","failed","canceled"],"title":"Status"},"updated_at":{"type":"string","title":"Updated At"},"can_rename":{"type":"boolean","title":"Can Rename"},"can_delete":{"type":"boolean","title":"Can Delete"}},"type":"object","required":["id","owner_id","creator_label","title","status","updated_at","can_rename","can_delete"],"title":"StudyListItem","description":"One saved-study list row. `title` is the display-title column; None\nuses the frontend's generic label."},"StudyQuestionProgress":{"properties":{"question_id":{"type":"string","title":"Question Id"},"response_count":{"type":"integer","title":"Response Count"},"failure_count":{"type":"integer","title":"Failure Count"}},"type":"object","required":["question_id","response_count","failure_count"],"title":"StudyQuestionProgress","description":"One question's landed counts during the run — the poller's per-question\nprogress row. Only questions that landed something appear."},"StudyQuestionResult":{"properties":{"id":{"type":"string","title":"Id"},"text":{"type":"string","title":"Text"},"type":{"type":"string","enum":["multiple_choice","scale","open_ended","qualitative"],"title":"Type"},"response_count":{"type":"integer","title":"Response Count"},"failure_count":{"type":"integer","title":"Failure Count"},"aggregate":{"anyOf":[{"$ref":"#/components/schemas/StudyResultAggregate"},{"type":"null"}]},"rationales":{"items":{"type":"string"},"type":"array","title":"Rationales"},"themes":{"items":{"$ref":"#/components/schemas/StudyResultTheme"},"type":"array","title":"Themes"},"verbatims":{"items":{"$ref":"#/components/schemas/StudyResultVerbatim"},"type":"array","title":"Verbatims"},"verbatims_omitted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verbatims Omitted"}},"type":"object","required":["id","text","type","response_count","failure_count"],"title":"StudyQuestionResult","description":"One question's landed result data (`results.py#build_report_results`) —\nthe Report tab's payload. The report prose is grounded in analysis slices\nbuilt over the SAME stored rows with the SAME counts/aggregates, so the tab\nand the prose can never cite different numbers.\nChoice/scale questions carry `aggregate` + `rationales`; free-text and\nqualitative questions carry `themes` + `verbatims`."},"StudyResultAggregate":{"properties":{"response_count":{"type":"integer","title":"Response Count"},"average_number":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Number"},"numeric_percentiles":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Numeric Percentiles"},"number_distribution":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Number Distribution"},"choice_counts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Choice Counts"}},"type":"object","required":["response_count"],"title":"StudyResultAggregate","description":"A choice/scale question's rollup (`results.py#question_aggregate`).\nThe three list arms stay loosely typed exactly like the survey product's\n`SurveyConceptRollup` — same math, same wire shape."},"StudyResultExample":{"properties":{"persona":{"type":"string","title":"Persona"},"text":{"type":"string","title":"Text"}},"type":"object","required":["persona","text"],"title":"StudyResultExample"},"StudyResultTheme":{"properties":{"title":{"type":"string","title":"Title"},"summary":{"type":"string","title":"Summary"},"count":{"type":"integer","title":"Count"},"share":{"type":"number","title":"Share"},"example_answers":{"items":{"$ref":"#/components/schemas/StudyResultExample"},"type":"array","title":"Example Answers"}},"type":"object","required":["title","summary","count","share"],"title":"StudyResultTheme","description":"One stored `OpenTextSummary` theme as the report cites it. No sentiment\nand no interview quotes (results.py's documented divergence); the example\nanswers are answers given in THIS study."},"StudyResultVerbatim":{"properties":{"persona":{"type":"string","title":"Persona"},"answer":{"type":"string","title":"Answer"},"theme":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Theme"}},"type":"object","required":["persona","answer"],"title":"StudyResultVerbatim","description":"One free-text answer with its STORED theme assignment. `theme` is an\nindex into the question's `themes` list (None when the respondent was left\nunassigned or the cell never themed), sourced from the persisted\n`OpenTextSummary.respondents` — shipped so the results tab's chip filter\npartitions answers by the same assignment the theme counts were computed\nfrom, never a client-side reconstruction."},"StudySamplePlan":{"properties":{"planned_personas":{"type":"integer","title":"Planned Personas"},"population_size":{"type":"integer","title":"Population Size"},"question_count":{"type":"integer","title":"Question Count"}},"type":"object","required":["planned_personas","population_size","question_count"],"title":"StudySamplePlan","description":"What a run WOULD field, computed on read while the study is still\npre-run (`draft`/`ready`/`approved`) — the numbers C8's confirm dialog\nrestates, so no client does this math. `planned_personas` is the capped\ncohort-filtered count (`STUDY_MAX_PERSONAS`), `population_size` the\npopulation's whole persona count, `question_count` the brief's survey +\nqualitative questions (one fielded question each)."},"SubmitAnswersRequest":{"properties":{"answers":{"additionalProperties":{"$ref":"#/components/schemas/OfflineAnswerSnapshot"},"type":"object","title":"Answers"},"study":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study"},"prolific_pid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prolific Pid"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","required":["answers"],"title":"SubmitAnswersRequest"},"SubmitAnswersResponse":{"properties":{"id":{"type":"string","title":"Id"}},"type":"object","required":["id"],"title":"SubmitAnswersResponse"},"SupportErrorResponse":{"properties":{"error":{"type":"string","title":"Error"},"code":{"type":"string","enum":["unauthenticated","worker_unreachable"],"title":"Code"}},"type":"object","required":["error","code"],"title":"SupportErrorResponse"},"SupportMessageRequest":{"properties":{"submission_id":{"type":"string","format":"uuid","title":"Submission Id"},"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message","description":"Plain-text support message; the 5,000-unit maximum is measured in UTF-16 code units to match browser maxlength.","x-length-unit":"utf-16-code-unit"}},"type":"object","required":["submission_id","message"],"title":"SupportMessageRequest"},"SupportMessageResponse":{"properties":{"status":{"type":"string","const":"sent","title":"Status"}},"type":"object","required":["status"],"title":"SupportMessageResponse"},"SurveyConceptDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"survey_id":{"type":"string","format":"uuid","title":"Survey Id"},"section_id":{"type":"string","format":"uuid","title":"Section Id"},"position":{"type":"integer","title":"Position"},"name":{"type":"string","title":"Name"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","survey_id","section_id","position","name","created_at","updated_at"],"title":"SurveyConceptDetail"},"SurveyConceptInput":{"properties":{"name":{"type":"string","minLength":1,"title":"Name"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"}},"additionalProperties":false,"type":"object","required":["name"],"title":"SurveyConceptInput"},"SurveyConceptRollup":{"properties":{"conceptId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Conceptid"},"conceptName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conceptname"},"responseCount":{"type":"integer","title":"Responsecount"},"averageNumber":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Averagenumber"},"numericPercentiles":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Numericpercentiles"},"numberDistribution":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Numberdistribution"},"choiceCounts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Choicecounts"},"textAnswers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Textanswers"},"rankingOptions":{"items":{"$ref":"#/components/schemas/SurveyRankingOption"},"type":"array","title":"Rankingoptions"}},"type":"object","required":["responseCount"],"title":"SurveyConceptRollup"},"SurveyCreateRequest":{"properties":{"populationId":{"type":"string","format":"uuid","title":"Populationid"},"name":{"type":"string","minLength":1,"title":"Name"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"demographicFilter":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Demographicfilter"},"sections":{"items":{"$ref":"#/components/schemas/SurveySectionInput"},"type":"array","minItems":1,"title":"Sections"}},"additionalProperties":false,"type":"object","required":["populationId","name","sections"],"title":"SurveyCreateRequest"},"SurveyDeleteResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"survey_id":{"type":"string","title":"Survey Id"}},"type":"object","required":["ok","survey_id"],"title":"SurveyDeleteResponse"},"SurveyDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"population_id":{"type":"string","format":"uuid","title":"Population Id"},"name":{"type":"string","title":"Name"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"status":{"type":"string","enum":["draft","running","completed","failed"],"title":"Status"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"demographic_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Demographic Filter"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"populations":{"anyOf":[{"$ref":"#/components/schemas/SurveyPopulationRef"},{"type":"null"}]},"survey_sections":{"items":{"$ref":"#/components/schemas/SurveySectionDetail"},"type":"array","title":"Survey Sections"},"survey_responses":{"items":{"$ref":"#/components/schemas/SurveyResponseDetail"},"type":"array","title":"Survey Responses"},"survey_persona_failures":{"items":{"$ref":"#/components/schemas/SurveyPersonaFailureDetail"},"type":"array","title":"Survey Persona Failures"},"response_count":{"type":"integer","title":"Response Count"},"expected_response_count":{"type":"integer","title":"Expected Response Count"},"persona_count":{"type":"integer","title":"Persona Count"},"failure_count":{"type":"integer","title":"Failure Count"},"rationale_summary_total":{"type":"integer","title":"Rationale Summary Total"},"rationale_summary_done":{"type":"integer","title":"Rationale Summary Done"},"rollups":{"items":{"$ref":"#/components/schemas/SurveyQuestionRollup"},"type":"array","title":"Rollups"},"can_write":{"type":"boolean","title":"Can Write"}},"type":"object","required":["id","owner_id","workspace_id","population_id","name","status","created_at","updated_at","survey_sections","survey_responses","survey_persona_failures","response_count","expected_response_count","persona_count","failure_count","rationale_summary_total","rationale_summary_done","rollups","can_write"],"title":"SurveyDetail"},"SurveyIdResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"}},"type":"object","required":["id"],"title":"SurveyIdResponse"},"SurveyListItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"creatorLabel":{"type":"string","title":"Creatorlabel"},"name":{"type":"string","title":"Name"},"populationId":{"type":"string","format":"uuid","title":"Populationid"},"populationName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Populationname"},"demographicFilter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Demographicfilter"},"status":{"type":"string","enum":["draft","running","completed","failed"],"title":"Status"},"responseCount":{"type":"integer","title":"Responsecount"},"expectedResponseCount":{"type":"integer","title":"Expectedresponsecount"},"createdAt":{"type":"string","title":"Createdat"},"canWrite":{"type":"boolean","title":"Canwrite"}},"type":"object","required":["id","owner_id","creatorLabel","name","populationId","status","responseCount","expectedResponseCount","createdAt","canWrite"],"title":"SurveyListItem"},"SurveyListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SurveyListItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"SurveyListResponse"},"SurveyPersonaFailureDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"survey_id":{"type":"string","format":"uuid","title":"Survey Id"},"section_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Section Id"},"question_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Question Id"},"concept_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Concept Id"},"persona_id":{"type":"string","format":"uuid","title":"Persona Id"},"error_message":{"type":"string","title":"Error Message"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","survey_id","persona_id","error_message","created_at"],"title":"SurveyPersonaFailureDetail"},"SurveyPopulationRef":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"}},"type":"object","required":["id","name"],"title":"SurveyPopulationRef"},"SurveyQuestion":{"properties":{"id":{"type":"string","maxLength":500,"title":"Id","description":"Stable id: \"S1\", \"S2\", ..."},"text":{"type":"string","maxLength":500,"title":"Text"},"type":{"type":"string","enum":["multiple_choice","scale","open_ended"],"title":"Type"},"options":{"anyOf":[{"items":{"type":"string","maxLength":500},"type":"array"},{"type":"null"}],"title":"Options","description":"Required for multiple_choice; exhaustive, ends with Other"},"allow_multiple":{"type":"boolean","title":"Allow Multiple","description":"multiple_choice only: may a respondent pick more than one option. Single-select is the common case, so it is the default","default":false},"scale":{"anyOf":[{"$ref":"#/components/schemas/ScaleSpec"},{"type":"null"}],"description":"Required for scale questions: bounds + labeled anchors"},"feeds":{"items":{"type":"string","maxLength":500},"type":"array","title":"Feeds","description":"Research objective ids this feeds — must list at least one (audited)"},"stimulus":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Stimulus","description":"Stimulus id this question shows — the stimulus renders in this question's prompt only"},"rationale":{"type":"string","maxLength":2000,"title":"Rationale"}},"type":"object","required":["id","text","type","feeds","rationale"],"title":"SurveyQuestion"},"SurveyQuestionDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"survey_id":{"type":"string","format":"uuid","title":"Survey Id"},"section_id":{"type":"string","format":"uuid","title":"Section Id"},"position":{"type":"integer","title":"Position"},"key":{"type":"string","title":"Key"},"type":{"type":"string","enum":["open_ended","multiple_choice","scale","ranking"],"title":"Type"},"question":{"type":"string","title":"Question"},"asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"answer_config":{"additionalProperties":true,"type":"object","title":"Answer Config"},"rationale_summary":{"anyOf":[{"$ref":"#/components/schemas/RationaleSummary"},{"type":"null"}]},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","survey_id","section_id","position","key","type","question","answer_config","created_at","updated_at"],"title":"SurveyQuestionDetail"},"SurveyQuestionRollup":{"properties":{"questionId":{"type":"string","format":"uuid","title":"Questionid"},"questionKey":{"type":"string","title":"Questionkey"},"type":{"type":"string","enum":["open_ended","multiple_choice","scale","ranking"],"title":"Type"},"answerConfig":{"additionalProperties":true,"type":"object","title":"Answerconfig"},"concepts":{"items":{"$ref":"#/components/schemas/SurveyConceptRollup"},"type":"array","title":"Concepts"}},"type":"object","required":["questionId","questionKey","type","answerConfig","concepts"],"title":"SurveyQuestionRollup"},"SurveyQuestionsEdit":{"properties":{"survey_questions":{"items":{"$ref":"#/components/schemas/SurveyQuestion"},"type":"array","title":"Survey Questions"},"section":{"type":"string","const":"survey_questions","title":"Section"}},"additionalProperties":false,"type":"object","required":["survey_questions","section"],"title":"SurveyQuestionsEdit"},"SurveyRankingOption":{"properties":{"ref":{"type":"string","title":"Ref"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"assetId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assetid"},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imageurl"},"distribution":{"items":{"type":"integer"},"type":"array","title":"Distribution"},"top1Count":{"type":"integer","title":"Top1Count"},"meanRank":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Meanrank"},"responseCount":{"type":"integer","title":"Responsecount"},"rationaleCount":{"type":"integer","title":"Rationalecount"}},"type":"object","required":["ref","distribution","top1Count","responseCount","rationaleCount"],"title":"SurveyRankingOption"},"SurveyReadResponse":{"properties":{"survey":{"$ref":"#/components/schemas/SurveyDetail"}},"type":"object","required":["survey"],"title":"SurveyReadResponse"},"SurveyReservationRequest":{"properties":{"populationId":{"type":"string","format":"uuid","title":"Populationid"},"name":{"type":"string","minLength":1,"title":"Name"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"demographicFilter":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Demographicfilter"}},"additionalProperties":false,"type":"object","required":["populationId","name"],"title":"SurveyReservationRequest"},"SurveyResponseDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"survey_id":{"type":"string","format":"uuid","title":"Survey Id"},"section_id":{"type":"string","format":"uuid","title":"Section Id"},"question_id":{"type":"string","format":"uuid","title":"Question Id"},"concept_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Concept Id"},"persona_id":{"type":"string","format":"uuid","title":"Persona Id"},"answer_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer Text"},"answer_number":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Answer Number"},"answer_choices":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Answer Choices"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"raw_response":{"title":"Raw Response"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","survey_id","section_id","question_id","persona_id","created_at"],"title":"SurveyResponseDetail"},"SurveyRunAcceptedResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"survey_id":{"type":"string","title":"Survey Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["ok","survey_id","status"],"title":"SurveyRunAcceptedResponse"},"SurveySectionDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"survey_id":{"type":"string","format":"uuid","title":"Survey Id"},"position":{"type":"integer","title":"Position"},"section_type":{"type":"string","enum":["question_group","concept_test"],"title":"Section Type"},"concept_category":{"type":"string","enum":["creatives","messaging","scenarios","websites"],"title":"Concept Category"},"title":{"type":"string","title":"Title"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"survey_concepts":{"items":{"$ref":"#/components/schemas/SurveyConceptDetail"},"type":"array","title":"Survey Concepts"},"survey_questions":{"items":{"$ref":"#/components/schemas/SurveyQuestionDetail"},"type":"array","title":"Survey Questions"}},"type":"object","required":["id","survey_id","position","section_type","concept_category","title","created_at","updated_at","survey_concepts","survey_questions"],"title":"SurveySectionDetail"},"SurveySectionInput":{"properties":{"title":{"type":"string","minLength":1,"title":"Title"},"section_type":{"type":"string","enum":["question_group","concept_test"],"title":"Section Type","default":"question_group"},"concept_category":{"type":"string","enum":["creatives","messaging","scenarios","websites"],"title":"Concept Category"},"concepts":{"items":{"$ref":"#/components/schemas/SurveyConceptInput"},"type":"array","title":"Concepts"},"questions":{"items":{"oneOf":[{"$ref":"#/components/schemas/OpenEndedQuestionInput"},{"$ref":"#/components/schemas/MultipleChoiceQuestionInput"},{"$ref":"#/components/schemas/ScaleQuestionInput"},{"$ref":"#/components/schemas/RankingQuestionInput"}],"discriminator":{"propertyName":"type","mapping":{"multiple_choice":"#/components/schemas/MultipleChoiceQuestionInput","open_ended":"#/components/schemas/OpenEndedQuestionInput","ranking":"#/components/schemas/RankingQuestionInput","scale":"#/components/schemas/ScaleQuestionInput"}}},"type":"array","minItems":1,"title":"Questions"}},"additionalProperties":false,"type":"object","required":["title","concept_category","questions"],"title":"SurveySectionInput"},"SurveyUpdateRequest":{"properties":{"populationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Populationid"},"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Name"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"demographicFilter":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Demographicfilter"},"sections":{"anyOf":[{"items":{"$ref":"#/components/schemas/SurveySectionInput"},"type":"array","minItems":1},{"type":"null"}],"title":"Sections"}},"additionalProperties":false,"type":"object","title":"SurveyUpdateRequest"},"TextFlushEvent":{"properties":{"turn_id":{"type":"string","format":"uuid","title":"Turn Id"},"seq":{"type":"integer","title":"Seq"},"created_at":{"type":"string","title":"Created At"},"type":{"type":"string","const":"text.flush","title":"Type"},"payload":{"$ref":"#/components/schemas/TextFlushPayload"}},"type":"object","required":["turn_id","seq","created_at","type","payload"],"title":"TextFlushEvent"},"TextFlushPayload":{"properties":{"part_id":{"type":"string","title":"Part Id"},"text":{"type":"string","title":"Text","default":""},"done":{"type":"boolean","title":"Done","default":false}},"type":"object","required":["part_id"],"title":"TextFlushPayload","description":"`text` is the INCREMENTAL delta since the previous flush of the same\n`part_id` — never cumulative (Contracts § flush semantics). Shared by\n`text.flush` and `reasoning.flush` (identical shape)."},"TextPart":{"properties":{"type":{"type":"string","const":"text","title":"Type","default":"text"},"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"TextPart"},"TextStimulus":{"properties":{"kind":{"type":"string","const":"text","title":"Kind"},"id":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Id","description":"Stable id: \"ST1\", \"ST2\", ..."},"label":{"type":"string","maxLength":500,"title":"Label"},"value":{"type":"string","maxLength":2000,"title":"Value"}},"type":"object","required":["kind","label","value"],"title":"TextStimulus"},"ToolCallEvent":{"properties":{"turn_id":{"type":"string","format":"uuid","title":"Turn Id"},"seq":{"type":"integer","title":"Seq"},"created_at":{"type":"string","title":"Created At"},"type":{"type":"string","const":"tool.call","title":"Type"},"payload":{"$ref":"#/components/schemas/ToolCallPayload"}},"type":"object","required":["turn_id","seq","created_at","type","payload"],"title":"ToolCallEvent"},"ToolCallPayload":{"properties":{"tool_call_id":{"type":"string","title":"Tool Call Id"},"tool_name":{"type":"string","title":"Tool Name"},"input":{"title":"Input"},"provider_executed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Provider Executed"}},"type":"object","required":["tool_call_id","tool_name"],"title":"ToolCallPayload"},"ToolResultEvent":{"properties":{"turn_id":{"type":"string","format":"uuid","title":"Turn Id"},"seq":{"type":"integer","title":"Seq"},"created_at":{"type":"string","title":"Created At"},"type":{"type":"string","const":"tool.result","title":"Type"},"payload":{"$ref":"#/components/schemas/ToolResultPayload"}},"type":"object","required":["turn_id","seq","created_at","type","payload"],"title":"ToolResultEvent"},"ToolResultPayload":{"properties":{"tool_call_id":{"type":"string","title":"Tool Call Id"},"output":{"title":"Output"},"provider_executed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Provider Executed"}},"type":"object","required":["tool_call_id"],"title":"ToolResultPayload","description":"The model-visible compact result (the DataChunk travels separately)."},"TurnDurationChunk":{"properties":{"name":{"type":"string","const":"turnDuration","title":"Name","default":"turnDuration"},"payload":{"$ref":"#/components/schemas/TurnDurationPayload"},"transient":{"type":"boolean","title":"Transient","default":false}},"type":"object","required":["payload"],"title":"TurnDurationChunk"},"TurnDurationPayload":{"properties":{"duration_s":{"type":"number","title":"Duration S"}},"type":"object","required":["duration_s"],"title":"TurnDurationPayload","description":"The `data-turnDuration` payload: ONE turn's server-measured wall-clock\nduration, emitted by the runtime at turn end INSIDE the turn's parts so a\nmerged ask-card resume leaves every round owning its own number (the\nmetadata `duration_s` stamp describes only the LAST turn and stays for\nback-compat). Positional matching (a turn_durations list) was REJECTED:\na turn with no timeline round would shift later numbers onto the wrong\nblock. Never rendered as content — the frontend folds it into the round's\ntimeline duration and the null data-part renderer swallows it."},"TurnErrorEvent":{"properties":{"turn_id":{"type":"string","format":"uuid","title":"Turn Id"},"seq":{"type":"integer","title":"Seq"},"created_at":{"type":"string","title":"Created At"},"type":{"type":"string","const":"turn.error","title":"Type"},"payload":{"$ref":"#/components/schemas/TurnErrorPayload"}},"type":"object","required":["turn_id","seq","created_at","type","payload"],"title":"TurnErrorEvent"},"TurnErrorPayload":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"TurnErrorPayload","description":"Honest truncation marker."},"TurnFinishEvent":{"properties":{"turn_id":{"type":"string","format":"uuid","title":"Turn Id"},"seq":{"type":"integer","title":"Seq"},"created_at":{"type":"string","title":"Created At"},"type":{"type":"string","const":"turn.finish","title":"Type"},"payload":{"$ref":"#/components/schemas/TurnFinishPayload"}},"type":"object","required":["turn_id","seq","created_at","type","payload"],"title":"TurnFinishEvent"},"TurnFinishPayload":{"properties":{"assistant_message_id":{"type":"string","title":"Assistant Message Id"},"usage":{"$ref":"#/components/schemas/ChatUsage"},"finish_reason":{"type":"string","title":"Finish Reason","default":"stop"},"duration_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration S"}},"type":"object","required":["assistant_message_id"],"title":"TurnFinishPayload"},"TurnStartEvent":{"properties":{"turn_id":{"type":"string","format":"uuid","title":"Turn Id"},"seq":{"type":"integer","title":"Seq"},"created_at":{"type":"string","title":"Created At"},"type":{"type":"string","const":"turn.start","title":"Type"},"payload":{"$ref":"#/components/schemas/TurnStartPayload"}},"type":"object","required":["turn_id","seq","created_at","type","payload"],"title":"TurnStartEvent"},"TurnStartPayload":{"properties":{"turn_id":{"type":"string","title":"Turn Id"},"user_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Message Id"},"assistant_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistant Message Id"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"prompt_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Version"},"speaker":{"anyOf":[{"type":"string","const":"analyst"},{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Speaker"}},"type":"object","required":["turn_id"],"title":"TurnStartPayload"},"UpdateArchivedChatRequest":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"chat_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Name"}},"additionalProperties":false,"type":"object","title":"UpdateArchivedChatRequest"},"UpdateChatRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"},"focused_persona_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Focused Persona Id"},"cohort_filter":{"type":"null","title":"Cohort Filter"},"population_id":{"type":"null","title":"Population Id"}},"additionalProperties":false,"type":"object","title":"UpdateChatRequest","description":"PATCH body: rename, focus routing, and/or clearing the cohort rung.\n`focused_persona_id` is tri-state — absent (leave), null (clear focus ->\nanalyst), or a persona id (focus mode); the service reads\n`model_fields_set` to tell absent from null."},"UpdateExperimentResponse":{"properties":{"status":{"type":"string","const":"draft","title":"Status"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["status","experiment_id","answer"],"title":"UpdateExperimentResponse"},"UpdateMemberRoleRequest":{"properties":{"role":{"type":"string","enum":["admin","member"],"title":"Role"}},"type":"object","required":["role"],"title":"UpdateMemberRoleRequest"},"UsageSummaryResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UsageSummaryRow"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"UsageSummaryResponse"},"UsageSummaryRow":{"properties":{"actorId":{"type":"string","title":"Actorid"},"ownerId":{"type":"string","title":"Ownerid","deprecated":true},"email":{"type":"string","title":"Email"},"populationId":{"type":"string","title":"Populationid"},"populationName":{"type":"string","title":"Populationname"},"workspaceId":{"type":"string","title":"Workspaceid"},"workspaceName":{"type":"string","title":"Workspacename"},"date":{"type":"string","title":"Date"},"hour":{"type":"integer","title":"Hour"},"chats":{"type":"integer","title":"Chats","deprecated":true},"chatsCreated":{"type":"integer","title":"Chatscreated"},"chatMessagesSent":{"type":"integer","title":"Chatmessagessent"},"studiesCreated":{"type":"integer","title":"Studiescreated"},"experimentsCreated":{"type":"integer","title":"Experimentscreated"},"surveysCreated":{"type":"integer","title":"Surveyscreated"}},"type":"object","required":["actorId","ownerId","email","populationId","populationName","workspaceId","workspaceName","date","hour","chats","chatsCreated","chatMessagesSent","studiesCreated","experimentsCreated","surveysCreated"],"title":"UsageSummaryRow"},"UserFilePartInput":{"properties":{"type":{"type":"string","const":"file","title":"Type"},"asset_id":{"type":"string","format":"uuid","title":"Asset Id"},"filename":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Filename"}},"additionalProperties":false,"type":"object","required":["type","asset_id"],"title":"UserFilePartInput","description":"One attached image, by reference (chat-image-attachments D2/D3): the\nupload already happened via POST /workspaces/{ws}/assets, so the wire\ncarries `asset_id` — never a URL, never bytes. Deliberately NO media-type\nfield (R1): the server always canonicalizes from\n``media_assets.content_type``; `extra=\"forbid\"` rejects a client that\nsends one."},"UserMessageInput":{"properties":{"parts":{"items":{"oneOf":[{"$ref":"#/components/schemas/UserTextPartInput"},{"$ref":"#/components/schemas/UserFilePartInput"}],"discriminator":{"propertyName":"type","mapping":{"file":"#/components/schemas/UserFilePartInput","text":"#/components/schemas/UserTextPartInput"}}},"type":"array","maxItems":12,"minItems":1,"title":"Parts"}},"additionalProperties":false,"type":"object","required":["parts"],"title":"UserMessageInput"},"UserTextPartInput":{"properties":{"type":{"type":"string","const":"text","title":"Type"},"text":{"type":"string","maxLength":10000,"minLength":1,"title":"Text"}},"additionalProperties":false,"type":"object","required":["type","text"],"title":"UserTextPartInput"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VoiceInterviewDeleteExcludedRequest":{"properties":{"studyId":{"type":"string","title":"Studyid"}},"type":"object","required":["studyId"],"title":"VoiceInterviewDeleteExcludedRequest"},"VoiceInterviewDeleteExcludedResponse":{"properties":{"item":{"$ref":"#/components/schemas/VoiceInterviewDeleteExcludedResult"}},"type":"object","required":["item"],"title":"VoiceInterviewDeleteExcludedResponse"},"VoiceInterviewDeleteExcludedResult":{"properties":{"deletedCount":{"type":"integer","title":"Deletedcount"}},"type":"object","required":["deletedCount"],"title":"VoiceInterviewDeleteExcludedResult"},"VoiceInterviewDraftResponse":{"properties":{"draft":{"additionalProperties":true,"type":"object","title":"Draft"}},"type":"object","required":["draft"],"title":"VoiceInterviewDraftResponse"},"VoiceInterviewProlificSyncRequest":{"properties":{"studyId":{"type":"string","title":"Studyid"}},"type":"object","required":["studyId"],"title":"VoiceInterviewProlificSyncRequest"},"VoiceInterviewProlificSyncResponse":{"properties":{"prolificSync":{"additionalProperties":true,"type":"object","title":"Prolificsync"}},"type":"object","required":["prolificSync"],"title":"VoiceInterviewProlificSyncResponse"},"VoiceInterviewQaClaimRequest":{"properties":{"studyId":{"type":"string","title":"Studyid"},"voiceInterviewId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Voiceinterviewid"}},"type":"object","required":["studyId"],"title":"VoiceInterviewQaClaimRequest"},"VoiceInterviewQaExcludeRequest":{"properties":{"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"VoiceInterviewQaExcludeRequest"},"VoiceInterviewQaQueueResponse":{"properties":{"studyId":{"type":"string","title":"Studyid"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"prolificStatusCounts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Prolificstatuscounts"},"prolificSync":{"additionalProperties":true,"type":"object","title":"Prolificsync"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"}},"type":"object","required":["studyId","counts","prolificStatusCounts","prolificSync","items"],"title":"VoiceInterviewQaQueueResponse"},"VoiceInterviewQaTransition":{"properties":{"voiceInterviewId":{"type":"string","title":"Voiceinterviewid"},"qaStatus":{"type":"string","title":"Qastatus"}},"type":"object","required":["voiceInterviewId","qaStatus"],"title":"VoiceInterviewQaTransition"},"VoiceInterviewQaTransitionResponse":{"properties":{"item":{"$ref":"#/components/schemas/VoiceInterviewQaTransition"}},"type":"object","required":["item"],"title":"VoiceInterviewQaTransitionResponse"},"WebhookAcknowledgement":{"properties":{"ok":{"type":"boolean","const":true,"title":"Ok"}},"additionalProperties":false,"type":"object","required":["ok"],"title":"WebhookAcknowledgement"},"WorkingStateEdit":{"properties":{"open_items":{"items":{"$ref":"#/components/schemas/OpenItem"},"type":"array","title":"Open Items"},"assumptions":{"items":{"type":"string","maxLength":2000},"type":"array","title":"Assumptions"},"provenance":{"items":{"$ref":"#/components/schemas/ProvenanceEntry"},"type":"array","title":"Provenance"},"section":{"type":"string","const":"working_state","title":"Section"}},"additionalProperties":false,"type":"object","required":["open_items","assumptions","provenance","section"],"title":"WorkingStateEdit","description":"The model's scratchpad (question queue, assumptions, provenance\nlabels), isolated from content sections so updating it can never reword\nconfirmed content."},"WorkspaceCreationOptionsResponse":{"properties":{"owned_workspace_count":{"type":"integer","title":"Owned Workspace Count"},"archived_owned_workspace_count":{"type":"integer","title":"Archived Owned Workspace Count"},"max_owned_workspaces":{"type":"integer","const":3,"title":"Max Owned Workspaces","default":3},"private_populations":{"items":{"$ref":"#/components/schemas/WorkspaceCreationPopulation"},"type":"array","title":"Private Populations"}},"type":"object","required":["owned_workspace_count","archived_owned_workspace_count","private_populations"],"title":"WorkspaceCreationOptionsResponse"},"WorkspaceCreationPopulation":{"properties":{"population_id":{"type":"string","title":"Population Id"},"name":{"type":"string","title":"Name"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"source_workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceCreationSource"},"type":"array","title":"Source Workspaces"}},"type":"object","required":["population_id","name","source_workspaces"],"title":"WorkspaceCreationPopulation"},"WorkspaceCreationSource":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["workspace_id","name"],"title":"WorkspaceCreationSource"},"WorkspaceDirectoryItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","title":"Created At"},"archived":{"type":"boolean","title":"Archived"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"owner":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceMemberItem"},{"type":"null"}]},"internal":{"type":"boolean","title":"Internal"},"members":{"items":{"$ref":"#/components/schemas/WorkspaceMemberItem"},"type":"array","title":"Members"},"populations":{"items":{"$ref":"#/components/schemas/WorkspacePopulationGrant"},"type":"array","title":"Populations"}},"type":"object","required":["id","name","created_at","archived","team_id","owner","internal","members","populations"],"title":"WorkspaceDirectoryItem"},"WorkspaceMember":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"type":"string","enum":["owner","admin","member"],"title":"Role"},"status":{"type":"string","enum":["active","pending"],"title":"Status"}},"type":"object","required":["user_id","role","status"],"title":"WorkspaceMember"},"WorkspaceMemberItem":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"joined_at":{"type":"string","title":"Joined At"}},"type":"object","required":["user_id","email","role","joined_at"],"title":"WorkspaceMemberItem"},"WorkspaceMembersResponse":{"properties":{"members":{"items":{"$ref":"#/components/schemas/WorkspaceMember"},"type":"array","title":"Members"}},"type":"object","required":["members"],"title":"WorkspaceMembersResponse"},"WorkspacePersonaSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"population_id":{"type":"string","format":"uuid","title":"Population Id"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"attributes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Attributes"},"population":{"$ref":"#/components/schemas/PersonaPopulationContext"}},"type":"object","required":["id","population_id","population"],"title":"WorkspacePersonaSummary","description":"The lightweight persona shape every UI surface consumes: identity,\npopulation context, and filterable attributes. Deliberately no bio,\ntimestamps, or researcher briefs — those have no frontend consumer\n(docs/designs/workspaces-direct-postgres.md, Decision 5)."},"WorkspacePopulationGrant":{"properties":{"population_id":{"type":"string","title":"Population Id"},"population_name":{"type":"string","title":"Population Name"}},"type":"object","required":["population_id","population_name"],"title":"WorkspacePopulationGrant"},"WorkspacePopulationSummary":{"properties":{"population_id":{"type":"string","title":"Population Id"},"name":{"type":"string","title":"Name"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"age_range":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Age Range"},"geography":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geography"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"is_public":{"type":"boolean","title":"Is Public"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"persona_count":{"type":"integer","title":"Persona Count"}},"type":"object","required":["population_id","name","is_public","created_at","updated_at","persona_count"],"title":"WorkspacePopulationSummary"},"WorkspaceSummary":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","enum":["owner","admin","member"],"title":"Role"},"has_experiments":{"type":"boolean","title":"Has Experiments","default":false},"has_surveys":{"type":"boolean","title":"Has Surveys","default":false}},"type":"object","required":["workspace_id","name","role"],"title":"WorkspaceSummary"},"WorkspacesDirectoryResponse":{"properties":{"teams":{"items":{"$ref":"#/components/schemas/AdminTeamItem"},"type":"array","title":"Teams"},"workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceDirectoryItem"},"type":"array","title":"Workspaces"}},"type":"object","required":["teams","workspaces"],"title":"WorkspacesDirectoryResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"admin","description":"Platform admin operations."},{"name":"assets","description":"Workspace media asset routes."},{"name":"mcp-tokens","description":"MCP token management routes."},{"name":"chat-archive","description":"Archived v1 chat routes."},{"name":"chat","description":"Durable chat agent routes."},{"name":"experiments","description":"Experiment lifecycle product routes."},{"name":"me","description":"Authenticated caller-status routes."},{"name":"persona-eval","description":"Admin persona evaluation routes."},{"name":"population-eval","description":"Admin population evaluation routes."},{"name":"populations","description":"Workspace-scoped population, persona, and demographic preview routes."},{"name":"run-question","description":"Ad-hoc single-question run routes."},{"name":"studies","description":"Studies-in-chat brief canvas and list routes."},{"name":"surveys","description":"Survey execution product routes."},{"name":"support","description":"Authenticated support email delivery."},{"name":"voice-interview","description":"Voice interview capture routes."},{"name":"workspaces","description":"Workspace routes."},{"name":"system","description":"Health and diagnostics routes."}]}