{"openapi":"3.1.0","info":{"title":"Billie 2.0 API","version":"1.0.0"},"paths":{"/livez":{"get":{"summary":"Livez","description":"Liveness probe. Must stay dependency-free — see module docstring.","operationId":"livez_livez_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/readyz":{"get":{"summary":"Readyz","description":"Readiness probe: the checkpointer this environment configured — see module docstring.","operationId":"readyz_readyz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Readiness and build info — see module docstring.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/models":{"get":{"tags":["config"],"summary":"List Models Endpoint","description":"List allowed LLM models from Firestore configuration.\n\nThis endpoint returns models configured in the /system/models collection.\nModels can be managed through Firebase Console or by running init_firestore_config.py.\n\nArgs:\n    enabled_only: If True, only return enabled models (default: True)\n\nReturns:\n    ModelsListResponse with list of allowed models","operationId":"list_models_endpoint_api_v1_models_get","parameters":[{"name":"enabled_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Enabled Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/config/settings":{"get":{"tags":["config"],"summary":"Get Public Settings","description":"Get system settings (version, app_name, maintenance_mode).\n\nThis endpoint and returns only non-sensitive\nsystem settings that the frontend needs to display to users.\n\nReturns:\n    Dictionary with public system settings","operationId":"get_public_settings_api_v1_config_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/config/changelog/{version}":{"get":{"tags":["config"],"summary":"Get Changelog Entry","description":"Get changelog entry for a specific version. Requires authentication.\n\nThis endpoint reads from /status/changelog/entries/v{version} in Firestore.\nUses server-side credentials to avoid frontend permission issues.\n\nArgs:\n    version: Version string (e.g., \"2.0.0\")\n    user: Authenticated user from Firebase token\n\nReturns:\n    Changelog entry with content_markdown, title, theme, etc.","operationId":"get_changelog_entry_api_v1_config_changelog__version__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/config/changelog-pending":{"get":{"tags":["config"],"summary":"Get Pending Changelog Entry","description":"Unreleased release notes for `?previewChangelogModal=pending`. Admin only.\n\nThis is copy that has not been announced yet, so it is gated on the same Entra\n\"Digital Products\" membership as the other admin endpoints rather than served as a\nstatic asset. Present only in preview/dev builds; production images omit the file and\nthis returns 404.","operationId":"get_pending_changelog_entry_api_v1_config_changelog_pending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/feature-flags/config":{"get":{"tags":["feature-flags"],"summary":"Flipt Client Config","description":"Namespace and environment the browser SDK should evaluate against.\n\nUnauthenticated on purpose, like the snapshot proxy below: these are\ndeployment labels, not secrets, and the SDK initialises before the app has\na user. The client token is never included — it stays server-side.\n\nUncacheable on purpose too. The answer is per-tier, and every tier is\nreachable through the same bundle, so a cached copy is how a dev browser\nends up evaluating production flags. index.html is served no-store for the\nsame reason (main.py), and the cost is one small request per page load.","operationId":"flipt_client_config_api_v1_feature_flags_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/v1/evaluation/snapshot/namespace/{namespace}":{"get":{"tags":["feature-flags"],"summary":"Flipt Snapshot","description":"Fetch a client-side evaluation snapshot from the Flipt server.\n\nMirrors the exact path the Flipt SDK constructs, so the frontend only\nneeds to point its `url` option at this app's origin. ETag/304 polling\nis passed through so the SDK's 120s refresh stays cheap.","operationId":"flipt_snapshot_internal_v1_evaluation_snapshot_namespace__namespace__get","parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]+$","title":"Namespace"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/projects":{"post":{"tags":["projects"],"summary":"Create Project","description":"Create a new project with a RAG corpus.\n\nSteps:\n1. Create RAG corpus in Vertex AI\n2. Store project metadata in Firestore\n3. Return project info with corpus ID","operationId":"create_project_api_v1_rag_projects_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/rag/projects/{project_id}/import-files":{"post":{"tags":["projects"],"summary":"Import Project Files","description":"Import files from Firebase Storage to project's Pinecone index.\n\nThis endpoint re-indexes files that are already in Firebase Storage.\nFor new file uploads, use the /upload endpoint instead.","operationId":"import_project_files_api_v1_rag_projects__project_id__import_files_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportFilesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportFilesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/projects/{project_id}":{"delete":{"tags":["projects"],"summary":"Delete Project","description":"Delete a project and all its resources.","operationId":"delete_project_api_v1_rag_projects__project_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/projects/{project_id}/members":{"get":{"tags":["projects"],"summary":"Get Project Members","description":"Get all members of a project.","operationId":"get_project_members_api_v1_rag_projects__project_id__members_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectMembersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["projects"],"summary":"Add Project Member","description":"Add a member to a project by email.\nOnly the project owner can add new members.","operationId":"add_project_member_api_v1_rag_projects__project_id__members_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMemberRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/projects/{project_id}/members/{member_id}":{"delete":{"tags":["projects"],"summary":"Remove Project Member","description":"Remove a member from a project.\nOnly the project owner can remove members.","operationId":"remove_project_member_api_v1_rag_projects__project_id__members__member_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/projects/claim-invites":{"post":{"tags":["projects"],"summary":"Claim Pending Invites","description":"Convert any pending project invites for this user into full memberships.\nCalled on every login — safe to call repeatedly (idempotent).","operationId":"claim_pending_invites_api_v1_rag_projects_claim_invites_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/rag/upload":{"post":{"tags":["documents"],"summary":"Upload Document","description":"Upload a document and import it to RAG corpus.\n\nSteps:\n1. Save file temporarily\n2. Upload to Firebase Storage\n3. Import to RAG corpus\n4. Save metadata to Firestore\n5. Return document info","operationId":"upload_document_api_v1_rag_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_api_v1_rag_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/rag/confidential/upload":{"post":{"tags":["documents"],"summary":"Upload Confidential Document","description":"Upload a document to an in-memory FAISS store for confidential mode.\n\nNo data is persisted to Firebase Storage, Firestore, or Pinecone.\nDocuments are chunked, embedded, and stored only in server memory.\nSession expires after 2 hours of inactivity.\n\nArgs:\n    file: Document to upload (max 5 MB)\n    session_id: Existing session ID (created if not provided)","operationId":"upload_confidential_document_api_v1_rag_confidential_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_confidential_document_api_v1_rag_confidential_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/pdf/extract":{"post":{"tags":["documents"],"summary":"Extract Document Text","description":"Extract text from a document file for ad-hoc analysis.\n\nSupports PDF, Word (.docx), Excel (.xlsx/.xls), PowerPoint (.pptx),\nCSV, TXT, Markdown, Outlook (.msg), HTML, and JSON/JSONL.\nThis endpoint extracts text without adding it to the RAG corpus.\nUseful for one-time questions about a document. Max file size: 30 MB\n(bounded by Cloud Run's 32 MiB request-ingress cap).","operationId":"extract_document_text_api_v1_pdf_extract_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_document_text_api_v1_pdf_extract_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PDFExtractionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/rag/documents":{"get":{"tags":["documents"],"summary":"List All Documents","description":"List all documents uploaded by the authenticated user with pagination.","operationId":"list_all_documents_api_v1_rag_documents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/documents/{document_id}":{"delete":{"tags":["documents"],"summary":"Delete Document","description":"Delete a document from Pinecone and Firestore.\n\nRemoves the document's vector chunks from the Pinecone index so the AI can\nno longer retrieve content from it, then removes the Firestore metadata record.\nFirebase Storage deletion is handled by the frontend.","operationId":"delete_document_api_v1_rag_documents__document_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entraid/users":{"get":{"tags":["entraid"],"summary":"Search Users For Sharing","description":"Search for employees by name or email for the project sharing modal.\n\nAvailable to all authenticated users (not admin-only).\nReturns minimal profile info (display_name, email) — no sensitive HR data.","operationId":"search_users_for_sharing_api_v1_entraid_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__models__UserSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entraid/user/{user_principal_name}":{"get":{"tags":["entraid"],"summary":"Get Entraid User","description":"Get EntraID user information from BigQuery.\n\nQueries the microsoft_entra_id_fivetran.users table for user details\nbased on the user_principal_name (email).","operationId":"get_entraid_user_api_v1_entraid_user__user_principal_name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_principal_name","in":"path","required":true,"schema":{"type":"string","title":"User Principal Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntraIDUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entraid/me":{"get":{"tags":["entraid"],"summary":"Get Current User Info","description":"Get current user's EntraID information including admin status.\n\nReturns the authenticated user's profile including:\n- All EntraID profile fields (department, job_title, etc.)\n- isAdmin: True if user is in \"Digital Products\" security group\n\nThis is useful for the frontend to determine if the user should\nsee admin-only features like user emulation.","operationId":"get_current_user_info_api_v1_entraid_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Current User Info Api V1 Entraid Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/entraid/search":{"post":{"tags":["entraid"],"summary":"Search Entraid Users","description":"Search for EntraID users in BigQuery.\n\nSearches the microsoft_entra_id_fivetran.users table based on:\n- search_term: Matches display_name, mail, or user_principal_name\n- department: Filter by department\n- office_location: Filter by office location","operationId":"search_entraid_users_api_v1_entraid_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntraIDSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntraIDSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/entraid/groups":{"get":{"tags":["entraid"],"summary":"Get User Groups","description":"Get user's Entra ID security group memberships using app credentials.\n\nThis endpoint fetches the security groups using Azure app registration\nwith client credentials (no user token needed).\n\nReturns:\n    List of security groups with id, displayName, and description","operationId":"get_user_groups_api_v1_entraid_groups_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntraIDGroupsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/entraid/refresh-groups":{"post":{"tags":["entraid"],"summary":"Refresh User Groups","description":"Live-refresh the caller's Entra security group membership.\n\nQueries Microsoft Graph directly for this user, updates their Firebase custom\nclaims (``billie_group_ids``) and Firestore doc, and busts the BigQuery cache so\nthe next ``/groups`` read is fresh. This lets a newly-added group member gain\naccess within seconds instead of waiting for the 4-hourly batch sync job.\n\nRate-limited to discourage hammering Graph from a single client.","operationId":"refresh_user_groups_api_v1_entraid_refresh_groups_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshAccessResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/validate/writing-style":{"post":{"tags":["agent"],"summary":"Validate Writing Style","description":"Screen a writing-style preference string through Model Armor before it is\npersisted to the user's profile.\n\nReturns { approved: true } when the text is clean (or when Model Armor is\ndisabled), and { approved: false, reason: \"...\" } when it is blocked.","operationId":"validate_writing_style_api_v1_validate_writing_style_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateWritingStyleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateWritingStyleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/writing-style/learn-from-m365":{"post":{"tags":["agent"],"summary":"Learn Writing Style From M365","description":"Derive the caller's writing style from their own Teams chats and sent email.\n\nReads as the caller through Work IQ (their delegated token, checked to be\ntheirs), headless and read-only; distils with settings.voice_profile_model.\nNothing read is stored — the browser saves the returned style like any other.\n\nStreams NDJSON so the Library can show each step as it happens:\n``{\"type\":\"step\",\"step\":\"teams|mail|distill|safety\",\"status\":\"running|done|skipped|failed\",...}``,\n``{\"type\":\"heartbeat\"}``, and finally one ``{\"type\":\"result\",...LearnVoiceResponse}`` or\n``{\"type\":\"error\",\"detail\":...}``. Problems known before reading anything stay HTTP errors.","operationId":"learn_writing_style_from_m365_api_v1_writing_style_learn_from_m365_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnVoiceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/writing-style/deep-dive":{"get":{"tags":["agent"],"summary":"Get Voice Deep Dive","description":"The caller's latest deeper read: running, ready (with both registers) or failed. ``{}`` if none.","operationId":"get_voice_deep_dive_api_v1_writing_style_deep_dive_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["agent"],"summary":"Start Voice Deep Dive","description":"Start a deeper read (90 days, more windows) in the background. Returns its job id.\n\nThe result lands on ``GET /writing-style/deep-dive``, with an in-app notification and an email.","operationId":"start_voice_deep_dive_api_v1_writing_style_deep_dive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnVoiceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/writing-style/deep-dive/{job_id}":{"delete":{"tags":["agent"],"summary":"Dismiss Voice Deep Dive","description":"Forget a deeper read (after it was used or discarded). Only the caller's own jobs.","operationId":"dismiss_voice_deep_dive_api_v1_writing_style_deep_dive__job_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/conversations/auto-tag":{"post":{"tags":["agent"],"summary":"Auto Tag Conversation","description":"Classify a conversation into one of the predefined business categories.\nUses a fast LLM call — fails open with [\"general\"] on any error.\n\nNote: Real-time auto-tag calls from the frontend have been removed.\nThis endpoint is kept for manual re-tagging / testing.\nNightly batch tagging is handled by batch_autotag_service.py.","operationId":"auto_tag_conversation_api_v1_conversations_auto_tag_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTagRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTagResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/agent/query-stream":{"post":{"tags":["agent"],"summary":"Agent Query Stream Langgraph","description":"LangGraph-based streaming endpoint.\n\nProvides true async streaming with real-time tool execution updates.\nUses LangGraph 1.0.3 for maximum control and performance.\n\nReturns newline-delimited JSON chunks:\n- {\"type\": \"tool_call\", \"content\": {\"name\": \"rag\", \"args\": {...}}}\n- {\"type\": \"tools_used\", \"content\": [\"rag\"]}\n- {\"type\": \"content\", \"content\": \"answer text\"}\n- {\"type\": \"sources\", \"content\": [...]}\n- {\"type\": \"images\", \"content\": [...]}\n- {\"type\": \"done\"}","operationId":"agent_query_stream_langgraph_api_v1_agent_query_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentQueryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/chat/completions":{"post":{"tags":["agent"],"summary":"Chat Completions","description":"OpenAI-compatible chat completions endpoint.\n\nThis endpoint provides an OpenAI-compatible API for chat completions,\nsupporting multiple LLM providers (Azure OpenAI, Anthropic, Google).","operationId":"chat_completions_api_v1_chat_completions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/contract-review/export-pdf":{"post":{"tags":["agent"],"summary":"Export Contract Pdf","description":"Generate PDF report for contract review.\n\nThis endpoint re-runs contract analysis with PDF export enabled,\nreturning only the download URL.\n\nRequest body:\n    {\n        \"session_id\": \"conf_abc123\",\n        \"risk_criteria\": \"standard\" (optional)\n    }\n\nReturns:\n    {\n        \"pdf_url\": \"https://storage.googleapis.com/...\"\n    }","operationId":"export_contract_pdf_api_v1_contract_review_export_pdf_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/contract-review/download/{token}":{"get":{"tags":["agent"],"summary":"Download Contract Pdf","description":"Download a contract review PDF securely (authenticated, single-use).\n\nPDFs are stored in-memory and automatically deleted after download or expiration (15 min).\nOnly the user who generated the PDF can download it.\n\nRate limited to 10 requests per minute to prevent token enumeration attacks.","operationId":"download_contract_pdf_api_v1_contract_review_download__token__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agent/seed-context":{"post":{"tags":["agent"],"summary":"Seed Agent Context","description":"Clear then rebuild the LangGraph checkpoint for a conversation thread.\n\nUsed when the thread must change with no turn to follow, such as adding a\nDeep Research report to the chat. Regenerate and branch no longer call this:\nthey send ``reseed`` with their query-stream request, so the reset and the\nturn cannot be reordered (DP-4938).\n\nSteps:\n1. Verify the conversation belongs to the requesting user.\n2. Wait for turns already running on the thread (services/thread_guard.py).\n3. Delete the existing checkpoint rows (same as clear-context).\n4. Seed the checkpointer with the provided conversation history using\n   aupdate_state — no LLM call is made, only the state is written.","operationId":"seed_agent_context_api_v1_agent_seed_context_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedContextRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/agent/clear-context":{"post":{"tags":["agent"],"summary":"Clear Agent Context","description":"Delete the LangGraph checkpoint for a conversation thread.\n\nResets the agent's memory for this conversation without deleting the\nFirestore chat history.  The user can continue in the same chat window\nbut the model starts with a clean context.","operationId":"clear_agent_context_api_v1_agent_clear_context_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"query","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agent/context-summary-preview":{"post":{"tags":["agent"],"summary":"Context Summary Preview","description":"Generate a compact summary of the conversation for the \"compact context\" flow.\n\nMirrors the deep-research context-preview endpoint: the caller passes in\nthe messages they want compacted, the server runs the summarization LLM,\nand the response carries the markdown plus token-impact data the modal\nneeds to render the option card. Apply is handled by\n``/agent/apply-context-summary``.\n\nCode-heavy and inline-document (PDF) messages are NOT summarized — like the\nautomatic summarizer, they are preserved verbatim by the apply step, so we\nonly summarize the rest and report a token estimate that includes the pinned\nmessages (the honest post-compaction size).","operationId":"context_summary_preview_api_v1_agent_context_summary_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextSummaryPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextSummaryPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/agent/apply-context-summary":{"post":{"tags":["agent"],"summary":"Apply Context Summary","description":"Apply the user-triggered \"Summarize & continue\" compaction.\n\nReplaces the LangGraph checkpoint with a compact representation that mirrors\nthe automatic summarizer: a summary anchor message followed by the code-heavy\nand inline-document messages preserved VERBATIM. Without this, the manual\nflow collapsed the whole conversation into a short prose summary, paraphrasing\naway the scripts, queries, exact field names, and uploaded PDFs that power\nusers depend on — the very loss that made them start fresh chats.\n\nThe summary text is the one already generated (and shown to the user) by\n``/agent/context-summary-preview``, so no second LLM call is made here.","operationId":"apply_context_summary_api_v1_agent_apply_context_summary_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyContextSummaryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/usage":{"get":{"tags":["usage"],"summary":"Get Token Usage Summary","description":"Return the authenticated user's current token usage summary.","operationId":"get_token_usage_summary_api_v1_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenUsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/usage/tools":{"get":{"tags":["usage"],"summary":"Get Tool Usage Summary","description":"Return the authenticated user's current tool usage metrics.","operationId":"get_tool_usage_summary_api_v1_usage_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolUsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/usage/tools/limit":{"put":{"tags":["usage"],"summary":"Update Tool Limit","description":"Set a limit for a specific tool.\n\nAdmin function for adjusting individual user quotas.\nSet limit to 0 for unlimited usage.","operationId":"update_tool_limit_api_v1_usage_tools_limit_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetToolLimitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/usage/tools/reset":{"post":{"tags":["usage"],"summary":"Reset Tool Usage Counters","description":"Reset tool usage counters.\n\nAdmin function for manually resetting usage.\nIf tool_name is provided, only that tool is reset.\nIf tool_name is None, all tools are reset.","operationId":"reset_tool_usage_counters_api_v1_usage_tools_reset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetToolUsageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/video-usage":{"get":{"tags":["video-usage"],"summary":"Get Video Usage Summary","description":"Return the authenticated user's current video usage summary.","operationId":"get_video_usage_summary_api_v1_video_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoUsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/video-usage/can-generate":{"get":{"tags":["video-usage"],"summary":"Check Can Generate Video","description":"Pre-flight check to determine if the user can generate another video.\n\nUse this endpoint before starting an expensive video generation operation\nto provide early feedback to the user.","operationId":"check_can_generate_video_api_v1_video_usage_can_generate_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanGenerateResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/videos/refresh-url":{"post":{"tags":["videos"],"summary":"Refresh Video Url","description":"Generate a fresh signed URL for a video.\n\nUse this endpoint when a video fails to play due to an expired signed URL.\nAccepts either an expired signed URL or a GCS URI (gs://...).","operationId":"refresh_video_url_api_v1_videos_refresh_url_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshUrlRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/usage/tools":{"get":{"tags":["admin"],"summary":"Get Aggregated Usage","description":"Get aggregated tool usage across all users.\n\nReturns total calls, costs, and per-tool breakdowns.","operationId":"get_aggregated_usage_api_v1_admin_usage_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregatedToolUsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/usage/users":{"get":{"tags":["admin"],"summary":"Get All Users Usage","description":"Get a list of all users with their tool usage summaries.\n\nSorted by total calls descending.","operationId":"get_all_users_usage_api_v1_admin_usage_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllUsersToolUsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/usage/users/{user_id}":{"get":{"tags":["admin"],"summary":"Get User Usage Detail","description":"Get detailed tool usage for a specific user.\n\nArgs:\n    user_id: The ID of the user to get metrics for.","operationId":"get_user_usage_detail_api_v1_admin_usage_users__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserToolUsageDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/prompts/config":{"get":{"tags":["admin-prompts"],"summary":"Get Config","description":"Get role prompt system configuration.","operationId":"get_config_api_v1_admin_prompts_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolePromptConfig-Output"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["admin-prompts"],"summary":"Update Config","description":"Update role prompt system configuration.","operationId":"update_config_api_v1_admin_prompts_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolePromptConfig-Input"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolePromptConfig-Output"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/prompts/roles":{"get":{"tags":["admin-prompts"],"summary":"List Roles","description":"List all role definitions.","operationId":"list_roles_api_v1_admin_prompts_roles_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"enabled_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only return enabled roles","default":false,"title":"Enabled Only"},"description":"Only return enabled roles"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleDefinition-Output"},"title":"Response List Roles Api V1 Admin Prompts Roles Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin-prompts"],"summary":"Create Role","description":"Create a new role definition.","operationId":"create_role_api_v1_admin_prompts_roles_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleDefinition-Input"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleDefinition-Output"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/prompts/roles/{role_id}":{"get":{"tags":["admin-prompts"],"summary":"Get Role","description":"Get a specific role definition.","operationId":"get_role_api_v1_admin_prompts_roles__role_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"string","title":"Role Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleDefinition-Output"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin-prompts"],"summary":"Update Role","description":"Update a role definition (partial updates supported).","operationId":"update_role_api_v1_admin_prompts_roles__role_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"string","title":"Role Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleDefinition-Output"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin-prompts"],"summary":"Delete Role","description":"Delete a role definition.","operationId":"delete_role_api_v1_admin_prompts_roles__role_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"role_id","in":"path","required":true,"schema":{"type":"string","title":"Role Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/prompts/mappings":{"get":{"tags":["admin-prompts"],"summary":"List Mappings","description":"List all role mappings sorted by priority.","operationId":"list_mappings_api_v1_admin_prompts_mappings_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"enabled_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only return enabled mappings","default":false,"title":"Enabled Only"},"description":"Only return enabled mappings"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleMapping-Output"},"title":"Response List Mappings Api V1 Admin Prompts Mappings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin-prompts"],"summary":"Create Mapping","description":"Create a new role mapping.","operationId":"create_mapping_api_v1_admin_prompts_mappings_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleMapping-Input"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleMapping-Output"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/prompts/mappings/{mapping_id}":{"get":{"tags":["admin-prompts"],"summary":"Get Mapping","description":"Get a specific role mapping.","operationId":"get_mapping_api_v1_admin_prompts_mappings__mapping_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mapping_id","in":"path","required":true,"schema":{"type":"string","title":"Mapping Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleMapping-Output"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin-prompts"],"summary":"Update Mapping","description":"Update a role mapping (partial updates supported).","operationId":"update_mapping_api_v1_admin_prompts_mappings__mapping_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mapping_id","in":"path","required":true,"schema":{"type":"string","title":"Mapping Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMappingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleMapping-Output"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin-prompts"],"summary":"Delete Mapping","description":"Delete a role mapping.","operationId":"delete_mapping_api_v1_admin_prompts_mappings__mapping_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mapping_id","in":"path","required":true,"schema":{"type":"string","title":"Mapping Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/prompts/preview":{"post":{"tags":["admin-prompts"],"summary":"Preview Role Resolution","description":"Preview role resolution for a given user profile.\n\nPass a dict with job_title, department, etc. to see which role would be assigned.","operationId":"preview_role_resolution_api_v1_admin_prompts_preview_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"User Info"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Preview Role Resolution Api V1 Admin Prompts Preview Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/prompts/audit":{"get":{"tags":["admin-prompts"],"summary":"Get Audit Log","description":"Get audit log entries for role prompt changes.","operationId":"get_audit_log_api_v1_admin_prompts_audit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Number of entries to return","default":50,"title":"Limit"},"description":"Number of entries to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination","default":0,"title":"Offset"},"description":"Offset for pagination"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Audit Log Api V1 Admin Prompts Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/chats/analytics/schema":{"get":{"tags":["admin-chats"],"summary":"Chat Analytics Schema","operationId":"chat_analytics_schema_api_v1_admin_chats_analytics_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Chat Analytics Schema Api V1 Admin Chats Analytics Schema Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/chats/analytics":{"get":{"tags":["admin-chats"],"summary":"Chat Analytics","description":"Read a summary and indexed turn page; pin generation on subsequent pages.\n\nA changed generation returns 409 so callers never combine two snapshots.\nThe source hash is checked on every read; stale labels remain available but\nare explicitly marked stale. Deleted/confidential chats are never served.","operationId":"chat_analytics_api_v1_admin_chats_analytics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_path","in":"query","required":true,"schema":{"type":"string","pattern":"^(users|projects)/[^/]+/chats/[^/]+$","title":"Source Path"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"generation","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Chat Analytics Api V1 Admin Chats Analytics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/chats/analytics/clusters":{"get":{"tags":["admin-chats"],"summary":"Chat Analytics Clusters","operationId":"chat_analytics_clusters_api_v1_admin_chats_analytics_clusters_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"scope","in":"query","required":true,"schema":{"type":"string","pattern":"^(users|projects)/[^/]+$","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Chat Analytics Clusters Api V1 Admin Chats Analytics Clusters Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/chats/clone":{"post":{"tags":["admin-chats"],"summary":"Clone Chat","description":"Clone any chat (by ID, regardless of owner) into the caller's personal chats.\n\nScans the `chats` collection group for a document with the given ID. Copies\n`messages`, `model`, and `projectId` into a new doc under\n`/users/{caller_uid}/chats/{new_id}` with title prefixed `[Clone]`.\n\nDeclared as a sync `def` (not `async`) so FastAPI runs it in a threadpool —\nthe Firestore client is blocking, and a full collection-group scan inside the\nevent loop would freeze every other request.","operationId":"clone_chat_api_v1_admin_chats_clone_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloneChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloneChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/chats/inspect/{chat_id}":{"get":{"tags":["admin-chats"],"summary":"Inspect Chat","description":"Return the raw Firestore document for any chat by ID.\n\nDebug-only — used to inspect a cloned chat's `clonedFrom` reference and the\nfull `messages` array so we can trace back to the source. Returns the doc as\nJSON-safe primitives (datetimes -> ISO strings).","operationId":"inspect_chat_api_v1_admin_chats_inspect__chat_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Inspect Chat Api V1 Admin Chats Inspect  Chat Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/models":{"get":{"tags":["admin-models"],"summary":"Get Models","description":"Return the full /system/models map, including disabled models.\n\nSync `def` so the blocking Firestore read runs in a threadpool.","operationId":"get_models_api_v1_admin_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsMapResponse"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["admin-models"],"summary":"Update Models","description":"Overwrite the /system/models `allowed_models` map and clear the cache.","operationId":"update_models_api_v1_admin_models_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateModelsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsMapResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/users/search":{"get":{"tags":["admin-users"],"summary":"Search Users","description":"Case-insensitive substring search over user email and display name.\n\nSync `def` so the blocking Firestore scan runs in a threadpool.","operationId":"search_users_api_v1_admin_users_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":128,"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__admin_users__UserSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/token-usage":{"get":{"tags":["admin-users"],"summary":"Get User Token Usage Admin","description":"Return the token usage summary for any user.","operationId":"get_user_token_usage_admin_api_v1_admin_users__user_id__token_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/token-limit":{"put":{"tags":["admin-users"],"summary":"Set User Token Limit Admin","description":"Override a user's monthly token limit. 0 or negative grants unlimited.","operationId":"set_user_token_limit_admin_api_v1_admin_users__user_id__token_limit_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetTokenLimitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/settings":{"get":{"tags":["admin-settings"],"summary":"Get Settings","description":"Return the current system settings.\n\nSync `def` so the blocking Firestore read runs in a threadpool.","operationId":"get_settings_api_v1_admin_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettings"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["admin-settings"],"summary":"Update Settings","description":"Overwrite the managed system settings and clear the cache.\n\nUnmanaged top-level keys already in the document are preserved.","operationId":"update_settings_api_v1_admin_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettings"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemSettings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/groups/sync":{"post":{"tags":["admin-groups"],"summary":"Sync Group Claims","description":"Run the Entra → Firebase ``billie_group_ids`` claims sync for all users.\n\nPass ``dry_run=true`` to preview what would change without writing claims.","operationId":"sync_group_claims_api_v1_admin_groups_sync_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Dry Run"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/pipelines/feedback":{"get":{"tags":["admin-pipelines"],"summary":"Feedback Pipeline Status","description":"Current Fivetran state of the feedback-export connection.\n\nSync ``def`` so the blocking HTTP call runs in a threadpool.","operationId":"feedback_pipeline_status_api_v1_admin_pipelines_feedback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackPipelineStatus"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/pipelines/feedback/trigger":{"post":{"tags":["admin-pipelines"],"summary":"Trigger Feedback Pipeline Run","description":"Start a feedback-export sync now instead of waiting for the schedule.\n\nPass ``{\"force\": true}`` to cancel and restart a sync that is already running.","operationId":"trigger_feedback_pipeline_run_api_v1_admin_pipelines_feedback_trigger_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FeedbackPipelineTriggerRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackPipelineTriggerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/servers":{"get":{"tags":["mcp"],"summary":"List Mcp Servers","description":"List available MCP servers.\nReturns information about all MCP servers that can be configured,\nincluding their names and descriptions.","operationId":"list_mcp_servers_api_v1_mcp_servers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPServersResponse"}}}}}}},"/api/v1/mcp/credentials":{"get":{"tags":["mcp"],"summary":"Get Credentials Status","description":"Get status of user's MCP credentials.\nReturns which MCP servers the user has configured credentials for.\nDoes not return the actual credential values for security.","operationId":"get_credentials_status_api_v1_mcp_credentials_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPCredentialsStatusResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["mcp"],"summary":"Set Credentials","description":"Set MCP credentials for a specific server.\nAllows users to configure their own credentials for MCP servers,\nwhich will be used instead of organization-wide defaults.\n\nFor Freshservice:\n- api_key: Your Freshservice API key\n- domain: Your Freshservice domain (e.g., yourcompany.freshservice.com)\n\nAtlassian (Jira + Confluence) does not take credentials here: each user\nauthorizes their own account through POST /api/v1/mcp/atlassian/authorize,\nand the remaining Atlassian settings are operator-level site configuration.","operationId":"set_credentials_api_v1_mcp_credentials_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMCPCredentialsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMCPCredentialsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/credentials/{server_name}":{"delete":{"tags":["mcp"],"summary":"Delete Credentials","description":"Delete MCP credentials for a specific server.\nRemoves user-specific credentials, falling back to organization-wide defaults.","operationId":"delete_credentials_api_v1_mcp_credentials__server_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMCPCredentialsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp/atlassian/authorize":{"post":{"tags":["mcp-oauth"],"summary":"Authorize","description":"Start the OAuth flow and hand the browser an authorization URL.","operationId":"authorize_api_v1_mcp_atlassian_authorize_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/atlassian/callback":{"get":{"tags":["mcp-oauth"],"summary":"Callback","description":"OAuth redirect target.\n\nDeliberately unauthenticated — the browser arrives here from Atlassian\nwithout Billie's bearer token. The single-use ``state`` minted in\n/authorize binds this callback to the user who started it, and the\nHttpOnly nonce cookie set alongside it binds it to their browser, so a\nforwarded authorization URL can't graft someone else's consent onto the\ninitiator's account.","operationId":"callback_api_v1_mcp_atlassian_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp/atlassian/status":{"get":{"tags":["mcp-oauth"],"summary":"Status","description":"Whether this user has connected their Atlassian account.","operationId":"status_api_v1_mcp_atlassian_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__mcp_oauth__StatusResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/atlassian/disconnect":{"post":{"tags":["mcp-oauth"],"summary":"Disconnect Account","description":"Forget this user's Atlassian tokens.","operationId":"disconnect_account_api_v1_mcp_atlassian_disconnect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/m365/authorize":{"post":{"tags":["mcp-oauth"],"summary":"Authorize","description":"Start the Entra sign-in and hand the browser its authorization URL.","operationId":"authorize_api_v1_mcp_m365_authorize_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/m365/callback":{"get":{"tags":["mcp-oauth"],"summary":"Callback","description":"Entra's redirect target.\n\nUnauthenticated by necessity — the browser arrives from Entra without\nBillie's bearer. The single-use ``state`` binds it to the user who started\nthe flow, and the nonce cookie binds it to their browser.","operationId":"callback_api_v1_mcp_m365_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp/m365/status":{"get":{"tags":["mcp-oauth"],"summary":"Status","description":"Whether this user has connected Microsoft 365 for scheduled prompts.","operationId":"status_api_v1_mcp_m365_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__m365_oauth__StatusResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/m365/disconnect":{"post":{"tags":["mcp-oauth"],"summary":"Disconnect Account","description":"Forget this user's Microsoft 365 grant (success whether or not one existed).","operationId":"disconnect_account_api_v1_mcp_m365_disconnect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/lattice/authorize":{"post":{"tags":["mcp-oauth"],"summary":"Authorize","description":"Start the Lattice sign-in and hand the browser its authorization URL.","operationId":"authorize_api_v1_mcp_lattice_authorize_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/lattice/callback":{"get":{"tags":["mcp-oauth"],"summary":"Callback","description":"Lattice's redirect target.\n\nUnauthenticated by necessity — the browser arrives from Lattice without\nBillie's bearer. The single-use ``state`` binds it to the user who started\nthe flow, and the nonce cookie binds it to their browser.","operationId":"callback_api_v1_mcp_lattice_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp/lattice/status":{"get":{"tags":["mcp-oauth"],"summary":"Status","description":"Whether this user has connected Lattice.","operationId":"status_api_v1_mcp_lattice_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__lattice_oauth__StatusResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/lattice/disconnect":{"post":{"tags":["mcp-oauth"],"summary":"Disconnect Account","description":"Revoke and forget this user's Lattice grant (success whether or not one existed).","operationId":"disconnect_account_api_v1_mcp_lattice_disconnect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/prototype-continuations/{cid}":{"get":{"tags":["prototype-continuations"],"summary":"Get Continuation","operationId":"get_continuation_api_v1_prototype_continuations__cid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","title":"Cid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["prototype-continuations"],"summary":"Delete Continuation","operationId":"delete_continuation_api_v1_prototype_continuations__cid__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","title":"Cid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp/tools":{"get":{"tags":["mcp-tools"],"summary":"Connection Tools","operationId":"connection_tools_api_v1_mcp_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/geocode/search":{"get":{"tags":["geocode"],"summary":"Geocode Search","description":"Forward-geocode a place name / address via Nominatim.","operationId":"geocode_search_api_v1_geocode_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","description":"Free-text address or place name","title":"Q"},"description":"Free-text address or place name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{},"title":"Response Geocode Search Api V1 Geocode Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/geocode/reverse":{"get":{"tags":["geocode"],"summary":"Geocode Reverse","description":"Reverse-geocode lat/lon to a place description via Nominatim.","operationId":"geocode_reverse_api_v1_geocode_reverse_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lat","in":"query","required":true,"schema":{"type":"number","maximum":90,"minimum":-90,"title":"Lat"}},{"name":"lon","in":"query","required":true,"schema":{"type":"number","maximum":180,"minimum":-180,"title":"Lon"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Geocode Reverse Api V1 Geocode Reverse Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/compare":{"post":{"tags":["comparison"],"summary":"Compare Documents","description":"Compare two documents and stream a structured coverage report as NDJSON.\n\nAccepts each document as either a direct file upload or a download URL\n(e.g. Firebase Storage signed URL for project files already uploaded).","operationId":"compare_documents_api_v1_documents_compare_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_compare_documents_api_v1_documents_compare_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/deep-research/start":{"post":{"tags":["deep-research"],"summary":"Start Research","description":"Kick off a new Deep Research session in collaborative-planning mode.","operationId":"start_research_api_v1_deep_research_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartResearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionSnapshot"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/deep-research/{session_id}/revise":{"post":{"tags":["deep-research"],"summary":"Revise Research","description":"Refine the existing plan based on user feedback. Stays in collaborative mode.","operationId":"revise_research_api_v1_deep_research__session_id__revise_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisePlanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionSnapshot"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deep-research/{session_id}/execute":{"post":{"tags":["deep-research"],"summary":"Execute Research","description":"Approve the plan and start the long-running research execution.","operationId":"execute_research_api_v1_deep_research__session_id__execute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionSnapshot"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deep-research":{"get":{"tags":["deep-research"],"summary":"List Sessions","description":"List the user's recent Deep Research sessions.\n\nReturns cached Firestore state only (no Google API calls).\nFrontend uses Firestore onSnapshot for real-time updates.","operationId":"list_sessions_api_v1_deep_research_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Active Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Sessions Api V1 Deep Research Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deep-research/{session_id}":{"get":{"tags":["deep-research"],"summary":"Get Session","description":"Return the current snapshot. Re-syncs from Google if not in a terminal state.","operationId":"get_session_api_v1_deep_research__session_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionSnapshot"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["deep-research"],"summary":"Delete Session","operationId":"delete_session_api_v1_deep_research__session_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deep-research/{session_id}/cancel":{"post":{"tags":["deep-research"],"summary":"Cancel Session","operationId":"cancel_session_api_v1_deep_research__session_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionSnapshot"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deep-research/{session_id}/stream":{"get":{"tags":["deep-research"],"summary":"Stream Session","description":"Server-Sent Events stream with hybrid streaming approach.\n\nAttempts Google SDK streaming first for real-time updates, with automatic\nfallback to polling if SDK streaming fails. This provides:\n- SDK streaming: Real-time deltas, lower latency, avoids race conditions\n- Polling fallback: Reliability for SDK connection issues or edge cases","operationId":"stream_session_api_v1_deep_research__session_id__stream_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"last_event_id","in":"query","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"}}}}}}},"/api/v1/deep-research/{session_id}/pdf":{"get":{"tags":["deep-research"],"summary":"Export Pdf","description":"Generate the final report as a PDF and stream it to the client.\n\nWhy we stream rather than upload+sign:\n  - Firebase Storage signed URLs require a private signing key, which is\n    not exposed when the server runs under Application Default Credentials\n    (the `AttributeError` path inside `generate_signed_url`). Streaming the\n    bytes back removes that infrastructure dependency entirely.\n  - Re-rendering a 200 KB PDF takes <1 s, so caching has no real benefit.","operationId":"export_pdf_api_v1_deep_research__session_id__pdf_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deep-research/{session_id}/context-preview":{"post":{"tags":["deep-research"],"summary":"Context Preview","description":"Return token-impact data for both 'full report' and 'summary' options.\n\nGenerates the summary on-demand using the configured summarization LLM and\ncaches it on the session document so repeated previews are free. The full\nreport markdown is intentionally NOT echoed back — the caller (the panel)\nalready has it from the session snapshot.","operationId":"context_preview_api_v1_deep_research__session_id__context_preview_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/long-videos/{job_id}":{"get":{"tags":["long-videos"],"summary":"Get Long Video","operationId":"get_long_video_api_v1_long_videos__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Long Video Api V1 Long Videos  Job Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/long-videos/{job_id}/advance":{"post":{"tags":["long-videos"],"summary":"Advance Long Video","description":"Run the next step (one shot, the music, or the assembly). Returns progress.","operationId":"advance_long_video_api_v1_long_videos__job_id__advance_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Advance Long Video Api V1 Long Videos  Job Id  Advance Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/long-videos/{job_id}/cancel":{"post":{"tags":["long-videos"],"summary":"Cancel Long Video","operationId":"cancel_long_video_api_v1_long_videos__job_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Long Video Api V1 Long Videos  Job Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/long-videos/{job_id}/resume":{"post":{"tags":["long-videos"],"summary":"Resume Long Video","operationId":"resume_long_video_api_v1_long_videos__job_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resume Long Video Api V1 Long Videos  Job Id  Resume Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/litigation/folders":{"get":{"tags":["litigation"],"summary":"List Litigation Folders","description":"List available case folder names.\n\nReturns validated_folders from the config JSON if available,\notherwise falls back to the full Firestore folder list.","operationId":"list_litigation_folders_api_v1_litigation_folders_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LitigationFoldersResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/litigation/facets":{"get":{"tags":["litigation"],"summary":"List Litigation Facets","description":"Return available filter facets (document_type, discipline, etc.) and their values.","operationId":"list_litigation_facets_api_v1_litigation_facets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LitigationFacetsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/litigation/query-stream":{"post":{"tags":["litigation"],"summary":"Litigation Query Stream","description":"Stream a litigation RAG chat response as NDJSON.\n\nCreates a LangGraph agent with a litigation-specific RAG tool.\nIf folder_name is provided, results are restricted to that folder;\notherwise all folders are searched.","operationId":"litigation_query_stream_api_v1_litigation_query_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LitigationQueryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/litigation/auto-tag":{"post":{"tags":["litigation"],"summary":"Auto Tag Litigation Conversation","description":"Classify a litigation conversation into a legal category.\n\nRestricted to billeConfidential group members.\nUses a fast LLM call — fails open with [\"litigation\"] on any error.","operationId":"auto_tag_litigation_conversation_api_v1_litigation_auto_tag_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LitigationAutoTagRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LitigationAutoTagResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/litigation/group-members":{"get":{"tags":["litigation"],"summary":"List Group Members","description":"List all members of the billeConfidential Entra ID group.\n\nUsed by the share picker to restrict targets to valid group members.\nQueries BigQuery (Fivetran-synced Entra ID) then cross-references Firestore.","operationId":"list_group_members_api_v1_litigation_group_members_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/GroupMemberInfo"},"type":"array","title":"Response List Group Members Api V1 Litigation Group Members Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/litigation/conversations/{chat_id}/share":{"post":{"tags":["litigation"],"summary":"Share Litigation Chat","description":"Share a litigation chat with another billeConfidential member by email.\n\nOnly the chat owner can share. Target must be in the billeConfidential group.\nUsers who have not logged in yet are supported — their email is stored in\nsharedWithEmails so Firestore rules can grant access via auth token email.","operationId":"share_litigation_chat_api_v1_litigation_conversations__chat_id__share_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["litigation"],"summary":"Unshare Litigation Chat","description":"Remove a user from a shared litigation chat.\n\nOnly the chat owner can unshare. Accepts target_email (not UID) so that\nusers who haven't logged in yet can still be removed.","operationId":"unshare_litigation_chat_api_v1_litigation_conversations__chat_id__share_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}},{"name":"target_email","in":"query","required":true,"schema":{"type":"string","description":"Email of the user to unshare with","title":"Target Email"},"description":"Email of the user to unshare with"},{"name":"owner_user_id","in":"query","required":true,"schema":{"type":"string","title":"Owner User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/litigation/conversations/shared-with-me":{"get":{"tags":["litigation"],"summary":"Get Shared Litigation Chats","description":"List litigation chats involving the current user in any sharing direction.\n\nReturns chats where:\n1. Someone shared a chat WITH the current user (sharedWith/sharedWithEmails)\n2. The current user shared their OWN chat with others (sharedWithEmails non-empty)\n\nResults are merged and deduplicated.","operationId":"get_shared_litigation_chats_api_v1_litigation_conversations_shared_with_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SharedChatSummary"},"type":"array","title":"Response Get Shared Litigation Chats Api V1 Litigation Conversations Shared With Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/litigation/query-stream-test":{"post":{"tags":["litigation"],"summary":"Litigation Query Stream Test","description":"Simplified test endpoint for litigation RAG queries.","operationId":"litigation_query_stream_test_api_v1_litigation_query_stream_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LitigationQueryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/litigation/folders-test":{"get":{"tags":["litigation"],"summary":"List Litigation Folders Test","description":"Simplified test endpoint for folder listing.","operationId":"list_litigation_folders_test_api_v1_litigation_folders_test_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/litigation/resolve-source-url":{"post":{"tags":["litigation"],"summary":"Resolve Source Url","description":"Search SharePoint for a litigation document and return its current URL.\n\nUses a dedicated high-privilege service principal (LITIGATION_SP_CLIENT_ID/SECRET)\nto authenticate with Microsoft Graph and resolve file paths within the\nlitigation SharePoint site.","operationId":"resolve_source_url_api_v1_litigation_resolve_source_url_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveSourceUrlRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveSourceUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/litigation/test-source-url":{"get":{"tags":["litigation"],"summary":"Test Source Url","description":"Test the SharePoint URL construction for a given source_path.","operationId":"test_source_url_api_v1_litigation_test_source_url_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_path","in":"query","required":true,"schema":{"type":"string","description":"e.g. 2024-10-01 Resources/Resources - Files/doc.pdf","title":"Source Path"},"description":"e.g. 2024-10-01 Resources/Resources - Files/doc.pdf"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/internal/batch-auto-tag":{"post":{"tags":["internal"],"summary":"Batch Auto Tag","description":"Resume the nightly chat/turn NLP sweep and legacy auto-tagging.\n\nAuth: X-Batch-Secret header must match BATCH_AUTO_TAG_SECRET.\nThe Cloud Run job is scheduled at 7 AM America/New_York.","operationId":"batch_auto_tag_api_v1_internal_batch_auto_tag_post","parameters":[{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Dry Run"}},{"name":"X-Batch-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Batch-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchAutoTagResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/internal/agent/query-stream":{"post":{"tags":["internal"],"summary":"Internal Agent Query Stream","description":"Internal streaming endpoint for the Teams bot and the scheduled-task executor.\n\nAuth: either the X-Teams-Bot-Secret shared secret (Teams) or a Google OIDC\nbearer from the internal-agent caller SA (scheduled tasks). Running the agent\nas an arbitrary owner (owner_user_id) requires the OIDC path. User identity\nis provided in the request body, not via a Firebase token.","operationId":"internal_agent_query_stream_api_v1_internal_agent_query_stream_post","parameters":[{"name":"X-Teams-Bot-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Teams-Bot-Secret"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalAgentQueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/internal/scheduled-tasks/execute":{"post":{"tags":["internal"],"summary":"Execute Scheduled Task","description":"Run one due scheduled task. See module docstring for the status contract.","operationId":"execute_scheduled_task_api_v1_internal_scheduled_tasks_execute_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/prompts/{prompt_id}/run":{"post":{"tags":["prompts"],"summary":"Run Prompt Now","description":"Run one of the caller's saved prompts now, exactly as its schedule would.\n\nSame execute_task, so the same agent (Quick mode with the owner's Microsoft\n365 when they connected it), the same run history and notification. The\nresult always lands in a new chat, which the UI opens; it is also emailed\nwhen the prompt has a schedule with \"Email me\" on, as a scheduled run would.\nThe schedule itself is left alone — the next scheduled run stays put.\n\nAnswers when the run is over (up to the agent's timeout). The run is\nshielded from a dropped connection, so closing the tab does not lose it:\nthe chat and the notification still arrive.","operationId":"run_prompt_now_api_v1_prompts__prompt_id__run_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prompt_id","in":"path","required":true,"schema":{"type":"string","title":"Prompt Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RunNowRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunNowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/exports/render":{"post":{"tags":["exports"],"summary":"Render Export","description":"Render markdown to CSV or PDF and return the file bytes directly.","operationId":"render_export_api_v1_exports_render_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderExportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/exports/{export_id}/{filename}":{"get":{"tags":["exports"],"summary":"Download Export","description":"Download one of the caller's own exports.","operationId":"download_export_api_v1_exports__export_id___filename__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"export_id","in":"path","required":true,"schema":{"type":"string","title":"Export Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/presentations/{deck_id}":{"get":{"tags":["presentations"],"summary":"Get Presentation","operationId":"get_presentation_api_v1_presentations__deck_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/presentations/{deck_id}/finalize":{"post":{"tags":["presentations"],"summary":"Finalize Presentation","operationId":"finalize_presentation_api_v1_presentations__deck_id__finalize_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinalizeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/images/download":{"post":{"tags":["images"],"summary":"Download Image","operationId":"download_image_api_v1_images_download_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageDownloadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/images/upscale":{"post":{"tags":["images"],"summary":"Upscale","operationId":"upscale_api_v1_images_upscale_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PinnedImageRef"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/charrette/deploy":{"post":{"tags":["charrette"],"summary":"Deploy Prototype","description":"Create a charrette prototype from an HTML document. Returns id, url and initial status.","operationId":"deploy_prototype_api_v1_charrette_deploy_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CharretteDeployRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/charrette/prototypes":{"get":{"tags":["charrette"],"summary":"List Prototypes","description":"List prototypes owned by the caller for Billie's overwrite selector.","operationId":"list_prototypes_api_v1_charrette_prototypes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/charrette/prototypes/{prototype_id}":{"put":{"tags":["charrette"],"summary":"Redeploy Prototype","description":"Replace an existing owned Charrette prototype with a new HTML version.","operationId":"redeploy_prototype_api_v1_charrette_prototypes__prototype_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prototype_id","in":"path","required":true,"schema":{"type":"string","title":"Prototype Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CharretteRedeployRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["charrette"],"summary":"Get Prototype","description":"Deployment progress for one prototype (polled by the chat UI until ready/failed).","operationId":"get_prototype_api_v1_charrette_prototypes__prototype_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prototype_id","in":"path","required":true,"schema":{"type":"string","title":"Prototype Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/charrette/prototypes/{prototype_id}/source":{"get":{"tags":["charrette"],"summary":"Get Prototype Source","description":"The latest HTML Billie published for a prototype the caller may view, to branch from.","operationId":"get_prototype_source_api_v1_charrette_prototypes__prototype_id__source_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prototype_id","in":"path","required":true,"schema":{"type":"string","title":"Prototype Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/charrette/prototypes/{prototype_id}/branches":{"get":{"tags":["charrette"],"summary":"List Prototype Branches","description":"Prototypes branched from this one through Billie, most recently updated first.\n\nThe parent's owner sees every branch (that is how a branch gets merged back);\nanyone else sees only their own. A colleague's branch can be restricted in\ncharrette, and viewing the parent is no reason to learn that it exists.","operationId":"list_prototype_branches_api_v1_charrette_prototypes__prototype_id__branches_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prototype_id","in":"path","required":true,"schema":{"type":"string","title":"Prototype Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/camber/library":{"get":{"tags":["camber"],"summary":"Library","description":"The Camber workflows and agents this person can use, or why there are none.","operationId":"library_api_v1_camber_library_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Library Api V1 Camber Library Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/camber/workflows/{workflow_id}/runs":{"post":{"tags":["camber"],"summary":"Run Workflow","description":"Start one of the caller's workflows as them. The click is the consent.","operationId":"run_workflow_api_v1_camber_workflows__workflow_id__runs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunWorkflowBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Workflow Api V1 Camber Workflows  Workflow Id  Runs Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/camber/runs/{run_id}":{"get":{"tags":["camber"],"summary":"Get Run","description":"A run's status and, once finished, its deliverable.","operationId":"get_run_api_v1_camber_runs__run_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Run Api V1 Camber Runs  Run Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/healthplan/program-drafts":{"post":{"tags":["healthplan"],"summary":"Send Program Draft","description":"Stage the draft in HealthPlan for the named planner. A resend of the same\nmessage refreshes the pending draft rather than making a second one.","operationId":"send_program_draft_api_v1_healthplan_program_drafts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramDraft"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/healthplan/program-drafts/by-source/{message_id}":{"get":{"tags":["healthplan"],"summary":"Find Program Draft","description":"The draft this user sent from a chat message, if any: how the card finds its\ndraft again after a reload. HealthPlan derives the id from the caller and the\nmessage, so nobody can look up another person's draft this way.","operationId":"find_program_draft_api_v1_healthplan_program_drafts_by_source__message_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Find Program Draft Api V1 Healthplan Program Drafts By Source  Message Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/healthplan/program-drafts/{draft_id}":{"get":{"tags":["healthplan"],"summary":"Get Program Draft","description":"The draft's review status, as HealthPlan reports it to its submitter.","operationId":"get_program_draft_api_v1_healthplan_program_drafts__draft_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","title":"Draft Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Program Draft Api V1 Healthplan Program Drafts  Draft Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/healthplan/care-model-drafts":{"post":{"tags":["healthplan"],"summary":"Send Care Model Draft","description":"Stage the care model in CDesign Studio for the named planner. A resend of the same\nmessage refreshes the pending draft rather than making a second one.","operationId":"send_care_model_draft_api_v1_healthplan_care_model_drafts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CareModelDraft"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/healthplan/care-model-drafts/by-source/{message_id}":{"get":{"tags":["healthplan"],"summary":"Find Care Model Draft","description":"The care model this user sent from a chat message, if any (CDesign Studio keys it by caller\nand message, so nobody can look up another person's).","operationId":"find_care_model_draft_api_v1_healthplan_care_model_drafts_by_source__message_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Find Care Model Draft Api V1 Healthplan Care Model Drafts By Source  Message Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/healthplan/care-model-drafts/{draft_id}":{"get":{"tags":["healthplan"],"summary":"Get Care Model Draft","description":"The care model's review status, as CDesign Studio reports it to its submitter.","operationId":"get_care_model_draft_api_v1_healthplan_care_model_drafts__draft_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","title":"Draft Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Care Model Draft Api V1 Healthplan Care Model Drafts  Draft Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps":{"get":{"tags":["code"],"summary":"List Apps","operationId":"list_apps_api_v1_code_apps_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["code"],"summary":"Create App","description":"Create an app from a brief (and start building it), or from a chat prototype\n(saved as v1, ready to continue; building starts only if an instruction came too).","operationId":"create_app_api_v1_code_apps_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewAppRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/code/apps/{app_id}":{"get":{"tags":["code"],"summary":"Get App","description":"The app, its turns and versions, and the files of ``version`` (default: the latest).","operationId":"get_app_api_v1_code_apps__app_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["code"],"summary":"Delete App","description":"Soft delete: the app leaves every list; its versions and data are kept. A running turn is stopped.","operationId":"delete_app_api_v1_code_apps__app_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/versions/{version}/gate":{"post":{"tags":["code"],"summary":"Rerun Gate","description":"Run the gate again on a saved version, from round 1 (e.g. after a reviewer was unavailable).","operationId":"rerun_gate_api_v1_code_apps__app_id__versions__version__gate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/versions/{version}/gate/report":{"post":{"tags":["code"],"summary":"Report False Positive","description":"Tell an admin a blocking finding looks wrong. The block stands: a version still needs a fix to pass.","operationId":"report_false_positive_api_v1_code_apps__app_id__versions__version__gate_report_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FalsePositiveReport"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/gate/fix":{"post":{"tags":["code"],"summary":"Fix Blocked","description":"Ask Billie to fix the blocking findings of the last gated version (after the automatic rounds ran out).","operationId":"fix_blocked_api_v1_code_apps__app_id__gate_fix_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/turns":{"post":{"tags":["code"],"summary":"Add Turn","description":"Ask for a change. One turn at a time per app.","operationId":"add_turn_api_v1_code_apps__app_id__turns_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/poll":{"post":{"tags":["code"],"summary":"Poll App","description":"The app's current state. The runner does the work; a poll only re-kicks a runner\nthat has stopped (a lost instance), so closing the tab never stops a build.","operationId":"poll_app_api_v1_code_apps__app_id__poll_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/cancel":{"post":{"tags":["code"],"summary":"Cancel Turn","operationId":"cancel_turn_api_v1_code_apps__app_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/data":{"get":{"tags":["code"],"summary":"Data Status","operationId":"data_status_api_v1_code_apps__app_id__data_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/data/{collection}":{"get":{"tags":["code"],"summary":"Data List","operationId":"data_list_api_v1_code_apps__app_id__data__collection__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"collection","in":"path","required":true,"schema":{"type":"string","title":"Collection"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"includeDeleted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Includedeleted"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["code"],"summary":"Data Create","operationId":"data_create_api_v1_code_apps__app_id__data__collection__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"collection","in":"path","required":true,"schema":{"type":"string","title":"Collection"}},{"name":"id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/data/{collection}/{doc_id}":{"get":{"tags":["code"],"summary":"Data Get","operationId":"data_get_api_v1_code_apps__app_id__data__collection___doc_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"collection","in":"path","required":true,"schema":{"type":"string","title":"Collection"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["code"],"summary":"Data Patch","operationId":"data_patch_api_v1_code_apps__app_id__data__collection___doc_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"collection","in":"path","required":true,"schema":{"type":"string","title":"Collection"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"deleted","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Deleted"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/data/{rest}":{"delete":{"tags":["code"],"summary":"Data Delete","operationId":"data_delete_api_v1_code_apps__app_id__data__rest__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"rest","in":"path","required":true,"schema":{"type":"string","title":"Rest"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/data-reset":{"post":{"tags":["code"],"summary":"Data Reset","description":"Start an empty preview dataset. The old one is kept, not deleted.","operationId":"data_reset_api_v1_code_apps__app_id__data_reset_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/deploy":{"post":{"tags":["code"],"summary":"Deploy App","description":"Deploy a version to charrette: a new prototype the first time, the next version of it after.\nAn app that uses the data store gets charrette's store turned on (it is off by default).","operationId":"deploy_app_api_v1_code_apps__app_id__deploy_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["code"],"summary":"Deploy Status","description":"Charrette's build status for the app's prototype, and its security review of this deploy.\n\nPoll until ``scanState`` is no longer \"pending\": \"passed\", \"blocked\" (the deployed\nversion is now blocked and may be getting a fix turn; reload the app), \"unavailable\"\n(the review was skipped or couldn't run; shown, not blocking) or \"none\" (the deploy\nended without a review of its own, e.g. its build failed first). Every read records\nthe review into the deployed version's gate (once per scan), so a review that lands\nafter the browser stopped watching is recorded the next time anyone opens the app.","operationId":"deploy_status_api_v1_code_apps__app_id__deploy_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/apps/{app_id}/datastore":{"post":{"tags":["code"],"summary":"Enable Datastore","description":"Turn on (or extend the check of) charrette's data store for the deployed app.","operationId":"enable_datastore_api_v1_code_apps__app_id__datastore_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/events":{"post":{"tags":["code"],"summary":"Client Event","description":"Interface events the server can't see (Build opened, preview viewed, Open in Build clicked).","operationId":"client_event_api_v1_code_events_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientEvent"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/code/usage":{"get":{"tags":["code"],"summary":"My Usage","description":"The caller's Build token usage: totals, this month, by model and by phase.","operationId":"my_usage_api_v1_code_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/code/admin/usage":{"get":{"tags":["code"],"summary":"All Usage","description":"Everyone's Build token usage, biggest first. Admins only.","operationId":"all_usage_api_v1_code_admin_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/code/admin/tickets":{"get":{"tags":["code"],"summary":"Admin Tickets","description":"Blocked Build versions for admins to see: one ticket per app, open until a version passes.","operationId":"admin_tickets_api_v1_code_admin_tickets_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"open","title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/admin/tickets/{app_id}/resolve":{"post":{"tags":["code"],"summary":"Admin Resolve Ticket","description":"Close a ticket with a note. This never unblocks a version.","operationId":"admin_resolve_ticket_api_v1_code_admin_tickets__app_id__resolve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/admin/usage/{uid}/limit":{"put":{"tags":["code"],"summary":"Admin Set Limit","description":"Set a person's monthly Build allowance (0 = unlimited, null = the default).","operationId":"admin_set_limit_api_v1_code_admin_usage__uid__limit_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","title":"Uid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LimitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/code/admin/membership/sweep":{"post":{"tags":["code"],"summary":"Admin Sweep","description":"Check every app owner against sgBillieCodeUsers live; archive the apps of anyone who left.","operationId":"admin_sweep_api_v1_code_admin_membership_sweep_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/code/admin/metrics":{"get":{"tags":["code"],"summary":"Pilot Metrics","description":"The pilot's success measures. Admins only (they needn't be in the pilot group).","operationId":"pilot_metrics_api_v1_code_admin_metrics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":42,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/internal/code/run/{app_id}":{"post":{"tags":["code-internal"],"summary":"Run App","description":"Drive one app's running turn, then its gate, for up to the runner budget, then hand off.\n\nThe successor is kicked here, after run_until_settled has released the lease;\nkicked from inside it, the successor would find the lease held and stand down.\nCalled only by this service itself (engine.kick), with a Google OIDC token for\nits own runtime service account. Anyone else gets 403.","operationId":"run_app_api_v1_internal_code_run__app_id__post","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp-connector/info":{"get":{"tags":["mcp-connector"],"summary":"Connector Info","description":"The URL to add in Claude, and whether this user may connect.","operationId":"connector_info_api_v1_mcp_connector_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Connector Info Api V1 Mcp Connector Info Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp-connector/consent/{request_id}":{"get":{"tags":["mcp-connector"],"summary":"Get Consent","operationId":"get_consent_api_v1_mcp_connector_consent__request_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Consent Api V1 Mcp Connector Consent  Request Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["mcp-connector"],"summary":"Post Consent","operationId":"post_consent_api_v1_mcp_connector_consent__request_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDecision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Post Consent Api V1 Mcp Connector Consent  Request Id  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp-connector/grants":{"get":{"tags":["mcp-connector"],"summary":"Get Grants","description":"The apps the user has connected to Billie through the connector.","operationId":"get_grants_api_v1_mcp_connector_grants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Grants Api V1 Mcp Connector Grants Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp-connector/grants/{grant_id}":{"delete":{"tags":["mcp-connector"],"summary":"Delete Grant","operationId":"delete_grant_api_v1_mcp_connector_grants__grant_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"grant_id","in":"path","required":true,"schema":{"type":"string","title":"Grant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Delete Grant Api V1 Mcp Connector Grants  Grant Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/{full_path}":{"get":{"summary":"Serve React App","description":"Serve React SPA for all non-API routes.\nThis allows React Router to handle client-side routing.\n\nCache strategy:\n- index.html: no-cache (always fetch fresh to get latest JS/CSS hashes)\n- Hashed assets (*.js, *.css with hash): cache for 1 year (immutable)\n- Other static files: cache for 1 hour","operationId":"serve_react_app__full_path__get","parameters":[{"name":"full_path","in":"path","required":true,"schema":{"type":"string","title":"Full Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AddMemberRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"AddMemberRequest"},"AddMemberResponse":{"properties":{"status":{"type":"string","title":"Status"},"project_id":{"type":"string","title":"Project Id"},"user_id":{"type":"string","title":"User Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","project_id","user_id","message"],"title":"AddMemberResponse"},"AgentQueryRequest":{"properties":{"message":{"type":"string","title":"Message"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"model_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Provider"},"model_name":{"type":"string","title":"Model Name","default":"gemini-4-hydrogen"},"enable_tools":{"items":{"type":"string"},"type":"array","title":"Enable Tools","default":["rag","web_search","image_generation","video_generation","calculator","mermaid"]},"temperature":{"type":"number","title":"Temperature","default":0.0},"conversation_history":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Conversation History"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"location":{"anyOf":[{"$ref":"#/components/schemas/LocationContext"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"confidential":{"type":"boolean","title":"Confidential","default":false},"confidential_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidential Session Id"},"quick_mode":{"type":"boolean","title":"Quick Mode","default":false},"image_quality":{"type":"string","title":"Image Quality","default":"1k"},"emulate_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Emulate User Email","description":"Admin-only: Email of user to emulate for testing user-specific responses"},"reference_image_b64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Image B64","description":"Raw base64 image data (no data URI prefix) uploaded from the PromptGallery wizard. When present the image-generation tool uses edit/reference mode instead of generating from scratch, preserving the 3D composition of the uploaded render."},"recent_ai_video":{"type":"boolean","title":"Recent Ai Video","description":"Whether one of the last few assistant turns produced a video. Keeps generate_video bound for follow-ups that edit or extend it ('add the street entrance', 'make it longer') without the words the keyword gate looks for. Same role recent_atlassian_tool_use plays for Jira.","default":false},"renders":{"items":{"type":"string"},"type":"array","title":"Renders","description":"Media this client can show beyond text, images and plain videos: 'audio' (the generated-audio player) and 'long_video' (the long-video progress card, which also drives the job's steps). generate_music/generate_speech and generate_long_video are bound only when the client says it renders their result, so a client without those cards is never handed one."},"recent_atlassian_tool_use":{"type":"boolean","title":"Recent Atlassian Tool Use","description":"Whether the most recent assistant turn in this thread actually used a Jira or Confluence tool. Keeps those tools bound for follow-ups that carry no Jira vocabulary of their own — 'can you check again?', 'please try again' — which the keyword gate cannot recognise. Same role last_ai_image_url plays for image edits; the Python path only receives the current turn in conversation_history, so the client is the one that knows.","default":false},"recent_prototype":{"type":"boolean","title":"Recent Prototype","description":"Whether the most recent assistant turn is a whole HTML page (a prototype card). Makes a change request that never says 'page' ('only show workdays') a prototype turn, so the answer is the whole updated page. Like recent_atlassian_tool_use, the client knows because the Python path receives only the current turn.","default":false},"attached_data":{"type":"boolean","title":"Attached Data","description":"Whether the chat has an attached spreadsheet the client will serve to a page as ./data/rows.json (frontend utils/attachedData.ts). Tells the model to load the rows from that file instead of typing them into the page.","default":false},"last_ai_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Ai Image Url","description":"Firebase Storage download URL (or data URI) of the most recent AI-generated image in this conversation thread. When present the agent registers the `modify_last_image` tool so the model can edit the prior image without the user re-uploading it."},"recent_ai_image_urls":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":6},{"type":"null"}],"title":"Recent Ai Image Urls","description":"Every image of the most recent AI image turn, in the order they were shown. Lets `modify_last_image` target a specific option via its `which_image` argument ('refine the second one') instead of always editing the first. Falls back to last_ai_image_url when absent."},"recent_ai_image_ids":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"array","maxItems":6},{"type":"null"}],"title":"Recent Ai Image Ids","description":"The ids of recent_ai_image_urls, index for index (null where unknown)."},"attachment_image_ids":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"array","maxItems":16},{"type":"null"}],"title":"Attachment Image Ids","description":"Ids of the image parts of THIS message's content, in order (null where unknown). Recorded as the parents of what the image tools make from them."},"base_image":{"anyOf":[{"$ref":"#/components/schemas/PinnedImageRef"},{"type":"null"}],"description":"The pinned BASE image: the next render keeps its geometry, composition and camera (restyle_image). Outranks reference_image_b64 and a single attachment."},"style_images":{"anyOf":[{"items":{"$ref":"#/components/schemas/PinnedImageRef"},"type":"array","maxItems":3},{"type":"null"}],"title":"Style Images","description":"Pinned STYLE images, in order: their materials, lighting and palette are borrowed, never their geometry. Sent to the image model after the base."},"writing_style":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Writing Style","description":"User's preferred writing style, sanitized and injected into system prompt as aesthetic guidance."},"workiq_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workiq Token","description":"The calling user's Entra access token for the Work IQ Copilot MCP resource (Microsoft Agent 365, preview), acquired by the frontend via MSAL. Forwarded verbatim to the Go agent so its m365_copilot specialist queries Microsoft 365 Copilot as this user. Never logged or persisted."},"tool_confirmation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Confirmation","description":"The user's answer to a `tool_confirmation` stream event: {\"id\": <pending call id>, \"confirmed\": bool, \"hint\": str, \"original_call\": {\"id\", \"name\", \"args\", \"agent\"}, \"issued_at\", \"signature\"}. In quick mode this is a Work IQ mail/calendar write the Go agent paused on, forwarded verbatim to the bridge, which replays or drops it. On the standard path it is a Jira/Confluence write held by the MCP interceptor (tools/atlassian_confirmation.py), which re-verifies the signature, the TTL and that the call still matches before letting it run. Both paths sign with WORKIQ_CONFIRMATION_KEY; neither trusts this field's contents."},"reseed":{"anyOf":[{"$ref":"#/components/schemas/ReseedContext"},{"type":"null"}],"description":"Reset the thread's checkpoint to these messages, then run this turn on it, in this one request (DP-4938). Sent by regenerate (the history before the replaced answer) and by the first turn of a branch. An empty list clears the thread. Needs conversation_id. Replaces the separate /agent/seed-context call these flows used to make first, which the browser abandoned after 5 s while the server kept resetting the thread underneath the new turn."}},"type":"object","required":["message"],"title":"AgentQueryRequest"},"AggregatedToolEntry":{"properties":{"call_count":{"type":"integer","title":"Call Count"},"estimated_cost_usd":{"type":"number","title":"Estimated Cost Usd"},"user_count":{"type":"integer","title":"User Count"},"limit_exceeded_count":{"type":"integer","title":"Limit Exceeded Count"}},"type":"object","required":["call_count","estimated_cost_usd","user_count","limit_exceeded_count"],"title":"AggregatedToolEntry"},"AggregatedToolUsageResponse":{"properties":{"limit_period":{"type":"string","title":"Limit Period"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"tools":{"additionalProperties":{"$ref":"#/components/schemas/AggregatedToolEntry"},"type":"object","title":"Tools"},"total_calls":{"type":"integer","title":"Total Calls"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"user_count":{"type":"integer","title":"User Count"},"active_users":{"type":"integer","title":"Active Users"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["limit_period","period_start","period_end","tools","total_calls","total_cost_usd","user_count","active_users","updated_at"],"title":"AggregatedToolUsageResponse"},"AllUsersToolUsageResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/UserToolUsageSummary"},"type":"array","title":"Users"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["users","count"],"title":"AllUsersToolUsageResponse"},"ApplyContextSummaryRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"summary_markdown":{"type":"string","title":"Summary Markdown"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["conversation_id","messages","summary_markdown"],"title":"ApplyContextSummaryRequest"},"AuthorizeResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"}},"type":"object","required":["authorization_url"],"title":"AuthorizeResponse"},"AutoTagRequest":{"properties":{"messages":{"items":{"type":"string"},"type":"array","title":"Messages"}},"type":"object","required":["messages"],"title":"AutoTagRequest"},"AutoTagResponse":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","required":["tags"],"title":"AutoTagResponse"},"BatchAutoTagResponse":{"properties":{"status":{"type":"string","title":"Status"},"duration_seconds":{"type":"number","title":"Duration Seconds"},"total_docs":{"type":"integer","title":"Total Docs"},"personal_tagged":{"type":"integer","title":"Personal Tagged"},"project_tagged":{"type":"integer","title":"Project Tagged"},"hash_hit":{"type":"integer","title":"Hash Hit"},"indexed":{"type":"integer","title":"Indexed","default":0},"index_errors":{"type":"integer","title":"Index Errors","default":0},"errors":{"type":"integer","title":"Errors"},"skipped":{"type":"integer","title":"Skipped"},"dry_run":{"type":"boolean","title":"Dry Run"},"analyzed":{"type":"integer","title":"Analyzed","default":0},"turns_labeled":{"type":"integer","title":"Turns Labeled","default":0},"turns_reused":{"type":"integer","title":"Turns Reused","default":0},"stale":{"type":"integer","title":"Stale","default":0},"index_unavailable":{"type":"integer","title":"Index Unavailable","default":0},"purged":{"type":"integer","title":"Purged","default":0},"sweep_complete":{"type":"boolean","title":"Sweep Complete","default":false},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"busy":{"type":"boolean","title":"Busy","default":false}},"type":"object","required":["status","duration_seconds","total_docs","personal_tagged","project_tagged","hash_hit","errors","skipped","dry_run"],"title":"BatchAutoTagResponse"},"Body_compare_documents_api_v1_documents_compare_post":{"properties":{"file_a":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File A"},"file_b":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File B"},"file_a_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File A Url"},"file_b_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File B Url"},"file_a_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File A Name"},"file_b_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File B Name"},"comparison_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comparison Type","default":"General Comparison"}},"type":"object","title":"Body_compare_documents_api_v1_documents_compare_post"},"Body_extract_document_text_api_v1_pdf_extract_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"max_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Pages"}},"type":"object","required":["file"],"title":"Body_extract_document_text_api_v1_pdf_extract_post"},"Body_upload_confidential_document_api_v1_rag_confidential_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","required":["file"],"title":"Body_upload_confidential_document_api_v1_rag_confidential_upload_post"},"Body_upload_document_api_v1_rag_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["file"],"title":"Body_upload_document_api_v1_rag_upload_post"},"CanGenerateResponse":{"properties":{"can_generate":{"type":"boolean","title":"Can Generate","description":"Whether user can generate another video"},"videos_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Videos Remaining","description":"Videos remaining (null if unlimited)"},"limit_exceeded":{"type":"boolean","title":"Limit Exceeded","description":"True if limit is exceeded"},"video_limit":{"type":"integer","title":"Video Limit","description":"User's video limit"},"limit_period":{"type":"string","title":"Limit Period","description":"Period type (daily/weekly/monthly)"}},"type":"object","required":["can_generate","videos_remaining","limit_exceeded","video_limit","limit_period"],"title":"CanGenerateResponse","description":"Response for can-generate check."},"CareClient":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"camberClientId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"},{"type":"null"}],"title":"Camberclientid"}},"additionalProperties":false,"type":"object","required":["name"],"title":"CareClient"},"CareModelDraft":{"properties":{"schemaVersion":{"type":"integer","const":1,"title":"Schemaversion"},"source":{"$ref":"#/components/schemas/DraftSource"},"planner":{"$ref":"#/components/schemas/DraftPlanner"},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"title":"Duedate"},"client":{"$ref":"#/components/schemas/CareClient"},"studioProjectId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"},{"type":"null"}],"title":"Studioprojectid"},"horizonYear":{"type":"integer","maximum":2100.0,"minimum":2020.0,"title":"Horizonyear"},"shifts":{"items":{"$ref":"#/components/schemas/CareShift"},"type":"array","maxItems":50,"minItems":1,"title":"Shifts"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","required":["schemaVersion","source","planner","client","horizonYear","shifts"],"title":"CareModelDraft","description":"A CDesign Studio care-model draft, contract v1.1 (schemaVersion 1)."},"CareService":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"category":{"anyOf":[{"type":"string","enum":["Emergency & Trauma","Surgery & Interventional","Intensive Care","Inpatient Nursing","Diagnostic & Imaging","Ambulatory & Outpatient","Specialty & Rehab","Women & Children","Clinical Support","Logistics & Facilities","Administration & Public"]},{"type":"null"}],"title":"Category"},"templateId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"},{"type":"null"}],"title":"Templateid"}},"additionalProperties":false,"type":"object","required":["name"],"title":"CareService"},"CareShift":{"properties":{"service":{"$ref":"#/components/schemas/CareService"},"channel":{"type":"string","enum":["telehealth","hospital-at-home","remote-monitoring","virtual-nursing","tele-icu"],"title":"Channel"},"share":{"type":"number","maximum":0.9,"minimum":0.0,"title":"Share"},"demandKpu":{"anyOf":[{"type":"integer","maximum":100000.0,"minimum":1.0},{"type":"null"}],"title":"Demandkpu"},"rationale":{"type":"string","maxLength":2000,"minLength":1,"title":"Rationale"},"sources":{"items":{"$ref":"#/components/schemas/CareSource"},"type":"array","maxItems":10,"minItems":1,"title":"Sources"}},"additionalProperties":false,"type":"object","required":["service","channel","share","rationale","sources"],"title":"CareShift"},"CareSource":{"properties":{"title":{"type":"string","maxLength":300,"minLength":1,"title":"Title"},"url":{"anyOf":[{"type":"string","maxLength":2000,"pattern":"^https://\\S+$"},{"type":"null"}],"title":"Url"},"asOf":{"anyOf":[{"type":"string","pattern":"^\\d{4}(-\\d{2}){0,2}$"},{"type":"null"}],"title":"Asof"}},"additionalProperties":false,"type":"object","required":["title"],"title":"CareSource"},"CharretteDeployRequest":{"properties":{"name":{"type":"string","maxLength":63,"minLength":1,"title":"Name","description":"Prototype name; charrette slugifies it"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"html":{"type":"string","minLength":1,"title":"Html","description":"The complete HTML document to deploy"},"forkedFrom":{"anyOf":[{"type":"string","maxLength":63},{"type":"null"}],"title":"Forkedfrom","description":"Prototype this deploy branches from (the caller must be able to view it)"},"forkedFromVersion":{"anyOf":[{"type":"string","maxLength":80,"minLength":1},{"type":"null"}],"title":"Forkedfromversion","description":"Parent version loaded when the branch was opened"},"files":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Files","description":"JSON files published beside index.html, by path (data/*.json)"},"sharingScope":{"anyOf":[{"type":"string","enum":["all-staff","restricted"]},{"type":"null"}],"title":"Sharingscope","description":"Who can open the prototype. Omitted leaves it to charrette's default for new prototypes"}},"type":"object","required":["name","html"],"title":"CharretteDeployRequest"},"CharretteRedeployRequest":{"properties":{"html":{"type":"string","minLength":1,"title":"Html","description":"The complete replacement HTML document"},"message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Message","description":"Optional version note"},"files":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Files","description":"JSON files published beside index.html, by path (data/*.json)"}},"type":"object","required":["html"],"title":"CharretteRedeployRequest"},"ChatCompletionChoice":{"properties":{"index":{"type":"integer","title":"Index","default":0},"message":{"$ref":"#/components/schemas/ChatCompletionMessageResponse"},"finish_reason":{"type":"string","title":"Finish Reason","default":"stop"}},"type":"object","required":["message"],"title":"ChatCompletionChoice"},"ChatCompletionMessageResponse":{"properties":{"role":{"type":"string","title":"Role","default":"assistant"},"content":{"anyOf":[{"type":"string"},{"items":{},"type":"array"}],"title":"Content"}},"type":"object","required":["content"],"title":"ChatCompletionMessageResponse"},"ChatCompletionsRequest":{"properties":{"model":{"type":"string","title":"Model"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages"},"temperature":{"type":"number","title":"Temperature","default":0.7},"max_tokens":{"type":"integer","title":"Max Tokens","default":8000},"stream":{"type":"boolean","title":"Stream","default":false}},"type":"object","required":["model","messages"],"title":"ChatCompletionsRequest"},"ChatCompletionsResponse":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"chat.completion"},"created":{"type":"integer","title":"Created"},"model":{"type":"string","title":"Model"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionChoice"},"type":"array","title":"Choices"}},"type":"object","required":["id","created","model","choices"],"title":"ChatCompletionsResponse"},"ChatMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"ClientEvent":{"properties":{"event":{"type":"string","maxLength":40,"title":"Event"},"appId":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Appid"},"fields":{"additionalProperties":true,"type":"object","title":"Fields"}},"type":"object","required":["event"],"title":"ClientEvent"},"CloneChatRequest":{"properties":{"chat_id":{"type":"string","maxLength":128,"minLength":1,"title":"Chat Id"}},"type":"object","required":["chat_id"],"title":"CloneChatRequest"},"CloneChatResponse":{"properties":{"new_chat_id":{"type":"string","title":"New Chat Id"},"source_path":{"type":"string","title":"Source Path"},"message_count":{"type":"integer","title":"Message Count"}},"type":"object","required":["new_chat_id","source_path","message_count"],"title":"CloneChatResponse"},"ConsentDecision":{"properties":{"approve":{"type":"boolean","title":"Approve"}},"type":"object","required":["approve"],"title":"ConsentDecision"},"ContextPreviewFullOption":{"properties":{"estimated_tokens":{"type":"integer","title":"Estimated Tokens"},"char_count":{"type":"integer","title":"Char Count"}},"type":"object","required":["estimated_tokens","char_count"],"title":"ContextPreviewFullOption"},"ContextPreviewResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"full":{"$ref":"#/components/schemas/ContextPreviewFullOption"},"summary":{"$ref":"#/components/schemas/ContextPreviewSummaryOption"}},"type":"object","required":["session_id","full","summary"],"title":"ContextPreviewResponse"},"ContextPreviewSummaryOption":{"properties":{"markdown":{"type":"string","title":"Markdown"},"estimated_tokens":{"type":"integer","title":"Estimated Tokens"},"char_count":{"type":"integer","title":"Char Count"},"from_cache":{"type":"boolean","title":"From Cache"}},"type":"object","required":["markdown","estimated_tokens","char_count","from_cache"],"title":"ContextPreviewSummaryOption"},"ContextSummaryPreviewRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["conversation_id","messages"],"title":"ContextSummaryPreviewRequest"},"ContextSummaryPreviewResponse":{"properties":{"markdown":{"type":"string","title":"Markdown"},"estimated_tokens":{"type":"integer","title":"Estimated Tokens"},"char_count":{"type":"integer","title":"Char Count"},"from_cache":{"type":"boolean","title":"From Cache"},"message_count":{"type":"integer","title":"Message Count"},"pinned_message_count":{"type":"integer","title":"Pinned Message Count","default":0}},"type":"object","required":["markdown","estimated_tokens","char_count","from_cache","message_count"],"title":"ContextSummaryPreviewResponse"},"CreateProjectRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"confidential":{"type":"boolean","title":"Confidential","default":false}},"type":"object","required":["name"],"title":"CreateProjectRequest"},"DeleteProjectResponse":{"properties":{"status":{"type":"string","title":"Status"},"project_id":{"type":"string","title":"Project Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","project_id","message"],"title":"DeleteProjectResponse"},"DeployRequest":{"properties":{"version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Version"},"message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Message"},"enableDataStore":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabledatastore"}},"type":"object","title":"DeployRequest"},"DisconnectResponse":{"properties":{"success":{"type":"boolean","title":"Success"}},"type":"object","required":["success"],"title":"DisconnectResponse"},"DocumentMetadata":{"properties":{"document_id":{"type":"string","title":"Document Id"},"file_name":{"type":"string","title":"File Name"},"storage_path":{"type":"string","title":"Storage Path"},"gcs_uri":{"type":"string","title":"Gcs Uri"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"uploaded_at":{"type":"string","title":"Uploaded At"},"file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size"}},"type":"object","required":["document_id","file_name","storage_path","gcs_uri","uploaded_at"],"title":"DocumentMetadata"},"DocumentUploadResponse":{"properties":{"document_id":{"type":"string","title":"Document Id"},"file_name":{"type":"string","title":"File Name"},"storage_path":{"type":"string","title":"Storage Path"},"gcs_uri":{"type":"string","title":"Gcs Uri"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["document_id","file_name","storage_path","gcs_uri","status"],"title":"DocumentUploadResponse"},"DocumentsListResponse":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/DocumentMetadata"},"type":"array","title":"Documents"},"count":{"type":"integer","title":"Count"},"has_more":{"type":"boolean","title":"Has More","default":false}},"type":"object","required":["documents","count"],"title":"DocumentsListResponse"},"DraftPlanner":{"properties":{"email":{"type":"string","maxLength":254,"minLength":3,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","title":"Email"}},"additionalProperties":false,"type":"object","required":["email"],"title":"DraftPlanner"},"DraftProject":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"facilityType":{"type":"string","maxLength":200,"minLength":1,"title":"Facilitytype"},"clientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Clientname"},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Address"},"city":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"City"},"region":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Region"},"country":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Country"},"phase":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Phase"},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Description"},"buildingGrossFactor":{"anyOf":[{"type":"number","maximum":3.0,"minimum":1.0},{"type":"null"}],"title":"Buildinggrossfactor"},"clientId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"},{"type":"null"}],"title":"Clientid"}},"additionalProperties":false,"type":"object","required":["name","facilityType"],"title":"DraftProject"},"DraftRow":{"properties":{"department":{"type":"string","maxLength":200,"minLength":1,"title":"Department"},"category":{"type":"string","enum":["Emergency & Trauma","Surgery & Interventional","Intensive Care","Inpatient Nursing","Diagnostic & Imaging","Ambulatory & Outpatient","Specialty & Rehab","Women & Children","Clinical Support","Logistics & Facilities","Administration & Public"],"title":"Category"},"kpuName":{"type":"string","maxLength":100,"minLength":1,"title":"Kpuname"},"kpuCount":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Kpucount"},"netSfPerKpu":{"anyOf":[{"type":"number","maximum":100000.0,"minimum":1.0},{"type":"null"}],"title":"Netsfperkpu"},"grossFactor":{"anyOf":[{"type":"number","maximum":3.0,"minimum":1.0},{"type":"null"}],"title":"Grossfactor"},"method":{"type":"string","enum":["procedure_rooms","inpatient_beds","imaging_rooms","ed_bays","ldrp_rooms","pacu_bays","sterile_processing","planner_input","other"],"title":"Method","default":"other"},"basis":{"type":"string","enum":["tool","benchmark","estimate"],"title":"Basis","default":"estimate"},"inputs":{"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"}]},"type":"object","maxProperties":20,"title":"Inputs"},"rationale":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Rationale"},"sources":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Sources"}},"additionalProperties":false,"type":"object","required":["department","category","kpuName","kpuCount"],"title":"DraftRow"},"DraftSource":{"properties":{"system":{"type":"string","const":"billie","title":"System","default":"billie"},"messageId":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$","title":"Messageid"},"chatId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"},{"type":"null"}],"title":"Chatid"},"generatedAt":{"type":"string","maxLength":40,"minLength":1,"title":"Generatedat"}},"additionalProperties":false,"type":"object","required":["messageId","generatedAt"],"title":"DraftSource"},"EntraIDGroupsResponse":{"properties":{"groups":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Groups"},"group_ids":{"items":{"type":"string"},"type":"array","title":"Group Ids"},"group_names":{"items":{"type":"string"},"type":"array","title":"Group Names"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["groups","group_ids","group_names","count"],"title":"EntraIDGroupsResponse","description":"Response model for user's security groups."},"EntraIDSearchRequest":{"properties":{"search_term":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Term"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"office_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Office Location"},"limit":{"type":"integer","title":"Limit","default":50}},"type":"object","title":"EntraIDSearchRequest"},"EntraIDSearchResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/EntraIDUserInfo"},"type":"array","title":"Users"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["users","count"],"title":"EntraIDSearchResponse"},"EntraIDUserInfo":{"properties":{"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"entra_mail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entra Mail"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"user_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Type"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"job_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Title"},"mail_nick_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mail Nick Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"user_principal_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Principal Name"},"employee_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"office_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Office Location"}},"type":"object","title":"EntraIDUserInfo"},"EntraIDUserResponse":{"properties":{"user":{"anyOf":[{"$ref":"#/components/schemas/EntraIDUserInfo"},{"type":"null"}]},"found":{"type":"boolean","title":"Found"}},"type":"object","required":["user","found"],"title":"EntraIDUserResponse"},"ExecuteTaskRequest":{"properties":{"user_id":{"type":"string","title":"User Id","description":"Firebase UID of the task owner"},"prompt_id":{"type":"string","title":"Prompt Id","description":"Document ID under users/{user_id}/savedPrompts"},"target_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Email","description":"Informational only. The execute endpoint re-resolves the recipient from the owner's profile (users/{user_id}.email) and does NOT deliver to this value — a body-supplied address is not a trusted recipient. Carried for logging/back-compat with the dispatcher."},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id","description":"scheduled_tasks document ID this run was dispatched for. Optional for backwards compatibility; without it the executor falls back to a (user_id, prompt_id) lookup, which is not unique."},"run_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Key","description":"Stable name for this specific due run (see build_run_key). Used as the runHistory document ID so a redelivered task is a no-op."}},"type":"object","required":["user_id","prompt_id"],"title":"ExecuteTaskRequest","description":"Request body Cloud Tasks POSTs to the internal execute endpoint.\n\nCarries only identifiers - the prompt text is read fresh from Firestore at\nrun time so that editing a saved prompt changes future runs."},"FalsePositiveReport":{"properties":{"finding":{"type":"integer","minimum":0.0,"title":"Finding","description":"Index into the version's blocking findings"},"note":{"type":"string","maxLength":1000,"minLength":3,"title":"Note"}},"type":"object","required":["finding","note"],"title":"FalsePositiveReport"},"FeedbackPipelineStatus":{"properties":{"configured":{"type":"boolean","title":"Configured"},"connector_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connector Id"},"paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Paused"},"sync_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync State"},"setup_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Setup State"},"succeeded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Succeeded At"},"failed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failed At"},"schedule_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Type"}},"type":"object","required":["configured"],"title":"FeedbackPipelineStatus"},"FeedbackPipelineTriggerRequest":{"properties":{"force":{"type":"boolean","title":"Force","default":false}},"type":"object","title":"FeedbackPipelineTriggerRequest"},"FeedbackPipelineTriggerResponse":{"properties":{"connector_id":{"type":"string","title":"Connector Id"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["connector_id"],"title":"FeedbackPipelineTriggerResponse"},"FinalizeRequest":{"properties":{"version":{"anyOf":[{"type":"integer","maximum":999.0,"minimum":1.0},{"type":"null"}],"title":"Version","description":"The version to finalize; the latest when omitted"}},"type":"object","title":"FinalizeRequest"},"GenerationConfig":{"properties":{"temperature":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Temperature"},"max_output_tokens":{"anyOf":[{"type":"integer","maximum":200000.0,"minimum":1.0},{"type":"null"}],"title":"Max Output Tokens"}},"type":"object","title":"GenerationConfig","description":"Per-model decoding overrides (AB#8909 Phase 3) — absent field = code default.\n\nBounds mirror utils/generation_params.py, which validates again on read\n(direct Firestore edits bypass this schema)."},"GroupMemberInfo":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"email":{"type":"string","title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["email"],"title":"GroupMemberInfo"},"GroupSyncResponse":{"properties":{"synced":{"type":"integer","title":"Synced"},"removed":{"type":"integer","title":"Removed"},"errors":{"type":"integer","title":"Errors"},"skipped":{"type":"integer","title":"Skipped"},"groups_processed":{"type":"integer","title":"Groups Processed"},"groups_failed":{"type":"integer","title":"Groups Failed"},"groups_total":{"type":"integer","title":"Groups Total"},"dry_run":{"type":"boolean","title":"Dry Run"},"groups":{"items":{"type":"string"},"type":"array","title":"Groups"}},"type":"object","required":["synced","removed","errors","skipped","groups_processed","groups_failed","groups_total","dry_run","groups"],"title":"GroupSyncResponse","description":"Stats from one sync run, mirroring ``sync_billie_groups``'s return dict."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImageDownloadRequest":{"properties":{"url":{"type":"string","maxLength":4096,"minLength":1,"title":"Url","description":"The image's Storage download URL, as shown in the chat"},"filename":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Filename","description":"Suggested filename; sanitised"}},"type":"object","required":["url"],"title":"ImageDownloadRequest"},"ImportFilesRequest":{"properties":{"file_paths":{"items":{"type":"string"},"type":"array","title":"File Paths"}},"type":"object","required":["file_paths"],"title":"ImportFilesRequest"},"ImportFilesResponse":{"properties":{"status":{"type":"string","title":"Status"},"file_count":{"type":"integer","title":"File Count"},"corpus_name":{"type":"string","title":"Corpus Name"}},"type":"object","required":["status","file_count","corpus_name"],"title":"ImportFilesResponse"},"InternalAgentQueryRequest":{"properties":{"message":{"type":"string","title":"Message"},"user_email":{"type":"string","title":"User Email","description":"Entra ID email of the Teams user"},"user_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Display Name"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"model_name":{"type":"string","title":"Model Name","default":"gemini-4-hydrogen"},"enable_tools":{"items":{"type":"string"},"type":"array","title":"Enable Tools","default":["rag","web_search","image_generation","video_generation","calculator","mermaid"]},"temperature":{"type":"number","title":"Temperature","default":0.0},"conversation_history":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Conversation History"},"image_quality":{"type":"string","title":"Image Quality","default":"2k"},"reference_image_b64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Image B64"},"writing_style":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Writing Style"},"teams_conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teams Conversation Id"},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"},"owner_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner User Id"},"owner_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Source"},"quick_mode":{"type":"boolean","title":"Quick Mode","default":false},"workiq_token":{"anyOf":[{"type":"string","format":"password","writeOnly":true},{"type":"null"}],"title":"Workiq Token"},"atlassian_token":{"anyOf":[{"type":"string","format":"password","writeOnly":true},{"type":"null"}],"title":"Atlassian Token"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"}},"type":"object","required":["message","user_email"],"title":"InternalAgentQueryRequest","description":"Request from the Teams bot. Includes user identity instead of a token."},"LastGenerationInfo":{"properties":{"timestamp":{"type":"string","title":"Timestamp"},"duration_seconds":{"type":"integer","title":"Duration Seconds"},"estimated_cost_usd":{"type":"number","title":"Estimated Cost Usd"},"gcs_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gcs Uri"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"}},"type":"object","required":["timestamp","duration_seconds","estimated_cost_usd"],"title":"LastGenerationInfo","description":"Information about the last video generation."},"LearnVoiceRequest":{"properties":{"workiq_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workiq Token"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"}},"type":"object","title":"LearnVoiceRequest"},"LimitRequest":{"properties":{"limit":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Limit","description":"Monthly Build tokens; 0 = unlimited; null = the default"}},"type":"object","title":"LimitRequest"},"LitigationAutoTagRequest":{"properties":{"messages":{"items":{"type":"string"},"type":"array","title":"Messages"}},"type":"object","required":["messages"],"title":"LitigationAutoTagRequest"},"LitigationAutoTagResponse":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","required":["tags"],"title":"LitigationAutoTagResponse"},"LitigationFacetDef":{"properties":{"label":{"type":"string","title":"Label"},"type":{"type":"string","title":"Type"},"values":{"items":{"type":"string"},"type":"array","title":"Values"}},"type":"object","required":["label","type","values"],"title":"LitigationFacetDef"},"LitigationFacetsResponse":{"properties":{"facets":{"additionalProperties":{"$ref":"#/components/schemas/LitigationFacetDef"},"type":"object","title":"Facets"}},"type":"object","required":["facets"],"title":"LitigationFacetsResponse"},"LitigationFoldersResponse":{"properties":{"folders":{"items":{"type":"string"},"type":"array","title":"Folders"}},"type":"object","required":["folders"],"title":"LitigationFoldersResponse"},"LitigationQueryRequest":{"properties":{"query":{"type":"string","title":"Query"},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name"},"folder_names":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Folder Names"},"filters":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Filters"},"model_provider":{"type":"string","title":"Model Provider","default":"google"},"model_name":{"type":"string","title":"Model Name","default":"gemini-3.1-flash-lite"},"conversation_history":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Conversation History"}},"type":"object","required":["query"],"title":"LitigationQueryRequest"},"LocationContext":{"properties":{"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"timestamp":{"type":"integer","title":"Timestamp"}},"type":"object","required":["latitude","longitude","timestamp"],"title":"LocationContext"},"MCPCredentialStatus":{"properties":{"server":{"type":"string","title":"Server"},"configured":{"type":"boolean","title":"Configured"}},"type":"object","required":["server","configured"],"title":"MCPCredentialStatus","description":"Status of MCP credentials for a user."},"MCPCredentialsStatusResponse":{"properties":{"credentials":{"additionalProperties":{"$ref":"#/components/schemas/MCPCredentialStatus"},"type":"object","title":"Credentials"}},"type":"object","required":["credentials"],"title":"MCPCredentialsStatusResponse","description":"Response containing credential status for all servers."},"MCPServerInfo":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"command":{"type":"string","title":"Command"}},"type":"object","required":["name","description","command"],"title":"MCPServerInfo","description":"Information about an available MCP server."},"MCPServersResponse":{"properties":{"servers":{"items":{"$ref":"#/components/schemas/MCPServerInfo"},"type":"array","title":"Servers"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["servers","count"],"title":"MCPServersResponse","description":"Response containing available MCP servers."},"ModelConfig":{"properties":{"provider":{"type":"string","maxLength":64,"minLength":1,"title":"Provider"},"display_name":{"type":"string","maxLength":128,"minLength":1,"title":"Display Name"},"description":{"type":"string","maxLength":1000,"title":"Description","default":""},"enabled":{"type":"boolean","title":"Enabled","default":true},"is_default":{"type":"boolean","title":"Is Default","default":false},"context_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Window"},"cost_per_1m_input_tokens":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Per 1M Input Tokens"},"cost_per_1m_output_tokens":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Per 1M Output Tokens"},"generation":{"anyOf":[{"$ref":"#/components/schemas/GenerationConfig"},{"type":"null"}]}},"type":"object","required":["provider","display_name"],"title":"ModelConfig"},"ModelInfo":{"properties":{"name":{"type":"string","title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"context_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Window"},"enabled":{"type":"boolean","title":"Enabled","default":true},"is_default":{"type":"boolean","title":"Is Default","default":false},"cost_per_1m_input_tokens":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Per 1M Input Tokens"},"cost_per_1m_output_tokens":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Per 1M Output Tokens"}},"type":"object","required":["name"],"title":"ModelInfo"},"ModelsListResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/ModelInfo"},"type":"array","title":"Models"},"count":{"type":"integer","title":"Count"},"default_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Model"}},"type":"object","required":["models","count"],"title":"ModelsListResponse"},"ModelsMapResponse":{"properties":{"allowed_models":{"additionalProperties":{"$ref":"#/components/schemas/ModelConfig"},"type":"object","title":"Allowed Models"}},"type":"object","required":["allowed_models"],"title":"ModelsMapResponse"},"NewAppRequest":{"properties":{"name":{"type":"string","maxLength":63,"minLength":1,"title":"Name"},"instruction":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Instruction"},"seed":{"anyOf":[{"$ref":"#/components/schemas/PrototypeSeed"},{"type":"null"}]}},"type":"object","required":["name"],"title":"NewAppRequest"},"PDFExtractionResponse":{"properties":{"text":{"type":"string","title":"Text"},"pages":{"type":"integer","title":"Pages"},"total_pages":{"type":"integer","title":"Total Pages"},"truncated":{"type":"boolean","title":"Truncated"},"success":{"type":"boolean","title":"Success"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["text","pages","total_pages","truncated","success"],"title":"PDFExtractionResponse"},"PinnedImageRef":{"properties":{"image_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Id"},"url":{"type":"string","maxLength":56000000,"minLength":1,"title":"Url"}},"type":"object","required":["url"],"title":"PinnedImageRef","description":"An image the user pinned as the base or a style of the next render (DP-4950/4951).\n\n``url`` is a Storage download URL of the caller's own image, or a data URI when\nthe browser could not upload it. It is never fetched over HTTP: the server\nresolves it through the image ownership check (services/pinned_images.py)."},"ProgramDraft":{"properties":{"schemaVersion":{"type":"integer","const":1,"title":"Schemaversion"},"source":{"$ref":"#/components/schemas/DraftSource"},"planner":{"$ref":"#/components/schemas/DraftPlanner"},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"title":"Duedate"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"project":{"$ref":"#/components/schemas/DraftProject"},"program":{"items":{"$ref":"#/components/schemas/DraftRow"},"type":"array","maxItems":200,"minItems":1,"title":"Program"}},"additionalProperties":false,"type":"object","required":["schemaVersion","source","planner","project","program"],"title":"ProgramDraft","description":"A HealthPlan program draft, contract schemaVersion 1."},"ProjectMember":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"is_owner":{"type":"boolean","title":"Is Owner","default":false},"is_pending":{"type":"boolean","title":"Is Pending","default":false}},"type":"object","required":["user_id"],"title":"ProjectMember"},"ProjectMembersResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"members":{"items":{"$ref":"#/components/schemas/ProjectMember"},"type":"array","title":"Members"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["project_id","members","count"],"title":"ProjectMembersResponse"},"ProjectResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"corpus_id":{"type":"string","title":"Corpus Id"},"corpus_name":{"type":"string","title":"Corpus Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["project_id","name","corpus_id","corpus_name"],"title":"ProjectResponse"},"PrototypeSeed":{"properties":{"html":{"type":"string","minLength":1,"title":"Html"},"messageId":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Messageid"},"conversationId":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Conversationid"},"projectId":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Projectid","description":"The project, for a project chat"},"prototypeId":{"anyOf":[{"type":"string","maxLength":63},{"type":"null"}],"title":"Prototypeid","description":"The charrette prototype a branch link opened"}},"type":"object","required":["html"],"title":"PrototypeSeed","description":"A chat prototype to continue in Build: where it is saved, and the copy the browser shows.\n\nThe server reads the HTML from where it is saved (services/code_studio/seed.py):\nthe chat and message, or, for a charrette branch link's chat that isn't saved\nyet, the prototype. ``html`` must match what is stored there."},"RefreshAccessResponse":{"properties":{"billie_group_ids":{"items":{"type":"string"},"type":"array","title":"Billie Group Ids"},"group_names":{"items":{"type":"string"},"type":"array","title":"Group Names"},"group_ids":{"items":{"type":"string"},"type":"array","title":"Group Ids","default":[]},"count":{"type":"integer","title":"Count"}},"type":"object","required":["billie_group_ids","group_names","count"],"title":"RefreshAccessResponse","description":"Response model for the on-demand access refresh endpoint."},"RefreshUrlRequest":{"properties":{"url":{"type":"string","title":"Url","description":"The expired signed URL or GCS URI (gs://...)"},"expiration_hours":{"type":"integer","maximum":168.0,"minimum":1.0,"title":"Expiration Hours","description":"Hours until new URL expires (1-168)","default":24}},"type":"object","required":["url"],"title":"RefreshUrlRequest","description":"Request to refresh a signed video URL."},"RefreshUrlResponse":{"properties":{"signed_url":{"type":"string","title":"Signed Url","description":"Fresh signed URL valid for the requested duration"},"gcs_uri":{"type":"string","title":"Gcs Uri","description":"The underlying GCS URI"},"expires_in_hours":{"type":"integer","title":"Expires In Hours","description":"Hours until this URL expires"}},"type":"object","required":["signed_url","gcs_uri","expires_in_hours"],"title":"RefreshUrlResponse","description":"Response with fresh signed URL."},"RemoveMemberResponse":{"properties":{"status":{"type":"string","title":"Status"},"project_id":{"type":"string","title":"Project Id"},"user_id":{"type":"string","title":"User Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","project_id","user_id","message"],"title":"RemoveMemberResponse"},"RenderExportRequest":{"properties":{"format":{"type":"string","enum":["csv","pdf"],"title":"Format"},"markdown":{"type":"string","minLength":1,"title":"Markdown","description":"Markdown to export (a table for csv; any content for pdf)"},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title"},"filename":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Filename"}},"type":"object","required":["format","markdown"],"title":"RenderExportRequest"},"ReseedContext":{"properties":{"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},"type":"object","title":"ReseedContext","description":"The history a regenerate or branch wants the thread reset to before its turn runs."},"ResetToolUsageRequest":{"properties":{"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"}},"type":"object","title":"ResetToolUsageRequest"},"ResolveRequest":{"properties":{"note":{"type":"string","maxLength":500,"minLength":3,"title":"Note"}},"type":"object","required":["note"],"title":"ResolveRequest"},"ResolveSourceUrlRequest":{"properties":{"filename":{"type":"string","title":"Filename"},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name"},"source_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Path"}},"type":"object","required":["filename"],"title":"ResolveSourceUrlRequest"},"ResolveSourceUrlResponse":{"properties":{"web_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Url"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"ResolveSourceUrlResponse"},"RevisePlanRequest":{"properties":{"feedback":{"type":"string","maxLength":10000,"minLength":1,"title":"Feedback"}},"type":"object","required":["feedback"],"title":"RevisePlanRequest"},"RoleDefinition-Input":{"properties":{"role_id":{"type":"string","title":"Role Id","description":"Unique role identifier"},"display_name":{"type":"string","title":"Display Name","description":"Human-readable role name"},"description":{"type":"string","title":"Description","description":"Role description","default":""},"enabled":{"type":"boolean","title":"Enabled","description":"Whether this role is active","default":true},"priority":{"type":"integer","title":"Priority","description":"Role priority for display ordering","default":100},"base_prompt":{"type":"string","maxLength":50000,"title":"Base Prompt","description":"Base system prompt for this role","default":""},"prompt_additions":{"type":"string","maxLength":50000,"title":"Prompt Additions","description":"Additional instructions appended after base prompt","default":""},"inherits_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inherits From","description":"Parent role ID for prompt inheritance"},"version":{"type":"integer","title":"Version","description":"Document version for optimistic locking","default":1},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Created At","description":"Creation timestamp"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["role_id","display_name"],"title":"RoleDefinition","description":"A role definition with prompts and metadata."},"RoleDefinition-Output":{"properties":{"role_id":{"type":"string","title":"Role Id","description":"Unique role identifier"},"display_name":{"type":"string","title":"Display Name","description":"Human-readable role name"},"description":{"type":"string","title":"Description","description":"Role description","default":""},"enabled":{"type":"boolean","title":"Enabled","description":"Whether this role is active","default":true},"priority":{"type":"integer","title":"Priority","description":"Role priority for display ordering","default":100},"base_prompt":{"type":"string","maxLength":50000,"title":"Base Prompt","description":"Base system prompt for this role","default":""},"prompt_additions":{"type":"string","maxLength":50000,"title":"Prompt Additions","description":"Additional instructions appended after base prompt","default":""},"inherits_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inherits From","description":"Parent role ID for prompt inheritance"},"version":{"type":"integer","title":"Version","description":"Document version for optimistic locking","default":1},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"Creation timestamp"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["role_id","display_name"],"title":"RoleDefinition","description":"A role definition with prompts and metadata."},"RoleMapping-Input":{"properties":{"mapping_id":{"type":"string","title":"Mapping Id","description":"Unique mapping identifier"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether this mapping is active","default":true},"priority":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Priority","description":"Mapping priority (higher = evaluated first)","default":100},"role_id":{"type":"string","title":"Role Id","description":"Target role ID when criteria match"},"criteria":{"$ref":"#/components/schemas/RoleMappingCriteria","description":"Criteria for matching users"},"match_mode":{"type":"string","enum":["any_criterion","all_criteria"],"title":"Match Mode","description":"How to combine criteria: any (OR) or all (AND)","default":"any_criterion"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Created At","description":"Creation timestamp"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["mapping_id","role_id"],"title":"RoleMapping","description":"Maps user attributes to a role."},"RoleMapping-Output":{"properties":{"mapping_id":{"type":"string","title":"Mapping Id","description":"Unique mapping identifier"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether this mapping is active","default":true},"priority":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Priority","description":"Mapping priority (higher = evaluated first)","default":100},"role_id":{"type":"string","title":"Role Id","description":"Target role ID when criteria match"},"criteria":{"$ref":"#/components/schemas/RoleMappingCriteria","description":"Criteria for matching users"},"match_mode":{"type":"string","enum":["any_criterion","all_criteria"],"title":"Match Mode","description":"How to combine criteria: any (OR) or all (AND)","default":"any_criterion"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"Creation timestamp"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["mapping_id","role_id"],"title":"RoleMapping","description":"Maps user attributes to a role."},"RoleMappingCriteria":{"properties":{"job_title_patterns":{"items":{"type":"string"},"type":"array","title":"Job Title Patterns","description":"Regex patterns to match against job title (case-insensitive)"},"job_title_exact":{"items":{"type":"string"},"type":"array","title":"Job Title Exact","description":"Exact job titles to match (case-insensitive)"},"department_exact":{"items":{"type":"string"},"type":"array","title":"Department Exact","description":"Exact department names to match (case-insensitive)"}},"type":"object","title":"RoleMappingCriteria","description":"Criteria for matching users to roles based on job title and department."},"RolePromptConfig-Input":{"properties":{"version":{"type":"string","title":"Version","description":"Config schema version","default":"1.0.0"},"default_role":{"type":"string","title":"Default Role","description":"Fallback role when no mapping matches","default":"general_user"},"cache_ttl_seconds":{"type":"integer","maximum":86400.0,"minimum":60.0,"title":"Cache Ttl Seconds","description":"Cache TTL for role data (1 hour default)","default":3600},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By","description":"Email of last updater"}},"type":"object","title":"RolePromptConfig","description":"System-wide role prompt configuration."},"RolePromptConfig-Output":{"properties":{"version":{"type":"string","title":"Version","description":"Config schema version","default":"1.0.0"},"default_role":{"type":"string","title":"Default Role","description":"Fallback role when no mapping matches","default":"general_user"},"cache_ttl_seconds":{"type":"integer","maximum":86400.0,"minimum":60.0,"title":"Cache Ttl Seconds","description":"Cache TTL for role data (1 hour default)","default":3600},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By","description":"Email of last updater"}},"type":"object","title":"RolePromptConfig","description":"System-wide role prompt configuration."},"RunNowRequest":{"properties":{"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"}},"type":"object","title":"RunNowRequest"},"RunNowResponse":{"properties":{"status":{"type":"string","title":"Status"},"chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"email_sent":{"type":"boolean","title":"Email Sent","default":false},"execution_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Mode"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["status"],"title":"RunNowResponse"},"RunWorkflowBody":{"properties":{"content":{"type":"string","maxLength":4000,"title":"Content","default":""},"attachments":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Attachments"}},"type":"object","title":"RunWorkflowBody"},"SeedContextRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["conversation_id","messages"],"title":"SeedContextRequest"},"SessionSnapshot":{"properties":{"session_id":{"type":"string","title":"Session Id"},"status":{"type":"string","title":"Status"},"phase":{"type":"string","title":"Phase"},"agent":{"type":"string","title":"Agent"},"query":{"type":"string","title":"Query"},"plan":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Plan"},"report":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Report"},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Url"},"interaction_chain":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Interaction Chain","default":[]},"latest_interaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Interaction Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["session_id","status","phase","agent","query"],"title":"SessionSnapshot"},"SetMCPCredentialsRequest":{"properties":{"server_name":{"type":"string","title":"Server Name"},"credentials":{"additionalProperties":{"type":"string"},"type":"object","title":"Credentials"}},"type":"object","required":["server_name","credentials"],"title":"SetMCPCredentialsRequest","description":"Request to set MCP credentials for a server."},"SetMCPCredentialsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"SetMCPCredentialsResponse","description":"Response after setting MCP credentials."},"SetTokenLimitRequest":{"properties":{"token_limit":{"type":"integer","title":"Token Limit","description":"Monthly token allowance. 0 or negative means unlimited."}},"type":"object","required":["token_limit"],"title":"SetTokenLimitRequest"},"SetToolLimitRequest":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["tool_name","limit"],"title":"SetToolLimitRequest"},"ShareChatRequest":{"properties":{"email":{"type":"string","title":"Email"},"owner_user_id":{"type":"string","title":"Owner User Id"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["email","owner_user_id"],"title":"ShareChatRequest"},"ShareChatResponse":{"properties":{"status":{"type":"string","title":"Status"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"email":{"type":"string","title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"message":{"type":"string","title":"Message"},"email_sent":{"type":"boolean","title":"Email Sent","default":false}},"type":"object","required":["status","email","message"],"title":"ShareChatResponse"},"SharedChatSummary":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"owner_user_id":{"type":"string","title":"Owner User Id"},"owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Email"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]}},"type":"object","required":["id","title","owner_user_id"],"title":"SharedChatSummary"},"StartResearchRequest":{"properties":{"query":{"type":"string","maxLength":10000,"minLength":4,"title":"Query"},"agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent","description":"Override the agent ID. Defaults to settings.deep_research_agent. Use \"max\" for the comprehensive variant."},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id","description":"The chat conversation that hosts this research panel. Used by the AppHeader badge to deep-link back to the chat."},"context":{"anyOf":[{"type":"string","maxLength":200000},{"type":"null"}],"title":"Context","description":"Document/conversation context the research must be grounded in — e.g. the extracted text of an attached RFQ. Composed into the agent input so the research targets the user's actual subject instead of guessing from the bare prompt; NOT used as the session title."},"workiq_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workiq Token","description":"The user's Entra token for Microsoft 365 (Work IQ), as on chat requests. When present, the user's own mail, meetings, Teams and files relevant to the question are gathered as them and added to the research context. Never logged or stored."},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"jira_enabled":{"type":"boolean","title":"Jira Enabled","description":"Whether Jira is on for this user (their Agent Tools toggle and the tool_jira_enabled flag — the same switch that puts \"jira\" in a chat request's tools). When it is, and they have connected Atlassian, their Jira issues and Confluence pages relevant to the question are gathered as them and added to the research context.","default":false}},"type":"object","required":["query"],"title":"StartResearchRequest"},"SystemSettings":{"properties":{"app_name":{"type":"string","maxLength":128,"minLength":1,"title":"App Name"},"version":{"type":"string","maxLength":64,"minLength":1,"title":"Version"},"maintenance_mode":{"type":"boolean","title":"Maintenance Mode","default":false},"features":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Features"},"limits":{"additionalProperties":{"type":"integer"},"type":"object","title":"Limits"}},"type":"object","required":["app_name","version"],"title":"SystemSettings"},"TokenUsageIncrement":{"properties":{"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"total_tokens":{"type":"integer","title":"Total Tokens"}},"type":"object","required":["input_tokens","output_tokens","total_tokens"],"title":"TokenUsageIncrement"},"TokenUsageResponse":{"properties":{"token_limit":{"type":"integer","title":"Token Limit"},"tokens_used":{"type":"integer","title":"Tokens Used"},"monthly_tokens_used":{"type":"integer","title":"Monthly Tokens Used"},"tokens_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens Remaining"},"limit_exceeded":{"type":"boolean","title":"Limit Exceeded"},"unlimited":{"type":"boolean","title":"Unlimited"},"updated_at":{"type":"string","title":"Updated At"},"last_increment":{"anyOf":[{"$ref":"#/components/schemas/TokenUsageIncrement"},{"type":"null"}]},"projected_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Projected Tokens"}},"type":"object","required":["token_limit","tokens_used","monthly_tokens_used","limit_exceeded","unlimited","updated_at"],"title":"TokenUsageResponse"},"ToolLastCall":{"properties":{"timestamp":{"type":"string","title":"Timestamp"},"success":{"type":"boolean","title":"Success"},"args_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Args Summary"},"execution_time_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Execution Time Ms"}},"type":"object","required":["timestamp","success"],"title":"ToolLastCall"},"ToolUsageEntry":{"properties":{"call_count":{"type":"integer","title":"Call Count"},"limit":{"type":"integer","title":"Limit"},"limit_exceeded":{"type":"boolean","title":"Limit Exceeded"},"unlimited":{"type":"boolean","title":"Unlimited"},"estimated_cost_usd":{"type":"number","title":"Estimated Cost Usd"},"last_call":{"anyOf":[{"$ref":"#/components/schemas/ToolLastCall"},{"type":"null"}]}},"type":"object","required":["call_count","limit","limit_exceeded","unlimited","estimated_cost_usd"],"title":"ToolUsageEntry"},"ToolUsageResponse":{"properties":{"limit_period":{"type":"string","title":"Limit Period"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"tools":{"additionalProperties":{"$ref":"#/components/schemas/ToolUsageEntry"},"type":"object","title":"Tools"},"total_calls":{"type":"integer","title":"Total Calls"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["limit_period","period_start","period_end","tools","total_calls","updated_at"],"title":"ToolUsageResponse"},"TurnRequest":{"properties":{"instruction":{"type":"string","maxLength":8000,"minLength":1,"title":"Instruction"}},"type":"object","required":["instruction"],"title":"TurnRequest"},"UpdateMappingRequest":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"priority":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Priority"},"role_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Id"},"criteria":{"anyOf":[{"$ref":"#/components/schemas/RoleMappingCriteria"},{"type":"null"}]},"match_mode":{"anyOf":[{"type":"string","enum":["any_criterion","all_criteria"]},{"type":"null"}],"title":"Match Mode"}},"type":"object","title":"UpdateMappingRequest","description":"Request to update a role mapping (all fields optional for partial updates)."},"UpdateModelsRequest":{"properties":{"allowed_models":{"additionalProperties":{"$ref":"#/components/schemas/ModelConfig"},"type":"object","title":"Allowed Models"}},"type":"object","required":["allowed_models"],"title":"UpdateModelsRequest"},"UpdateRoleRequest":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Display Name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"priority":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Priority"},"base_prompt":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Base Prompt","description":"Root prompt text. Only populated for general_user role. Leave empty for roles that inherit from another role."},"prompt_additions":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Prompt Additions","description":"Additional prompt text appended after inherited prompts. Use this field for role-specific instructions in child roles."},"inherits_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inherits From","description":"Parent role ID to inherit from. Set to null to remove inheritance."}},"type":"object","title":"UpdateRoleRequest","description":"Request to update an existing role (all fields optional for partial updates)."},"UserToolUsageDetailResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"limit_period":{"type":"string","title":"Limit Period"},"period_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period End"},"tools":{"additionalProperties":{"$ref":"#/components/schemas/ToolUsageEntry"},"type":"object","title":"Tools"},"total_calls":{"type":"integer","title":"Total Calls"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["user_id","limit_period","tools","total_calls"],"title":"UserToolUsageDetailResponse"},"UserToolUsageSummary":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"total_calls":{"type":"integer","title":"Total Calls"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"tools_used":{"items":{"type":"string"},"type":"array","title":"Tools Used"},"period_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period End"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["user_id","total_calls","total_cost_usd","tools_used"],"title":"UserToolUsageSummary"},"ValidateWritingStyleRequest":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"ValidateWritingStyleRequest"},"ValidateWritingStyleResponse":{"properties":{"approved":{"type":"boolean","title":"Approved"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["approved"],"title":"ValidateWritingStyleResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VideoUsageResponse":{"properties":{"video_limit":{"type":"integer","title":"Video Limit","description":"Maximum videos allowed per period (0 = unlimited)"},"videos_generated":{"type":"integer","title":"Videos Generated","description":"Videos generated in current period"},"videos_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Videos Remaining","description":"Videos remaining (null if unlimited)"},"limit_exceeded":{"type":"boolean","title":"Limit Exceeded","description":"True if user has hit their limit"},"unlimited":{"type":"boolean","title":"Unlimited","description":"True if user has no limit"},"limit_period":{"type":"string","enum":["daily","weekly","monthly"],"title":"Limit Period","description":"Period type"},"period_start":{"type":"string","title":"Period Start","description":"ISO timestamp of period start"},"period_end":{"type":"string","title":"Period End","description":"ISO timestamp of period end"},"estimated_cost_usd":{"type":"number","title":"Estimated Cost Usd","description":"Estimated cost this period in USD"},"updated_at":{"type":"string","title":"Updated At","description":"ISO timestamp of last update"},"last_generation":{"anyOf":[{"$ref":"#/components/schemas/LastGenerationInfo"},{"type":"null"}],"description":"Details of the most recent video generation"}},"type":"object","required":["video_limit","videos_generated","videos_remaining","limit_exceeded","unlimited","limit_period","period_start","period_end","estimated_cost_usd","updated_at"],"title":"VideoUsageResponse","description":"Video usage summary response model."},"api__models__UserSearchResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/api__models__UserSearchResult"},"type":"array","title":"Users"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["users","count"],"title":"UserSearchResponse"},"api__models__UserSearchResult":{"properties":{"email":{"type":"string","title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"upn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upn"}},"type":"object","required":["email"],"title":"UserSearchResult"},"api__routes__admin_users__UserSearchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/api__routes__admin_users__UserSearchResult"},"type":"array","title":"Results"},"truncated":{"type":"boolean","title":"Truncated"}},"type":"object","required":["results","truncated"],"title":"UserSearchResponse"},"api__routes__admin_users__UserSearchResult":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["user_id"],"title":"UserSearchResult"},"api__routes__lattice_oauth__StatusResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"connected":{"type":"boolean","title":"Connected"},"connected_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Connected At"},"account":{"type":"string","title":"Account","default":""},"reason":{"type":"string","title":"Reason","default":""}},"type":"object","required":["configured","connected"],"title":"StatusResponse"},"api__routes__m365_oauth__StatusResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"connected":{"type":"boolean","title":"Connected"},"connected_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Connected At"},"account":{"type":"string","title":"Account","default":""},"reason":{"type":"string","title":"Reason","default":""}},"type":"object","required":["configured","connected"],"title":"StatusResponse"},"api__routes__mcp_oauth__StatusResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"},"connected_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Connected At"},"scope":{"type":"string","title":"Scope","default":""},"reason":{"type":"string","title":"Reason","default":""}},"type":"object","required":["connected"],"title":"StatusResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}